00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #ifndef _ROBOT_PARAMS_H
00062 #define _ROBOT_PARAMS_H
00063 #include <string>
00064
00065 void initialize_robot_params(void);
00066
00067
00068 #define PLAYER_NUM_ROBOT_TYPES 30
00069
00070
00071 #define MOTOR_DEF_MAX_SPEED 0.5
00072 #define MOTOR_DEF_MAX_TURNSPEED DTOR(100)
00073
00074
00075
00076
00077
00078
00079 #define P2OS_CYCLETIME_USEC 200000
00080
00081
00082
00083 #define P2OS_NOMINAL_VOLTAGE 12.0
00084
00085
00086 #define SYNC0 0
00087 #define SYNC1 1
00088 #define SYNC2 2
00089
00090 enum P2OSCommand {
00091 PULSE = 0,
00092 OPEN = 1,
00093 CLOSE = 2,
00094 ENABLE = 4,
00095 SETA = 5,
00096 SETV = 6,
00097 SETO = 7,
00098 MOVE = 8,
00099 ROTATE = 9,
00100 SETRV = 10,
00101 VEL = 11,
00102 HEAD = 12,
00103 DHEAD = 13,
00104
00105 SAY = 15,
00107 JOYINFO = 17,
00108
00109 CONFIG = 18,
00110 ENCODER = 19,
00111 RVEL = 21,
00112 DCHEAD = 22,
00113 SETRA = 23,
00114 SONAR = 28,
00115 STOP = 29,
00116 DIGOUT = 30,
00117
00118 VEL2 = 32,
00119 GRIPPER = 33,
00120
00121 ADSEL = 35,
00122 GRIPPERVAL = 36,
00123 GRIPPERPACREQUEST = 37,
00124 IOREQUEST = 40,
00125 PTUPOS = 41,
00126 TTY2 = 42,
00127 GETAUX = 43,
00128 BUMP_STALL = 44,
00129 TCM2 = 45,
00130 JOYDRIVE = 47,
00131 MOVINGBLINK = 49,
00132
00133 HOSTBAUD = 50,
00134
00135 AUX1BAUD = 51,
00136
00137 AUX2BAUD = 52,
00138
00139 ESTOP = 55,
00140 ESTALL = 56,
00141 GYRO = 58,
00142
00143
00144
00145 CALCOMP = 65,
00146
00147 TTY3 = 66,
00148 GETAUX2 = 67,
00149 ARM_INFO = 70,
00150 ARM_STATUS = 71,
00151 ARM_INIT = 72,
00152 ARM_CHECK = 73,
00153 ARM_POWER = 74,
00154 ARM_HOME = 75,
00155 ARM_PARK = 76,
00156 ARM_POS = 77,
00157 ARM_SPEED = 78,
00158 ARM_STOP = 79,
00159 ARM_AUTOPARK = 80,
00160 ARM_GRIPPARK = 81,
00161
00162 ROTKP = 82,
00163 ROTKV = 83,
00164 ROTKI = 84,
00165 TRANSKP = 85,
00166 TRANSKV = 86,
00167 TRANSKI = 87,
00168 SOUND = 90,
00169 PLAYLIST = 91,
00170 SOUNDTOG = 92,
00171
00172
00173 POWER_PC = 95,
00174 POWER_LRF = 96,
00175 POWER_5V = 97,
00176 POWER_12V = 98,
00177 POWER_24V = 98,
00178 POWER_AUX_PC = 125,
00179 POWER_TOUCHSCREEN = 126,
00180 POWER_PTZ = 127,
00181 POWER_AUDIO = 128,
00182 POWER_LRF2 = 129,
00183
00184
00185 LATVEL = 110,
00186 LATACCEL = 113,
00187
00188 SETLATV = 0,
00189 };
00190
00191
00192 #define STATUSSTOPPED 0x32
00193 #define STATUSMOVING 0x33
00194 #define ENCODER 0x90
00195 #define SERAUX 0xB0
00196 #define SERAUX2 0xB8 // Added in AmigOS 1.3
00197 #define GYROPAC 0x98 // Added AROS 1.8
00198 #define ARMPAC 160 // ARMpac
00199 #define ARMINFOPAC 161 // ARMINFOpac
00200
00201
00202
00203 #define ARGINT 0x3B // Positive int (LSB, MSB)
00204 #define ARGNINT 0x1B // Negative int (LSB, MSB)
00205 #define ARGSTR 0x2B // String (Note: 1st byte is length!!)
00206
00207
00208 #define GRIPopen 1
00209 #define GRIPclose 2
00210 #define GRIPstop 3
00211 #define LIFTup 4
00212 #define LIFTdown 5
00213 #define LIFTstop 6
00214 #define GRIPstore 7
00215 #define GRIPdeploy 8
00216 #define GRIPhalt 15
00217 #define GRIPpress 16
00218 #define LIFTcarry 17
00219
00220
00221 #define CMUCAM_IMAGE_WIDTH 80
00222 #define CMUCAM_IMAGE_HEIGHT 143
00223 #define CMUCAM_MESSAGE_LEN 10
00224
00225
00226 #define DEFAULT_P2OS_PORT "/dev/ttyS0"
00227 #define DEFAULT_P2OS_TCP_REMOTE_HOST "localhost"
00228 #define DEFAULT_P2OS_TCP_REMOTE_PORT 8101
00229
00230
00231 #define DTOR(a) M_PI * a / 180.0
00232 #define RTOD(a) 180.0 * a / M_PI
00233
00234 typedef struct
00235 {
00236 double x;
00237 double y;
00238 double th;
00239 double length;
00240 double radius;
00241 } bumper_def_t;
00242
00243 typedef struct
00244 {
00245 double x;
00246 double y;
00247 double th;
00248 } sonar_pose_t;
00249
00250
00251 typedef struct
00252 {
00253 double AngleConvFactor;
00254 std::string Class;
00255 double DiffConvFactor;
00256 double DistConvFactor;
00257 int FrontBumpers;
00258 double GyroScaler;
00259 int HasMoveCommand;
00260 int Holonomic;
00261 int IRNum;
00262 int IRUnit;
00263 int LaserFlipped;
00264 std::string LaserIgnore;
00265 std::string LaserPort;
00266 int LaserPossessed;
00267 int LaserPowerControlled;
00268 int LaserTh;
00269 int LaserX;
00270 int LaserY;
00271 int MaxRVelocity;
00272 int MaxVelocity;
00273 int NewTableSensingIR;
00274 int NumFrontBumpers;
00275 int NumRearBumpers;
00276 double RangeConvFactor;
00277 int RearBumpers;
00278 int RequestEncoderPackets;
00279 int RequestIOPackets;
00280 int RobotDiagonal;
00281 int RobotLength;
00282 int RobotRadius;
00283 int RobotWidth;
00284 int RotAccel;
00285 int RotDecel;
00286 int RotVelMax;
00287 int SettableAccsDecs;
00288 int SettableVelMaxes;
00289 int SonarNum;
00290 std::string Subclass;
00291 int SwitchToBaudRate;
00292 int TableSensingIR;
00293 int TransAccel;
00294 int TransDecel;
00295 int TransVelMax;
00296 int Vel2Divisor;
00297 double VelConvFactor;
00298 sonar_pose_t sonar_pose[32];
00299
00300 } RobotParams_t;
00301
00302
00303 extern RobotParams_t PlayerRobotParams[];
00304
00305
00306 #endif