Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ERS210Info.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ERS210Info_h
00003 #define INCLUDED_ERS210Info_h
00004 
00005 #include "CommonERSInfo.h"
00006 
00007 // see http://tekkotsu.org/porting.html#configuration for more information on TGT_HAS_* flags
00008 #if defined(TGT_ERS210)
00009 # define TGT_HAS_LEDS 9
00010 # define TGT_HAS_BUTTONS 8
00011 # define TGT_HAS_IR_DISTANCE 1
00012 #endif
00013 
00014 //! Contains information about the ERS-210 Robot, such as number of joints, PID defaults, timing information, etc.
00015 namespace ERS210Info {
00016 
00017   // *******************************
00018   //       ROBOT CONFIGURATION
00019   // *******************************
00020 
00021   extern const char* const TargetName; //!< the name of the model, to be used for logging and remote GUIs
00022 
00023   const unsigned int FrameTime=8;        //!< time between frames in the motion system (milliseconds)
00024   const unsigned int NumFrames=4;        //!< the number of frames per buffer (don't forget also double buffered)
00025   const unsigned int SlowFrameTime=128;  //!< time between frames for the ears (which move slower for some reason, don't want to mix with other outputs) (milliseconds)
00026   const unsigned int NumSlowFrames=1;    //!< the number of frames per buffer being sent to ears (double buffered as well)
00027   const unsigned int SoundBufferTime=32; //!< the number of milliseconds per sound buffer... I'm not sure if this can be changed
00028   
00029   //!Corresponds to entries in ERS210Info::PrimitiveName, defined at the end of this file, these are the primary grouping
00030   /*!Right now all binary joints are slow, but perhaps this won't always be the case... hence the IsFast/Slow bitmasks to select which type, in order to be more general */
00031   //!@name Output Types Information
00032   const unsigned NumWheels = 0; //!< no wheels, just legs
00033   
00034   const unsigned JointsPerArm   =  0; //!< no arms, just legs
00035   const unsigned NumArms        =  0; //!< no arms, just legs
00036   const unsigned NumArmJoints   =  JointsPerArm*NumArms;
00037   
00038   const unsigned JointsPerLeg   =  3; //!< The number of joints per leg
00039   const unsigned NumLegs        =  4; //!< The number of legs
00040   const unsigned NumLegJoints   =  JointsPerLeg*NumLegs; //!< the TOTAL number of joints on ALL legs
00041   const unsigned NumHeadJoints  =  3; //!< The number of joints in the neck
00042   const unsigned NumTailJoints  =  2; //!< The number of joints assigned to the tail
00043   const unsigned NumMouthJoints =  1; //!< the number of joints that control the mouth
00044   const unsigned NumEarJoints   =  2; //!< The number of joints which control the ears (NOT per ear, is total)
00045   const unsigned NumButtons     =  8; //!< the number of buttons that are available, see ERS210Info::ButtonOffset_t
00046   const unsigned NumSensors     =  1+3+1+5;  //!< 1 dist, 3 accel, 1 thermo, 5 from power, see ERS210Info::SensorOffset_t
00047   const unsigned NumLEDs        =  9; //!< The number of LEDs which can be controlled
00048   
00049   const unsigned NumPIDJoints   = NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints; //!< The number of joints which use PID motion - everything except ears
00050   const unsigned NumBinJoints   = NumEarJoints; //!< The number of binary joints - just the ears (Aperios only)
00051   const unsigned NumOutputs     = NumPIDJoints + NumBinJoints + NumLEDs; //!< the total number of outputs
00052   const unsigned NumReferenceFrames = NumOutputs + 1 + NumLegs + 1 + 1; //!< for the base, paw, camera, and IR sensor reference frames
00053 
00054   const float CameraHorizFOV=57.6/180*M_PI; //!< horizontal field of view (radians)
00055   const float CameraVertFOV=47.8/180*M_PI; //!< vertical field of view (radians)
00056   const float CameraFOV=CameraHorizFOV; //!< should be set to maximum of #CameraHorizFOV or #CameraVertFOV
00057   const unsigned int CameraResolutionX=176; //!< the number of pixels available in the 'full' layer
00058   const unsigned int CameraResolutionY=144; //!< the number of pixels available in the 'full' layer
00059   const float BallOfFootRadius=27.922/2; //!< radius of the ball of the foot
00060   const float CylinderOfFootRadius=24.606/2; //!< radius of the cylinder of the foot
00061 
00062   //! true for joints which can be updated every 32 ms (all but the ears)
00063   /*! @hideinitializer */
00064   const bool IsFastOutput[NumOutputs] = { true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false };
00065   //@}
00066   
00067   
00068   
00069   // *******************************
00070   //         OUTPUT OFFSETS
00071   // *******************************
00072 
00073 
00074   //!Corresponds to entries in ERS210Info::PrimitiveName, defined at the end of this file
00075   //!@name Output Offsets
00076 
00077   const unsigned PIDJointOffset = 0; //!< The beginning of the PID Joints
00078   const unsigned LegOffset   = PIDJointOffset;           //!< the offset of the beginning of the leg joints
00079   const unsigned HeadOffset  = LegOffset+NumLegJoints;   //!< the offset of the beginning of the head joints
00080   const unsigned TailOffset  = HeadOffset+NumHeadJoints; //!< the offset of the beginning of the tail joints
00081   const unsigned MouthOffset = TailOffset+NumTailJoints; //!< the offset of the beginning of the mouth joint
00082 
00083   const unsigned LEDOffset   = PIDJointOffset + NumPIDJoints; //!< the offset of LEDs in WorldState::outputs and MotionCommand functions
00084 
00085   const unsigned BinJointOffset = LEDOffset + NumLEDs; //!< The beginning of the binary joints
00086   const unsigned EarOffset   = BinJointOffset;           //!< the offset of the beginning of the ear joints - note that ears aren't sensed.  They can be flicked by the environment and you won't know.  Nor will they be flicked back
00087 
00088   const unsigned BaseFrameOffset   = NumOutputs; //!< Use with kinematics to refer to base reference frame
00089   const unsigned PawFrameOffset    = BaseFrameOffset+1; //!< Use with kinematics to refer to paw reference frames (add appropriate LegOrder_t to specify which paw)
00090   const unsigned CameraFrameOffset = PawFrameOffset+NumLegs; //!< Use with kinematics to refer to camera reference frame
00091   const unsigned IRFrameOffset = CameraFrameOffset+1; //!< Use with kinematics to refer to infrared (distance) sensor reference frame
00092   
00093   //! the ordering of legs
00094   enum LegOrder_t {
00095     LFrLegOrder = 0, //!< left front leg
00096     RFrLegOrder,     //!< right front leg
00097     LBkLegOrder,     //!< left back leg
00098     RBkLegOrder      //!< right back leg
00099   };
00100   
00101   //! The offsets within appendages (the legs)  Note that the ordering matches the actual physical ordering of joints on the appendage (and not that of the head's TPROffset_t's)
00102   enum REKOffset_t {
00103     RotatorOffset=0, //!< moves leg forward or backward along body
00104     ElevatorOffset,  //!< moves leg toward or away from body
00105     KneeOffset       //!< moves knee
00106   };
00107   
00108   //! The offsets of appendages with tilt (elevation), pan (heading), and roll or nod joints (i.e. head)  Note that the ordering matches the actual physical ordering of joints on the appendage (and not that of the leg's REKOffset_t's)
00109   enum TPROffset_t {
00110     TiltOffset = 0, //!< tilt/elevation (vertical)
00111     PanOffset,      //!< pan/heading (horizontal)
00112     RollOffset,      //!< roll (rotational)
00113     NodOffset=RollOffset       //!< nod (second tilt)
00114   };
00115   
00116   //! The offsets of the individual legs
00117   enum LegOffset_t {
00118     LFrLegOffset = LegOffset+LFrLegOrder*JointsPerLeg, //!< beginning of left front leg
00119     RFrLegOffset = LegOffset+RFrLegOrder*JointsPerLeg, //!< beginning of right front leg
00120     LBkLegOffset = LegOffset+LBkLegOrder*JointsPerLeg, //!< beginning of left back leg
00121     RBkLegOffset = LegOffset+RBkLegOrder*JointsPerLeg  //!< beginning of right back leg
00122   };
00123   
00124   //@}
00125   
00126   //! The offsets of the individual LEDs on the head and tail.  Note that left/right are robot's point of view.  See also LEDBitMask_t
00127   enum LEDOffset_t {
00128     BotLLEDOffset = LEDOffset,//!< bottom left (red - sad)
00129     BotRLEDOffset, //!< bottom right (red - sad)
00130     MidLLEDOffset, //!< middle left (green - happy)
00131     MidRLEDOffset, //!< middle right (green - happy)
00132     TopLLEDOffset, //!< top left (red - angry)
00133     TopRLEDOffset, //!< top right (red - angry)
00134     TopBrLEDOffset,//!< top bar (green)
00135     TlRedLEDOffset,//!< red tail light
00136     TlBluLEDOffset, //!< blue tail light
00137  
00138     // alias for 220 cross-compatibility
00139     FaceFrontLeftLEDOffset = BotLLEDOffset,   //!< alias for 220 cross-compatibility
00140     FaceFrontRightLEDOffset = BotRLEDOffset,  //!< alias for 220 cross-compatibility
00141     FaceCenterLeftLEDOffset = MidLLEDOffset,  //!< alias for 220 cross-compatibility
00142     FaceCenterRightLEDOffset = MidRLEDOffset, //!< alias for 220 cross-compatibility
00143     FaceBackLeftLEDOffset = TopLLEDOffset,    //!< alias for 220 cross-compatibility
00144     FaceBackRightLEDOffset = TopRLEDOffset,   //!< alias for 220 cross-compatibility
00145     ModeLEDOffset = TopBrLEDOffset,           //!< alias for 220 cross-compatibility
00146     TailRightLEDOffset = TlRedLEDOffset,      //!< alias for 220 cross-compatibility
00147     TailLeftLEDOffset = TlBluLEDOffset        //!< alias for 220 cross-compatibility
00148   };
00149   
00150   //! Bitmasks for use when specifying combinations of LEDs (see LedEngine ) Note that left/right are robot's point of view
00151   //!@name LED Bitmasks
00152   typedef unsigned int LEDBitMask_t; //!< So you can be clear when you're refering to a LED bitmask
00153   const LEDBitMask_t BotLLEDMask = 1<<(BotLLEDOffset-LEDOffset); //!< bottom left (red - sad)
00154   const LEDBitMask_t BotRLEDMask = 1<<(BotRLEDOffset-LEDOffset); //!< bottom right (red - sad)
00155   const LEDBitMask_t MidLLEDMask = 1<<(MidLLEDOffset-LEDOffset); //!< middle left (green - happy)
00156   const LEDBitMask_t MidRLEDMask = 1<<(MidRLEDOffset-LEDOffset); //!< middle right (green - happy)
00157   const LEDBitMask_t TopLLEDMask = 1<<(TopLLEDOffset-LEDOffset); //!< top left (red - angry)
00158   const LEDBitMask_t TopRLEDMask = 1<<(TopRLEDOffset-LEDOffset); //!< top right (red - angry)
00159   const LEDBitMask_t TopBrLEDMask= 1<<(TopBrLEDOffset-LEDOffset); //!< top bar (green)
00160   const LEDBitMask_t TlRedLEDMask= 1<<(TlRedLEDOffset-LEDOffset); //!< red tail light
00161   const LEDBitMask_t TlBluLEDMask= 1<<(TlBluLEDOffset-LEDOffset); //!< blue tail light
00162 
00163   //! LEDs for face (all but tail)
00164   const LEDBitMask_t FaceLEDMask
00165   = BotLLEDMask | BotRLEDMask
00166   | MidLLEDMask | MidRLEDMask
00167   | TopLLEDMask | TopRLEDMask
00168   | TopBrLEDMask;
00169 
00170   //! LEDs for face (all but tail)
00171   const LEDBitMask_t HeadLEDMask
00172   = BotLLEDMask | BotRLEDMask
00173   | MidLLEDMask | MidRLEDMask
00174   | TopLLEDMask | TopRLEDMask
00175   | TopBrLEDMask;
00176 
00177   const LEDBitMask_t BackLEDMask = 0; //!< 210 has no back LEDs
00178   const LEDBitMask_t TailLEDMask = TlRedLEDMask|TlBluLEDMask; //!< LEDs on tail
00179   const LEDBitMask_t AllLEDMask  = (LEDBitMask_t)~0; //!< selects all of the leds
00180   //@}
00181   
00182   
00183   
00184   // *******************************
00185   //          INPUT OFFSETS
00186   // *******************************
00187 
00188 
00189   //! The order in which inputs should be stored
00190   //!@name Input Offsets
00191 
00192   //! holds offsets to different buttons in WorldState::buttons[]
00193   /*! Should be a straight mapping to the ButtonSourceIDs
00194    *
00195    *  Note that the chest (power) button is not a normal button.  It kills
00196    *  power to the motors at a hardware level, and isn't sensed in the
00197    *  normal way.  If you want to know when it is pressed (and you are
00198    *  about to shut down) see PowerSrcID::PauseSID.
00199    *
00200    *  @see WorldState::buttons @see ButtonSourceID_t */
00201   enum ButtonOffset_t {
00202     LFrPawOffset = LFrLegOrder,
00203     RFrPawOffset = RFrLegOrder,
00204     LBkPawOffset = LBkLegOrder,
00205     RBkPawOffset = RBkLegOrder,
00206     ChinButOffset= 4,
00207     BackButOffset,
00208     HeadFrButOffset, //!< not in reliable pressure units, but 1.0 is fairly stiff pressure, 0 is none
00209     HeadButOffset=HeadFrButOffset,  //!< for ERS-7 compatibility
00210     HeadBkButOffset //!< not in reliable pressure units, but 1.0 is fairly stiff pressure, 0 is none
00211   };
00212   
00213   //! Provides a string name for each button
00214   const char* const buttonNames[NumButtons] = {
00215     "LFrPaw","RFrPaw","LBkPaw","RBkPaw",
00216     "ChinBut","BackBut",
00217     "HeadFrBut","HeadBkBut"
00218   };
00219 
00220   //! holds offset to different sensor values in WorldState::sensors[]
00221   /*! @see WorldState::sensors[] */
00222   enum SensorOffset_t {
00223     IRDistOffset = 0,  //!< in millimeters
00224     BAccelOffset, //!< backward acceleration, in @f$m/s^2@f$, negative if sitting on butt (positive for faceplant)
00225     LAccelOffset, //!< acceleration to the robot's left, in @f$m/s^2@f$, negative if lying on robot's left side
00226     DAccelOffset, //!< downward acceleration, in @f$m/s^2@f$, negative if standing up... be careful about the signs on all of these...
00227     ThermoOffset, //!< in degrees Celcius
00228     PowerRemainOffset, //!< percentage, 0-1
00229     PowerThermoOffset, //!<  degrees Celcius
00230     PowerCapacityOffset, //!< milli-amp hours
00231     PowerVoltageOffset, //!< volts
00232     PowerCurrentOffset //!< milli-amp negative values (maybe positive while charging?)
00233   };
00234 
00235   //! Provides a string name for each sensor
00236   const char* const sensorNames[NumSensors] = {
00237     "IRDist",
00238     "BAccel","LAccel","DAccel",
00239     "Thermo",
00240     "PowerRemain","PowerThermo","PowerCapacity","PowerVoltage","PowerCurrent"
00241   };
00242 
00243   //@}
00244 
00245 
00246   //! Names for each of the outputs
00247   const char* const outputNames[NumOutputs] = {
00248     "LFr:rotor",
00249     "LFr:elvtr",
00250     "LFr:knee",
00251     "RFr:rotor",
00252     "RFr:elvtr",
00253     "RFr:knee",
00254     "LBk:rotor",
00255     "LBk:elvtr",
00256     "LBk:knee",
00257     "RBk:rotor",
00258     "RBk:elvtr",
00259     "RBk:knee",
00260     
00261     "NECK:tilt",
00262     "NECK:pan",
00263     "NECK:roll",
00264     
00265     "TAIL:tilt",
00266     "TAIL:pan",
00267     
00268     "MOUTH",
00269     
00270     "LED:botL",
00271     "LED:botR",
00272     "LED:midL",
00273     "LED:midR",
00274     "LED:topL",
00275     "LED:topR",
00276     "LED:topBr",
00277     
00278     "LED:tlRed",
00279     "LED:tlBlu",
00280     
00281     "EAR:left",
00282     "EAR:right"
00283   };
00284   
00285   
00286   //! provides polymorphic robot capability detection/mapping
00287   class ERS210Capabilities : public Capabilities {
00288   public:
00289     //! constructor
00290     ERS210Capabilities()
00291       : Capabilities(TargetName,NumOutputs,outputNames,NumButtons,buttonNames,NumSensors,sensorNames,PIDJointOffset,NumPIDJoints,LEDOffset,NumLEDs)
00292     {
00293       // ers-7 button alias
00294       buttonToIndex["HeadBut"]=HeadButOffset;
00295       // 220 led aliases
00296       outputToIndex["LED:bkL1"]=TailLeftLEDOffset;
00297       outputToIndex["LED:bkL2"]=TailRightLEDOffset;
00298     }
00299   };
00300   //! allocation declared in RobotInfo.cc
00301   extern ERS210Capabilities capabilities;
00302   
00303   
00304   //! the joint identifier strings used to refer to specific joints in OPEN-R (but not needed for others)
00305   /*!@showinitializer 
00306    * @warning IMPORTANT!!!!  DO NOT CHANGE THE ORDER OF ITEMS IN THIS TABLE!!!\n
00307    *
00308    * The offset consts defined in this file correspond to this table and will make life easier
00309    * if you feel the need to reorder things, but they aren't used perfect @e everywhere \n
00310    * In particular, assumptions are made that the pid joints will be in slots 0-numPIDJoints
00311    * and that the fast outputs (ie NOT ears) will be in slots 0-NumFastOutputs\n
00312    * There may be other assumptions not noted here!!!
00313    * @note These entries DON'T correspond to the CPC index numbers defined in WorldState (this only lists joints, and in a different order defined by OPEN-R, that one has sensors as well*/
00314   const char* const PrimitiveName [NumOutputs] = {
00315     "PRM:/r2/c1-Joint2:j1",       //!< the left front leg   the rotator
00316     "PRM:/r2/c1/c2-Joint2:j2",    //!< the left front leg   the elevator 
00317     "PRM:/r2/c1/c2/c3-Joint2:j3", //!< the left front leg   the knee 
00318     "PRM:/r4/c1-Joint2:j1",       //!< the right front leg   the rotator
00319     "PRM:/r4/c1/c2-Joint2:j2",    //!< the right front leg    the elevator 
00320     "PRM:/r4/c1/c2/c3-Joint2:j3", //!< the right front leg   the knee 
00321     
00322     "PRM:/r3/c1-Joint2:j1",       //!< the left hind leg   the rotator
00323     "PRM:/r3/c1/c2-Joint2:j2",    //!< the left hind leg   the elevator 
00324     "PRM:/r3/c1/c2/c3-Joint2:j3", //!< the left hind leg   the knee
00325     "PRM:/r5/c1-Joint2:j1",       //!< the right hind leg   the rotator
00326     "PRM:/r5/c1/c2-Joint2:j2",    //!< the right hind leg   the elevator 
00327     "PRM:/r5/c1/c2/c3-Joint2:j3", //!< the right hind leg   the knee 
00328 
00329     "PRM:/r1/c1-Joint2:j1",       //!< the neck  tilt (12)
00330     "PRM:/r1/c1/c2-Joint2:j2",    //!< the neck   pan 
00331     "PRM:/r1/c1/c2/c3-Joint2:j3", //!< the neck   roll 
00332     
00333     "PRM:/r6/c2-Joint2:j2",       //!< the tail tilt (15)       // *** NOTE ***
00334     "PRM:/r6/c1-Joint2:j1",       //!< the tail pan             // CHANGE_ET 12/16/01 matches neck order
00335     
00336     "PRM:/r1/c1/c2/c3/c4-Joint2:j4", //!< the mouth (17)
00337     
00338     "PRM:/r1/c1/c2/c3/l1-LED2:l1", //!< lower  left  LED (18)
00339     "PRM:/r1/c1/c2/c3/l4-LED2:l4", //!< lower  right LED
00340     "PRM:/r1/c1/c2/c3/l2-LED2:l2", //!< middle left  LED
00341     "PRM:/r1/c1/c2/c3/l5-LED2:l5", //!< middle right LED
00342     "PRM:/r1/c1/c2/c3/l3-LED2:l3", //!< upper  left  LED
00343     "PRM:/r1/c1/c2/c3/l6-LED2:l6", //!< upper  right LED
00344     "PRM:/r1/c1/c2/c3/l7-LED2:l7", //!< top          LED
00345     
00346     "PRM:/r6/l2-LED2:l2", //!< tail red  LED
00347     "PRM:/r6/l1-LED2:l1", //!< tail blue LED
00348     
00349     "PRM:/r1/c1/c2/c3/e1-Joint3:j5", //!< left ear (27)
00350     "PRM:/r1/c1/c2/c3/e2-Joint3:j6" //!< right ear
00351   };
00352 
00353   //! use to open speaker connectio with the system
00354   const char* const SpeakerLocator="PRM:/r1/c1/c2/c3/s1-Speaker:S1";
00355 
00356   //! use to open camera connection with the system
00357   const char* const CameraLocator="PRM:/r1/c1/c2/c3/i1-FbkImageSensor:F1";
00358 
00359   //Old PID table:
00360   /*const word Pid[NumPIDJoints][6] = {
00361     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00362     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00363     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00364     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00365     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00366     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00367     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00368     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00369     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00370     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00371     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00372     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00373     
00374     { 0x0A, 0x08, 0x0C, 0x0E, 0x02, 0x0F },
00375     { 0x0D, 0x08, 0x0B, 0x0E, 0x02, 0x0F },
00376     { 0x10, 0x08, 0x0C, 0x0E, 0x02, 0x0F }, // P was 0x0C, updated as seen on https://www.openr.org/page1_2001/gain.html 8/13/2002
00377     
00378     { 0x0A, 0x00, 0x18, 0x0E, 0x02, 0x0F },
00379     { 0x07, 0x00, 0x11, 0x0E, 0x02, 0x0F },
00380     
00381     { 0x0E, 0x08, 0x10, 0x0E, 0x02, 0x0F }, //  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
00382   };*/
00383 
00384   //! This table holds the default PID values for each joint.  see PIDMC
00385   const float DefaultPIDs[NumPIDJoints][3] =
00386     {
00387       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00388       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00389       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00390       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00391       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00392       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00393       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00394       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00395       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00396       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00397       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00398       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00399 
00400       { 0x0A/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0C/(double)(1<<(16-0xF)) },
00401       { 0x0D/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0B/(double)(1<<(16-0xF)) },
00402       { 0x0A/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0C/(double)(1<<(16-0xF)) },
00403 
00404       { 0x0A/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x18/(double)(1<<(16-0xF)) },
00405       { 0x07/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x11/(double)(1<<(16-0xF)) },
00406 
00407       { 0x0E/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x10/(double)(1<<(16-0xF)) }
00408     };
00409 
00410   //! These will control the shift values given to the system.  see PIDMC
00411   const unsigned char DefaultPIDShifts[3] = {0x0E, 0x02, 0x0F};
00412     
00413   //!These values are Sony's recommended maximum joint velocities, in rad/ms
00414   /*! a value <= 0 means infinite speed (e.g. LEDs) 
00415    *  
00416    *  These limits are <b>not</b> enforced by the framework.  They are simply available for you to use as you see fit.
00417    *  HeadPointerMC is (as of v1.6) the only included MotionCommand to actually use these values. */
00418   const float MaxOutputSpeed[NumOutputs] = {
00419     2.8143434e-03,     //Legs LR,FB,REK
00420     2.4980025e-03,
00421     2.8361600e-03,
00422     2.8143434e-03,
00423     2.4980025e-03,
00424     2.8361600e-03,
00425     2.8143434e-03,
00426     2.4980025e-03,
00427     2.8361600e-03,
00428     2.8143434e-03,
00429     2.4980025e-03,
00430     2.8361600e-03,
00431   
00432     2.1053034e-03,     //Head TPR
00433     3.0106930e-03,
00434     3.0106930e-03,
00435   
00436     4.4724062e-03,     //Tail
00437     4.4724062e-03,
00438   
00439     4.3742314e-03,     //Mouth
00440     
00441     0,0,0,0,0,0,0,0,0, //LEDs
00442     
00443     0,0                //Ears
00444   };
00445 
00446   #ifndef RAD
00447     //!Just a little macro for converting degrees to radians
00448   #define RAD(deg) (((deg) * M_PI ) / 180.0)
00449     //!a flag so we undef these after we're done - do you have a cleaner solution?
00450   #define __RI_RAD_FLAG
00451   #endif
00452   
00453   //! This table holds the software limits of each of the outputs
00454   const double outputRanges[NumOutputs][2] =
00455     {
00456       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left front REK
00457       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right front REK
00458       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left back REK
00459       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right back REK
00460 
00461       { RAD(-82),RAD(43) },{ RAD(-89.6),RAD(89.6) },{ RAD(-29),RAD(29) }, //neck TPR
00462         
00463       { RAD(-22),RAD(22) },{ RAD(-22),RAD(22) }, // tail tp
00464 
00465       { RAD(-47),RAD(-3) }, //mouth
00466 
00467       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00468     
00469       {0,1},{0,1} //ears
00470     };
00471 
00472   //! This table holds the mechanical limits of each of the outputs
00473   const double mechanicalLimits[NumOutputs][2] =
00474     {
00475       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left front jsk
00476       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right front jsk
00477       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left back jsk
00478       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right back jsk
00479 
00480       { RAD(-85),RAD(46) },{ RAD(-92.6),RAD(92.6) },{ RAD(-32),RAD(32) }, //neck tpr
00481         
00482       { RAD(-25),RAD(25) },{ RAD(-25),RAD(25) }, // tail tp
00483 
00484       { RAD(-50),RAD(0) }, //mouth
00485 
00486       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00487     
00488       {0,1},{0,1} //ears
00489     };
00490 
00491 #ifdef __RI_RAD_FLAG
00492 #undef RAD
00493 #undef __RI_RAD_FLAG
00494 #endif
00495 
00496   /*! @name CPC IDs
00497    * values defined by OPEN-R, used to interface with lower level OPEN-R code to read sensors - DOESN'T correspond to ERS210Info::PrimitiveName */
00498   const int CPCJointNeckTilt           =  0; // Head
00499   const int CPCJointNeckPan            =  1;
00500   const int CPCJointNeckRoll           =  2;
00501   const int CPCSensorHeadBackPressure  =  3;
00502   const int CPCSensorHeadFrontPressure =  4;
00503   const int CPCSensorPSD               =  5;
00504   const int CPCJointMouth              =  6;
00505   const int CPCSensorChinSwitch        =  7;
00506   const int CPCJointLFRotator          =  8; // Left front leg
00507   const int CPCJointLFElevator         =  9;
00508   const int CPCJointLFKnee             = 10;
00509   const int CPCSensorLFPaw             = 11;
00510   const int CPCJointLHRotator          = 12; // Left hind leg
00511   const int CPCJointLHElevator         = 13;
00512   const int CPCJointLHKnee             = 14;
00513   const int CPCSensorLHPaw             = 15;
00514   const int CPCJointRFRotator          = 16; // Right front leg
00515   const int CPCJointRFElevator         = 17;
00516   const int CPCJointRFKnee             = 18;
00517   const int CPCSensorRFPaw             = 19;
00518   const int CPCJointRHRotator          = 20; // Right hind leg
00519   const int CPCJointRHElevator         = 21;
00520   const int CPCJointRHKnee             = 22;
00521   const int CPCSensorRHPaw             = 23;
00522   const int CPCJointTailPan            = 24; // Tail
00523   const int CPCJointTailTilt           = 25;
00524   const int CPCSensorThermoSensor      = 26;
00525   const int CPCSensorBackSwitch        = 27;
00526   const int CPCSensorAccelFB           = 28; //!< Front-back; see RobotInfo::BAccelOffset 
00527   const int CPCSensorAccelLR           = 29; //!< Left-right; see RobotInfo::LAccelOffset 
00528   const int CPCSensorAccelUD           = 30; //!< Up-down; see RobotInfo::DAccelOffset 
00529   //@}
00530 
00531 }
00532   
00533 /*! @file
00534  * @brief Defines RobotInfo namespace for ERS-210 models, gives some information about the robot's capabilities, such as joint counts, offsets, names and PID values
00535  * @author ejt (Creator)
00536  *
00537  * $Author: ejt $
00538  * $Name: tekkotsu-4_0 $
00539  * $Revision: 1.37 $
00540  * $State: Exp $
00541  * $Date: 2007/11/09 19:01:14 $
00542  */
00543 
00544 #endif

Tekkotsu v4.0
Generated Thu Nov 22 00:54:52 2007 by Doxygen 1.5.4