00001
00002 #ifndef INCLUDED_CreateInfo_h
00003 #define INCLUDED_CreateInfo_h
00004
00005 #include <cmath>
00006 #include <stdlib.h>
00007 #include "CommonInfo.h"
00008 using namespace RobotInfo;
00009
00010
00011 #if defined(TGT_CREATE)
00012 # define TGT_IS_CREATE
00013 # define TGT_HAS_WHEELS 2
00014 # define TGT_HAS_BUTTONS 15
00015 # define TGT_HAS_LEDS 4
00016 # define TGT_HAS_CAMERA 1
00017 #endif
00018
00019
00020 namespace CreateInfo {
00021
00022
00023
00024
00025
00026 extern const char* const TargetName;
00027
00028 const unsigned int FrameTime=15;
00029 const unsigned int NumFrames=1;
00030 const unsigned int SoundBufferTime=32;
00031
00032
00033 const unsigned NumWheels = 2;
00034
00035 const unsigned FingerJointsPerArm = 0;
00036 const unsigned JointsPerArm = 0;
00037 const unsigned NumArms = 0;
00038 const unsigned NumArmJoints = JointsPerArm*NumArms;
00039
00040 const unsigned JointsPerLeg = 0;
00041 const unsigned NumLegs = 0;
00042 const unsigned NumLegJoints = JointsPerLeg*NumLegs;
00043 const unsigned NumHeadJoints = 0;
00044 const unsigned NumTailJoints = 0;
00045 const unsigned NumMouthJoints = 0;
00046 const unsigned NumEarJoints = 0;
00047 const unsigned NumButtons = 15;
00048 const unsigned NumSensors = 22;
00049 const unsigned NumLEDs = 4;
00050 const unsigned NumFacePanelLEDs = 0;
00051
00052 const unsigned NumPIDJoints = NumWheels;
00053 const unsigned NumOutputs = NumPIDJoints + NumLEDs + 1;
00054 const unsigned NumReferenceFrames = NumOutputs + 1 + NumArms + 1;
00055
00056
00057
00058 using namespace CameraGeneric60;
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 const unsigned PIDJointOffset = 0;
00070 const unsigned WheelOffset = PIDJointOffset;
00071 const unsigned HeadOffset = WheelOffset+NumWheels;
00072
00073 const unsigned LEDOffset = HeadOffset+NumHeadJoints;
00074
00075 const unsigned ModeOffset = LEDOffset + NumLEDs;
00076
00077 const unsigned BaseFrameOffset = NumOutputs;
00078 const unsigned CameraFrameOffset = BaseFrameOffset + 1;
00079
00080
00081 enum TPROffset_t {
00082 PanOffset = 0,
00083 TiltOffset,
00084 NodOffset = TiltOffset
00085 };
00086
00087
00088 enum HeadOffset_t {
00089 HeadPanOffset = HeadOffset,
00090 HeadTiltOffset,
00091 };
00092
00093 enum WheelOffset_t {
00094 LWheelOffset=WheelOffset,
00095 RWheelOffset
00096 };
00097
00098
00099
00100 enum LEDOffset_t {
00101 PowerRedLEDOffset=LEDOffset,
00102 PowerGreenLEDOffset,
00103 PlayLEDOffset,
00104 AdvanceLEDOffset
00105 };
00106
00107 const LEDOffset_t RedLEDOffset = PowerRedLEDOffset;
00108 const LEDOffset_t BlueLEDOffset = AdvanceLEDOffset;
00109 const LEDOffset_t GreenLEDOffset = PlayLEDOffset;
00110 const LEDOffset_t YellowLEDOffset = AdvanceLEDOffset;
00111
00112 typedef unsigned int LEDBitMask_t;
00113
00114 const LEDBitMask_t BlueLEDMask = (1<<(AdvanceLEDOffset-LEDOffset)) |
00115 (1<<(PowerRedLEDOffset-LEDOffset));
00116 const LEDBitMask_t GreenLEDMask = 1<<(GreenLEDOffset-LEDOffset);
00117 const LEDBitMask_t YellowLEDMask = 1<<(YellowLEDOffset-LEDOffset);
00118 const LEDBitMask_t RedLEDMask = 1<<(RedLEDOffset-LEDOffset);
00119
00120 const LEDBitMask_t PowerRedLEDMask = 1<<(PowerRedLEDOffset-LEDOffset);
00121 const LEDBitMask_t PowerGreenLEDMask = 1<<(PowerGreenLEDOffset-LEDOffset);
00122 const LEDBitMask_t PlayLEDMask = 1<<(PlayLEDOffset-LEDOffset);
00123 const LEDBitMask_t AdvanceLEDMask = 1<<(AdvanceLEDOffset-LEDOffset);
00124
00125
00126 const LEDBitMask_t FaceLEDMask = 0;
00127
00128 const LEDBitMask_t AllLEDMask = (LEDBitMask_t)~0;
00129
00130
00131
00132 const fmat::Column<3> AgentBoundingBoxBaseFrameOffset = fmat::pack(0,0,0);
00133
00134
00135 const fmat::Column<3> AgentBoundingBoxHalfDims = fmat::pack(304.8/2, 304.8/2, 0);
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 enum ButtonOffset_t {
00151 PlayButOffset,
00152 AdvanceButOffset,
00153 WallButOffset,
00154 DropCasterButOffset,
00155 DropLeftWheelButOffset,
00156 DropRightWheelButOffset,
00157 BumpLeftButOffset,
00158 BumpRightButOffset,
00159 OvercurrentLeftWheelOffset,
00160 OvercurrentRightWheelOffset,
00161 LowSideDriver0ButOffset,
00162 LowSideDriver1ButOffset,
00163 LowSideDriver2ButOffset,
00164 BaseChargerButOffset,
00165 InternalChargerButOffset
00166 };
00167
00168 const ButtonOffset_t GreenButOffset = PlayButOffset;
00169 const ButtonOffset_t YellowButOffset = AdvanceButOffset;
00170 const ButtonOffset_t RedButOffset = PlayButOffset;
00171
00172
00173 const char* const buttonNames[NumButtons+1] = {
00174 "Play", "Advance",
00175 "Wall",
00176 "CasterDrop", "LWheelDrop", "RWheelDrop",
00177 "LBump", "RBump",
00178 "LOverCurrent", "ROverCurrent",
00179 "DriverLow0", "DriverLow1", "DriverLow2",
00180 "BaseCharger", "InternalCharger",
00181 NULL
00182 };
00183
00184
00185
00186 enum SensorOffset_t {
00187 DigitalInput0Offset,
00188 DigitalInput1Offset,
00189 DigitalInput2Offset,
00190 DigitalInput3Offset,
00191 AnalogSignalOffset,
00192 WallSignalOffset,
00193 IRCommOffset,
00194 CliffLeftSignalOffset,
00195 CliffFrontLeftSignalOffset,
00196 CliffFrontRightSignalOffset,
00197 CliffRightSignalOffset,
00198 EncoderDistanceOffset,
00199 EncoderAngleOffset,
00200 VoltageOffset,
00201 CurrentOffset,
00202 BatteryChargeOffset,
00203 BatteryTempOffset,
00204 ChargingStateOffset,
00205 ModeStateOffset,
00206 GPSXOffset,
00207 GPSYOffset,
00208 GPSHeadingOffset,
00209 };
00210
00211 enum IRComm_t {
00212 IR_REMOTE_LEFT=129,
00213 IR_REMOTE_FORWARD,
00214 IR_REMOTE_RIGHT,
00215 IR_REMOTE_SPOT,
00216 IR_REMOTE_MAX,
00217 IR_REMOTE_SMALL,
00218 IR_REMOTE_MEDIUM,
00219 IR_REMOTE_LARGE,
00220 IR_REMOTE_PAUSE,
00221 IR_REMOTE_POWER,
00222 IR_REMOTE_ARC_LEFT,
00223 IR_REMOTE_ARC_RIGHT,
00224 IR_REMOTE_STOP,
00225 IR_REMOTE_SEND,
00226 IR_REMOTE_DOCK,
00227 IR_BASE_RED=248,
00228 IR_BASE_GREEN=244,
00229 IR_BASE_FORCE=242,
00230 IR_BASE_RED_GREEN=252,
00231 IR_BASE_RED_FORCE=250,
00232 IR_BASE_GREEN_FORCE=246,
00233 IR_BASE_RED_GREEN_FORCE=254
00234 };
00235
00236
00237
00238
00239
00240 enum ChargingState_t {
00241 CHARGING_OFF,
00242 CHARGING_RECONDITIONING,
00243 CHARGING_FULL,
00244 CHARGING_TRICKLE,
00245 CHARGING_WAITING,
00246 CHARGING_FAULT
00247 };
00248
00249 enum ModeState_t {
00250 MODE_OFF,
00251 MODE_PASSIVE,
00252 MODE_SAFE,
00253 MODE_FULL
00254 };
00255
00256
00257 const char* const sensorNames[NumSensors+1] = {
00258 "DigitalIn0",
00259 "DigitalIn1",
00260 "DigitalIn2",
00261 "DigitalIn3",
00262 "AnalogIn",
00263 "WallSignal",
00264 "IR",
00265 "CliffLeftSignal",
00266 "CliffFrontLeftSignal",
00267 "CliffFrontRightSignal",
00268 "CliffRight",
00269 "Distance",
00270 "Angle",
00271 "BatteryVoltage",
00272 "BatteryCurrent",
00273 "BatteryCharge",
00274 "BatteryTemp",
00275 "ChargingState",
00276 "ModeState",
00277 "GPSX",
00278 "GPSY",
00279 "GPSHeading",
00280 NULL
00281 };
00282
00283
00284
00285
00286
00287 const char* const outputNames[NumReferenceFrames+1] = {
00288 "WHEEL:L",
00289 "WHEEL:R",
00290 "LED:Power(Red)",
00291 "LED:Power(Green)",
00292 "LED:Play",
00293 "LED:Advance",
00294 "DesiredMode",
00295 "BaseFrame",
00296 "CameraFrame",
00297 NULL
00298 };
00299
00300
00301 extern const Capabilities capabilities;
00302
00303
00304 const float DefaultPIDs[NumPIDJoints+1][3] = {
00305 {1,0,0},
00306 {1,0,0}
00307 };
00308
00309
00310 const float MaxOutputSpeed[NumOutputs] = {
00311 0,
00312 0,
00313 0,
00314 0,
00315 0,
00316 0,
00317 0
00318 };
00319
00320 #ifndef RAD
00321
00322 #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00323
00324 #define __RI_RAD_FLAG
00325 #endif
00326
00327
00328 const float outputRanges[NumOutputs][2] =
00329 {
00330 { -500 , 500 },
00331 { -500 , 500 },
00332 { 0 , 1 },
00333 { 0 , 1 },
00334 { 0 , 1 },
00335 { 0 , 1 },
00336 { MODE_PASSIVE, MODE_SAFE }
00337 };
00338
00339
00340
00341 const float mechanicalLimits[NumOutputs][2] =
00342 {
00343 { -500 , 500 },
00344 { -500 , 500 },
00345 { 0 , 1 },
00346 { 0 , 1 },
00347 { 0 , 1 },
00348 { 0 , 1 },
00349 { MODE_PASSIVE, MODE_SAFE }
00350 };
00351
00352 #ifdef __RI_RAD_FLAG
00353 #undef RAD
00354 #undef __RI_RAD_FLAG
00355 #endif
00356 }
00357
00358
00359
00360
00361
00362
00363 #endif