/* | ----------------------------------------------------------------------------- | Filename: hdtsocc.c | | Author: Thomas Braunl (braunl@ee.uwa.edu.au) | Klaus Schmitt (kschmitt@informatik.uni-kl.de) | Thomas Lampart (lamparts@autolife.informatik.uni-stuttgart.de) | Description: | ------- | HDT data for EyeBot MK3, UWA Sep. 1998, modified for soccerbot | ----------------------------------------------------------------------------- */ #define VERSION 1.1 /* User specific version nr. for information */ #define NAME "A" /* Unique name of the platform max. 10 chars, just info */ #define ID 1 /* Unique platform id (int), just for inform. */ #include "hdt.h" #include "hdt_sem.h" /* The HDT structure */ /*-------------------*/ int magic = 123456789; extern HDT_entry_type HDT[]; HDT_entry_type *hdtbase = &HDT[0]; #include "types.h" #include "const.h" #include "rs232.h" #include "cam.h" #include "librobi/librobi.h" /* PSD-sensor #0 (RAP0-L), range 80 - 750 mm */ short distleft[128] = { 80,80,80,80,80,80,80,80,80,80, /* 1 - 20 */ 80,80,82,85,87,90,92,94,96,98, /* 21 - 40 */ 101,103,105,107,109,110,113,116,118,121, /* 41 - 60 */ 123,126,128,131,134,137,140,142,145,148, /* 61 - 80 */ 151,154,158,161,165,170,175,180,185,190, /* 81 - 100 */ 195,200,205,210,216,223,236,240,250,260, /* 101 - 120 */ 270,280,290,300,310,330,330,370,350,410, /* 121 - 140 */ 370,450,430,450,470,490,510,530,550,570, /* 141 - 160 */ 590,610,650,670,690,750,9999,9999,9999,9999, /* 161 - 180 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 181 - 200 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 201 - 220 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 221 - 240 */ 9999,9999,9999,9999,9999,9999,9999,9999}; /* 241 - 256 */ /* PSD-sensor #1 (RAP1-F), range 100 - 740 mm */ short distfront[128] = { 100,100,100,100,100,100,100,100,100,100, /* 1 - 20 */ 100,103,106,109,112,115,118,121,123,126, /* 21 - 40 */ 128,131,133,136,138,141,143,146,148,151, /* 41 - 60 */ 154,157,159,163,166,170,172,175,178,181, /* 61 - 80 */ 185,190,193,196,200,204,208,212,217,222, /* 81 - 100 */ 227,232,237,242,247,252,260,266,273,280, /* 101 - 120 */ 286,293,300,310,320,326,333,346,353,370, /* 121 - 140 */ 380,390,410,410,430,450,460,480,500,520, /* 141 - 160 */ 520,560,580,600,620,660,680,740,9999,9999, /* 161 - 180 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 181 - 200 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 201 - 220 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 221 - 240 */ 9999,9999,9999,9999,9999,9999,9999,9999}; /* 241 - 256 */ /* PSD-sensor #2 (RAP2-R), range 80 - 530 mm */ short distright[128] = { 80,80,80,80,80,80,80,80,80,80, /* 1 - 20 */ 80,80,80,80,80,80,80,82,85,88, /* 21 - 40 */ 91,93,95,97,100,102,104,106,108,111, /* 41 - 60 */ 113,116,118,121,123,126,128,131,134,137, /* 61 - 80 */ 140,142,145,148,151,154,158,161,165,168, /* 81 - 100 */ 171,175,180,184,188,192,197,202,207,212, /* 101 - 120 */ 217,222,227,232,240,246,253,260,266,273, /* 121 - 140 */ 286,293,300,310,320,330,350,350,370,390, /* 141 - 160 */ 390,430,430,470,470,530,530,9999,9999,9999, /* 161 - 180 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 181 - 200 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 201 - 220 */ 9999,9999,9999,9999,9999,9999,9999,9999,9999,9999, /* 221 - 240 */ 9999,9999,9999,9999,9999,9999,9999,9999}; /* 241 - 256 */ /* PSD-sensor #1, wall = white wall of soccer field (different for other obstacles) */ short dist0[128] = {60,60,60,60,60,60,60,60,60,60, /* 1- 20 */ 60,60,60,60,60,60,60,60,60,60, /* 21- 40 */ 60,60,80,100,109,110,112,114,117,119, /* 41- 60 */ 122,125,129,133,137,141,146,150,154,158, /* 61- 80 */ 162,166,170,175,180,185,190,196,202,208, /* 81-100 */ 214,220,226,232,238,244,250,256,262,268, /* 101-120 */ 274,280,286,292,297,303,309,315,321,328, /* 121-140 */ 335,342,350,359,367,374,383,392,402,412, /* 141-160 */ 422,433,446,459,473,495,518,540,562,586, /* 161-180 */ 611,641,671,701,752,800,852,910,953,999, /* 181-200 */ 999,999,999,999,999,999,999,999,999,999, /* 201-220 */ 999,999,999,999,999,999,999,999,999,999, /* 221-240 */ 999,999,999,999,999,999,999,999}; /* 241-256 */ /* PSD-sensor #2,#3,#5, wall = white wall of soccer field (different for other obstacles) */ short dist1[128] = { 60,60,60,60,60,60,60,60,60,60, /* 1- 20 */ 60,60,60,60,80,90,95,96,97,98, /* 21- 40 */ 100,102,104,106,108,111,114,117,129,122, /* 41- 60 */ 126,129,135,138,142,147,149,152,155,158, /* 61- 80 */ 162,165,162,168,171,174,177,181,184,187, /* 81-100 */ 194,199,203,207,211,215,219,223,227,231, /* 101-120 */ 235,239,244,249,255,260,263,268,270,273, /* 121-140 */ 277,283,287,293,298,304,310,315,320,327, /* 141-160 */ 330,336,343,348,357,367,372,380,389,403, /* 161-180 */ 420,430,444,455,467,483,505,535,577,637, /* 181-200 */ 690,750,800,850,999,999,999,999,999,999, /* 201-220 */ 999,999,999,999,999,999,999,999,999,999, /* 221-240 */ 999,999,999,999,999,999,999,999}; /* 241-256 */ short dist2[128] = { 60,60,60,60,70,80,82,84,86,88, /* 1- 20 */ 90,92,94,96,97,99,101,102,103,106, /* 21- 40 */ 107,109,111,113,115,118,120,123,127,131, /* 41- 60 */ 134,137,140,143,146,149,154,159,164,169, /* 61- 80 */ 173,176,180,185,192,199,204,209,215,220, /* 81-100 */ 224,227,232,238,241,247,251,256,261,268, /* 101-120 */ 275,281,288,293,297,302,308,315,320,325, /* 121-140 */ 332,342,353,356,365,373,380,393,405,413, /* 141-160 */ 430,442,459,475,485,510,535,552,570,600, /* 161-180 */ 630,660,999,999,999,999,999,999,999,999, /* 181-200 */ 999,999,999,999,999,999,999,999,999,999, /* 201-220 */ 999,999,999,999,999,999,999,999,999,999, /* 221-240 */ 999,999,999,999,999,999,999,999}; /* 241-256 */ BYTE motconv0[101]= { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19, 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39, 40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59, 60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99, 100}; /* DC motors */ motor_type motor0 = {2, 1, TIMER1, 8191, (void*)OutBase, 3, 2, (BYTE*)&motconv0}; motor_type motor1 = {2, 0, TIMER1, 8191, (void*)OutBase, 0, 1, (BYTE*)&motconv0}; quad_type decoder0 = {0, 2, 3, MOTOR_LEFT, 3235, 2.0}; quad_type decoder1 = {0, 5, 4, MOTOR_RIGHT, 3235, 2.0}; vw_type drive = {0, DIFFERENTIAL_DRIVE, {QUAD_LEFT, QUAD_RIGHT, 0.084}}; /* SERVOs */ /* type, TPU-channel, Timer2, 20ms period, 0.7ms min, 1.7ms max */ /* here: servo 1 has TPU channel 2, and so on */ servo_type servo11 = {2, 12, TIMER2, 20000, 2000, 1366}; /* camera */ servo_type servo12 = {2, 13, TIMER2, 20000, 1675, 1464}; /* kicker */ /* PSD-infrared */ psd_type psdleft = {0, 14, (BYTE*)InBase, 0, AH, (BYTE*)OutBase, 4, AH, (short*)&distleft}; psd_type psdfront = {0, 14, (BYTE*)InBase, 1, AH, (BYTE*)OutBase, 4, AH, (short*)&distfront}; psd_type psdright = {0, 14, (BYTE*)InBase, 2, AH, (BYTE*)OutBase, 4, AH, (short*)&distright}; /* EyeBot SUMMARY */ info_type roboinfo = {0,PLATFORM,SER115200,RTSCTS,SERIAL1,0,0,AUTOBRIGHTNESS,BATTERY_ON,35,VERSION,NAME,ID}; /* waitstates = 0..13, Fast Termination = 14, External = 15 */ /* Version, ROM, RAM, LCD, IO, Parallel+Serial2/3 */ /* 16MHz - 20Mhz */ /* waitstate_type waitstates = {0,3,0,1,0,2}; */ /* 21MHz - 41Mhz */ waitstate_type waitstates = {0,3,1,2,1,2}; /* this is a test HDT structure which contains ALL EyeBot hardware devices */ HDT_entry_type HDT[] = { {MOTOR,MOTOR_RIGHT,"RIGHT",(void *)&motor0}, {MOTOR,MOTOR_LEFT,"LEFT",(void *)&motor1}, {QUAD, QUAD_RIGHT,"RIGHT",(void *)&decoder1}, {QUAD, QUAD_LEFT,"LEFT",(void *)&decoder0}, {VW,VW,"Drive",(void *)&drive}, /* {BUMP, BUMP_LEFT,"LEFT",(void *)&bumper0}, */ /* {IR, IR_LF,"LF",(void *)&ir0}, */ {SERVO,SERVO11,"S11-C",(void *)&servo11}, {SERVO,SERVO12,"S12-K",(void *)&servo12}, {PSD,PSD_LEFT, "P0-L", (void *)&psdleft}, {PSD,PSD_FRONT, "P1-F", (void *)&psdfront}, {PSD,PSD_RIGHT, "P2-R", (void *)&psdright}, {WAIT,WAIT,"WAIT",(void *)&waitstates}, {INFO,INFO,"INFO",(void *)&roboinfo}, {END_OF_HDT,UNKNOWN_SEMANTICS,"END",(void *)0} };