Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

ERS2xxInfo.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 
00003 // Mad props to Daishi MORI, the 220 master chief, for porting to the 220 ;)
00004 
00005 #ifndef INCLUDED_ERS2xxInfo_h
00006 #define INCLUDED_ERS2xxInfo_h
00007 
00008 #include <math.h>
00009 #ifndef PLATFORM_APERIOS
00010 typedef unsigned short word; //!< otherwise defined in Types.h
00011 #else
00012 #include <Types.h>
00013 #endif
00014 
00015 //! Contains information about the ERS-2xx series of robot, such as number of joints, PID defaults, timing information, etc.
00016 /*! This is a compatability mode, which allows dual-booting
00017  *  of the same memory stick on both models without needing
00018  *  to recompile, at the expense of (a little) runtime speed. */
00019 namespace ERS2xxInfo {
00020 
00021   // *******************************
00022   //       ROBOT CONFIGURATION
00023   // *******************************
00024 
00025 
00026   const unsigned int FrameTime=8;        //!< time between frames in the motion system (milliseconds)
00027   const unsigned int NumFrames=4;        //!< the number of frames per buffer (don't forget also double buffered)
00028   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)
00029   const unsigned int NumSlowFrames=1;    //!< the number of frames per buffer being sent to ears (double buffered as well)
00030   const unsigned int SoundBufferTime=32; //!< the number of milliseconds per sound buffer... I'm not sure if this can be changed
00031   
00032   //!Corresponds to entries in PrimitiveName, defined at the end of this file, these are the primary grouping
00033   /*!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 */
00034   //!@name Output Types Information
00035   const unsigned NumPIDJoints   = 18; //!< The number of joints which use PID motion - everything
00036   const unsigned NumLEDs        = 22; //!< The number LEDs which can be controlled
00037   const unsigned NumBinJoints   =  2; //!< The number of binary joints (210 has ears)
00038   const unsigned NumOutputs     = NumPIDJoints + NumBinJoints + NumLEDs; //!< the total number of outputs
00039 
00040   const bool IsFastOutput[NumOutputs] = {
00041     // for PID joints
00042     true, true, true, //legs
00043     true, true, true,
00044     true, true, true,
00045     true, true, true,
00046     true, true, true, //head
00047     true, true,       //tail
00048     true,             //mouth
00049     // for LEDs
00050     true, true, true,           // face left side LEDs x3
00051     true, true, true,           // face right side LEDs x3
00052     true,                       // head mode LED x1
00053     true, true, true,           // back left multi LEDs x3
00054     true, true, true,           // back right multi LEDs x3
00055     true, true, true,           // tail LEDs x3
00056     true, true, true,           // face front LEDs x3
00057     true,                       // retractable head light x1
00058     true, true,                 // tail red/blue from 210
00059     // for binary joints
00060     false, false
00061   }; //!< true for joints which can be updated every 32 ms (all but the ears on a 210)
00062 
00063   //! we need this so you can tell programmatically which joints are "real" and which are "fake" in compatability mode
00064   const bool IsRealERS210[NumOutputs] = {
00065     // for PID joints
00066     true, true, true, //legs
00067     true, true, true,
00068     true, true, true,
00069     true, true, true,
00070     true, true, true, //head
00071     true, true,       //tail
00072     true,             //mouth
00073     // for LEDs
00074     true, true, true,           // face left side LEDs x3
00075     true, true, true,           // face right side LEDs x3
00076     true,                       // head mode LED x1
00077     false, false, false,        // back left multi LEDs x3
00078     false, false, false,        // back right multi LEDs x3
00079     false, false, false,        // tail LEDs x3
00080     false, false, false,        // face front LEDs x3
00081     false,                      // retractable head light x1
00082     true, true,                 // tail red/blue from 210
00083     // for binary joints
00084     true, true
00085   }; //!< true for joints which can be updated every 32 ms (all but the ears on a 210)
00086 
00087   //! we need this so you can tell programmatically which joints are "real" and which are "fake" in compatability mode
00088   const bool IsRealERS220[NumOutputs] = {
00089     // for PID joints
00090     true, true, true, //legs
00091     true, true, true,
00092     true, true, true,
00093     true, true, true,
00094     true, true, true, //head
00095     false, false,     //tail
00096     false,            //mouth
00097     // for LEDs
00098     true, true, true,           // face left side LEDs x3
00099     true, true, true,           // face right side LEDs x3
00100     true,                       // head mode LED x1
00101     true, true, true,           // back left multi LEDs x3
00102     true, true, true,           // back right multi LEDs x3
00103     true, true, true,           // tail LEDs x3
00104     true, true, true,           // face front LEDs x3
00105     true,                       // retractable head light x1
00106     false, false,               // tail red/blue from 210
00107     // for binary joints
00108     false, false
00109   }; //!< true for joints which can be updated every 32 ms (all but the ears on a 210)
00110 
00111   const unsigned JointsPerLeg   =  3; //!< The number of joints per leg
00112   const unsigned NumLegs        =  4; //!< The number of legs
00113   const unsigned NumLegJoints   =  JointsPerLeg*NumLegs; //!< the TOTAL number of joints on ALL legs
00114   const unsigned NumHeadJoints  =  3; //!< The number of joints in the neck
00115   const unsigned NumTailJoints  =  2; //!< The number of joints assigned to the tail
00116   const unsigned NumMouthJoints =  1; //!< the number of joints that control the mouth
00117   const unsigned NumEarJoints   =  2; //!< The number of joints which control the ears (NOT per ear, is total)
00118   const unsigned NumButtons     =  11; //!< the number of buttons that are available, see ButtonOffset_t
00119   const unsigned NumSensors     =  1+3+1+5;  //!< 1 dist, 3 accel, 1 thermo, 5 from power, see SensorOffset_t
00120   
00121 
00122   // *******************************
00123   //         OUTPUT OFFSETS
00124   // *******************************
00125 
00126 
00127   //!Corresponds to entries in PrimitiveName, defined at the end of this file
00128   //!@name Output Offsets
00129   const unsigned PIDJointOffset = 0; //!< The beginning of the PID Joints
00130   const unsigned LegOffset   = PIDJointOffset;           //!< the offset of the beginning of the leg joints
00131   const unsigned HeadOffset  = LegOffset+NumLegJoints;   //!< the offset of the beginning of the head joints
00132   const unsigned TailOffset  = HeadOffset+NumHeadJoints; //!< the offset of the beginning of the tail joints
00133   const unsigned MouthOffset = TailOffset+NumTailJoints; //!< the offset of the beginning of the mouth joint
00134 
00135   const unsigned LEDOffset   = PIDJointOffset + NumPIDJoints; //!< the offset of LEDs in WorldState::outputs and MotionCommand functions
00136 
00137   const unsigned BinJointOffset = LEDOffset+NumLEDs; //!< The beginning of the binary joints
00138   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
00139   //@}
00140   
00141   //! the ordering of legs
00142   enum LegOrder_t {
00143     LFrLegOrder = 0, //!< left front leg
00144     RFrLegOrder,     //!< right front leg
00145     LBkLegOrder,     //!< left back leg
00146     RBkLegOrder      //!< right back leg
00147   };
00148   
00149   //! The offsets of the individual legs
00150   enum LegOffset_t {
00151     LFrLegOffset = LegOffset+LFrLegOrder*JointsPerLeg, //!< beginning of left front leg
00152     RFrLegOffset = LegOffset+RFrLegOrder*JointsPerLeg, //!< beginning of right front leg
00153     LBkLegOffset = LegOffset+LBkLegOrder*JointsPerLeg, //!< beginning of left back leg
00154     RBkLegOffset = LegOffset+RBkLegOrder*JointsPerLeg  //!< beginning of right back leg
00155   };
00156   
00157   //! 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)
00158   enum REKOffset_t {
00159     RotatorOffset=0, //!< moves leg forward or backward along body
00160     ElevatorOffset,  //!< moves leg toward or away from body
00161     KneeOffset       //!< moves knee
00162   };
00163   
00164   //! The offsets of appendages with tilt (elevation), pan (heading), and roll 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)
00165   enum TPROffset_t {
00166     TiltOffset = 0, //!< tilt/elevation (vertical)
00167     PanOffset,      //!< pan/heading (horizontal)
00168     RollOffset      //!< roll (rotational)
00169   };
00170   
00171   //! The offsets of the individual LEDs on the head and tail.  Note that L/R are robot's POV.  See also LEDBitMask_t
00172   enum LEDOffset_t {
00173     FaceFrontLeftLEDOffset = LEDOffset, //!< head face side light (front left - blue) (ERS-220)
00174     FaceFrontRightLEDOffset,    //!< head face side light (front right - blue) (ERS-220)
00175     FaceCenterLeftLEDOffset,    //!< head face side light (center left - blue) (ERS-220)
00176     FaceCenterRightLEDOffset,   //!< head face side light (center right - blue) (ERS-220)
00177     FaceBackLeftLEDOffset,      //!< head face side light (back left - red) (ERS-220)
00178     FaceBackRightLEDOffset,     //!< head face side light (back right - red) (ERS-220)
00179     ModeLEDOffset,              //!< mode indicator (back of the head - orange) (ERS-220)
00180     BackLeft1LEDOffset,         //!< back multi-indicator (left #1 - blue) (ERS-220)
00181     BackLeft2LEDOffset,         //!< back multi-indicator (left #2 - blue) (ERS-220)
00182     BackLeft3LEDOffset,         //!< back multi-indicator (left #3 - blue) (ERS-220)
00183     BackRight3LEDOffset,        //!< back multi-indicator (right #3 - blue) (ERS-220)
00184     BackRight2LEDOffset,        //!< back multi-indicator (right #2 - blue) (ERS-220)
00185     BackRight1LEDOffset,        //!< back multi-indicator (right #1 - blue) (ERS-220)
00186     TailLeftLEDOffset,          //!< tail light (left - blue) (ERS-220)
00187     TailCenterLEDOffset,        //!< tail light (center - red) (ERS-220)
00188     TailRightLEDOffset,         //!< tail light (right - blue) (ERS-220)
00189     FaceFrontBLEDOffset,        //!< face front light B (blue) (ERS-220)
00190     FaceFrontALEDOffset,        //!< face front light A (blue) (ERS-220)
00191     FaceFrontCLEDOffset,        //!< face front light C (red) (ERS-220)
00192     RetractableHeadLEDOffset,   //!< retractable head light (ERS-220)
00193  
00194     TlBluLEDOffset,             //!< blue tail light (ERS-210)
00195     TlRedLEDOffset,             //!< red tail light (ERS-210)
00196 
00197     // aliases for backward compatibility
00198     BotLLEDOffset = FaceFrontLeftLEDOffset,   //!< bottom left (red - sad) (ERS-210)
00199     BotRLEDOffset = FaceFrontRightLEDOffset,  //!< bottom right (red - sad) (ERS-210)
00200     MidLLEDOffset = FaceCenterLeftLEDOffset,  //!< middle left (green - happy) (ERS-210)
00201     MidRLEDOffset = FaceCenterRightLEDOffset, //!< middle right (green - happy) (ERS-210)
00202     TopLLEDOffset = FaceBackLeftLEDOffset,    //!< top left (red - angry) (ERS-210)
00203     TopRLEDOffset = FaceBackRightLEDOffset,   //!< top right (red - angry) (ERS-210)
00204     TopBrLEDOffset = ModeLEDOffset,           //!< top bar (green) (ERS-210)
00205   };
00206   
00207   //! Bitmasks for use when specifying combinations of LEDs (see LEDEngine ) Note that L/R are robot's POV
00208   //!@name LED Bitmasks
00209   typedef unsigned int LEDBitMask_t; //!< So you can be clear when you're refering to a LED bitmask
00210   const LEDBitMask_t FaceFrontLeftLEDMask   = 1<<(FaceFrontLeftLEDOffset-LEDOffset);
00211   const LEDBitMask_t FaceFrontRightLEDMask  = 1<<(FaceFrontRightLEDOffset-LEDOffset);
00212   const LEDBitMask_t FaceCenterLeftLEDMask  = 1<<(FaceCenterLeftLEDOffset-LEDOffset);
00213   const LEDBitMask_t FaceCenterRightLEDMask = 1<<(FaceCenterRightLEDOffset-LEDOffset);
00214   const LEDBitMask_t FaceBackLeftLEDMask    = 1<<(FaceBackLeftLEDOffset-LEDOffset);
00215   const LEDBitMask_t FaceBackRightLEDMask   = 1<<(FaceBackRightLEDOffset-LEDOffset);
00216   const LEDBitMask_t ModeLEDMask            = 1<<(ModeLEDOffset-LEDOffset);
00217   const LEDBitMask_t BackLeft1LEDMask       = 1<<(BackLeft1LEDOffset-LEDOffset);
00218   const LEDBitMask_t BackLeft2LEDMask       = 1<<(BackLeft2LEDOffset-LEDOffset);
00219   const LEDBitMask_t BackLeft3LEDMask       = 1<<(BackLeft3LEDOffset-LEDOffset);
00220   const LEDBitMask_t BackRight3LEDMask      = 1<<(BackRight3LEDOffset-LEDOffset);
00221   const LEDBitMask_t BackRight2LEDMask      = 1<<(BackRight2LEDOffset-LEDOffset);
00222   const LEDBitMask_t BackRight1LEDMask      = 1<<(BackRight1LEDOffset-LEDOffset);
00223   const LEDBitMask_t TailLeftLEDMask        = 1<<(TailLeftLEDOffset-LEDOffset);
00224   const LEDBitMask_t TailCenterLEDMask      = 1<<(TailCenterLEDOffset-LEDOffset);
00225   const LEDBitMask_t TailRightLEDMask       = 1<<(TailRightLEDOffset-LEDOffset);
00226   const LEDBitMask_t FaceFrontBLEDMask      = 1<<(FaceFrontBLEDOffset-LEDOffset);
00227   const LEDBitMask_t FaceFrontALEDMask      = 1<<(FaceFrontALEDOffset-LEDOffset);
00228   const LEDBitMask_t FaceFrontCLEDMask      = 1<<(FaceFrontCLEDOffset-LEDOffset);
00229   const LEDBitMask_t RetractableHeadLEDMask = 1<<(RetractableHeadLEDOffset-LEDOffset);
00230   
00231   const LEDBitMask_t TlRedLEDMask= 1<<(TlRedLEDOffset-LEDOffset); //!< red tail light
00232   const LEDBitMask_t TlBluLEDMask= 1<<(TlBluLEDOffset-LEDOffset); //!< blue tail light
00233 
00234   // aliases for backward compatibility
00235   const LEDBitMask_t BotLLEDMask = 1<<(BotLLEDOffset-LEDOffset); //!< bottom left (red - sad)
00236   const LEDBitMask_t BotRLEDMask = 1<<(BotRLEDOffset-LEDOffset); //!< bottom right (red - sad)
00237   const LEDBitMask_t MidLLEDMask = 1<<(MidLLEDOffset-LEDOffset); //!< middle left (green - happy)
00238   const LEDBitMask_t MidRLEDMask = 1<<(MidRLEDOffset-LEDOffset); //!< middle right (green - happy)
00239   const LEDBitMask_t TopLLEDMask = 1<<(TopLLEDOffset-LEDOffset); //!< top left (red - angry)
00240   const LEDBitMask_t TopRLEDMask = 1<<(TopRLEDOffset-LEDOffset); //!< top right (red - angry)
00241   const LEDBitMask_t TopBrLEDMask= 1<<(TopBrLEDOffset-LEDOffset); //!< top bar (green)
00242 
00243   const LEDBitMask_t FaceLEDMask
00244   = FaceFrontLeftLEDMask
00245   | FaceFrontRightLEDMask
00246   | FaceCenterLeftLEDMask
00247   | FaceCenterRightLEDMask
00248   | FaceBackLeftLEDMask
00249   | FaceBackRightLEDMask
00250   | FaceFrontALEDMask
00251   | FaceFrontBLEDMask
00252   | FaceFrontCLEDMask
00253   | ModeLEDMask;              //!< LEDs for face
00254  
00255   const LEDBitMask_t HeadLEDMask
00256   = FaceLEDMask
00257   | RetractableHeadLEDMask;   //!< LEDs on head (face plus retractable light)
00258  
00259   const LEDBitMask_t BackLEDMask
00260   = BackLeft1LEDMask
00261   | BackLeft2LEDMask
00262   | BackLeft3LEDMask
00263   | BackRight1LEDMask
00264   | BackRight2LEDMask
00265   | BackRight3LEDMask; //!< LEDs on back
00266  
00267   const LEDBitMask_t TailLEDMask
00268   = TailLeftLEDMask
00269   | TailCenterLEDMask
00270   | TailRightLEDMask
00271   | TlRedLEDMask
00272   | TlBluLEDMask;  //!< LEDs for tail
00273  
00274   const LEDBitMask_t AllLEDMask  = ~0; //!< selects all of the leds
00275   //@}
00276 
00277 
00278   // *******************************
00279   //          INPUT OFFSETS
00280   // *******************************
00281 
00282 
00283   //! The order in which inputs should be stored
00284   //!@name Input Offsets
00285 
00286   //! holds offsets to different buttons in WorldState::buttons[]
00287   /*! Should be a straight mapping to the ButtonSourceIDs
00288    *
00289    *  Note that the chest (power) button is not a normal button.  It kills
00290    *  power to the motors at a hardware level, and isn't sensed in the
00291    *  normal way.  If you want to know when it is pressed (and you are
00292    *  about to shut down) see PowerSourceID::PauseSID.
00293    *
00294    *  @see WorldState::buttons @see ButtonSourceID_t */
00295   enum ButtonOffset_t {
00296     LFrPawOffset = LFrLegOrder,
00297     RFrPawOffset = RFrLegOrder,
00298     LBkPawOffset = LBkLegOrder,
00299     RBkPawOffset = RBkLegOrder,
00300     ChinButOffset= 4,
00301     BackButOffset,
00302     HeadFrButOffset, //!< @see ERS210Info::HeadFrButOffset, ERS220Info::HeadFrButOffset
00303     HeadBkButOffset, //!< @see ERS210Info::HeadBkButOffset, ERS220Info::HeadBkButOffset
00304     TailLeftButOffset,
00305     TailCenterButOffset,
00306     TailRightButOffset,
00307   };
00308 
00309   //! holds offset to different sensor values in WorldState::sensors[]
00310   /*! @see WorldState::sensors[] */
00311   enum SensorOffset_t {
00312     IRDistOffset = 0,  //!< in millimeters
00313     BAccelOffset, //!< backward acceleration, in @f$m/s^2@f$, negative if sitting on butt (positive for faceplant)
00314     LAccelOffset, //!< acceleration to the robot's left, in @f$m/s^2@f$, negative if lying on robot's left side
00315     DAccelOffset, //!< downward acceleration, in @f$m/s^2@f$, negative if standing up... be careful about the signs on all of these...
00316     ThermoOffset, //!< in degrees Celcius
00317     PowerRemainOffset, //!< percentage, 0-1
00318     PowerThermoOffset, //!<  degrees Celcius
00319     PowerCapacityOffset, //!< milli-amp hours
00320     PowerVoltageOffset, //!< volts
00321     PowerCurrentOffset //!< milli-amp negative values (maybe positive while charging?)
00322   };
00323 
00324   //@}
00325 
00326 
00327   //! The length of the strings used for each of the outputs in outputNames (doesn't include null term)
00328   const unsigned outputNameLen = 9;
00329   //! A name of uniform length for referring to joints - handy for posture files, etc.
00330   const char* const outputNames[NumOutputs] = {
00331     "LFr:rotor",
00332     "LFr:elvtr",
00333     "LFr:knee~",
00334     "RFr:rotor",
00335     "RFr:elvtr",
00336     "RFr:knee~",
00337     "LBk:rotor",
00338     "LBk:elvtr",
00339     "LBk:knee~",
00340     "RBk:rotor",
00341     "RBk:elvtr",
00342     "RBk:knee~",
00343     
00344     "NECK:tilt",
00345     "NECK:pan~",
00346     "NECK:roll",
00347     
00348     "TAIL:tilt",
00349     "TAIL:pan~",
00350     
00351     "MOUTH~~~~",
00352     
00353     "LED:botL~",
00354     "LED:botR~",
00355     "LED:midL~",
00356     "LED:midR~",
00357     "LED:topL~",
00358     "LED:topR~",
00359     "LED:topBr",
00360     
00361     "LED:bkL1~",                // "LED:tlBlu" of ERS-210
00362     "LED:bkL2~",                // "LED:tlRed" of ERS-210
00363     "LED:bkL3~",
00364     "LED:bkR3~",
00365     "LED:bkR2~",
00366     "LED:bkR1~",
00367     "LED:tailL",
00368     "LED:tailC",
00369     "LED:tailR",
00370     "LED:faceB",
00371     "LED:faceA",
00372     "LED:faceC",
00373     "LED:light",                 // retractable head light
00374     
00375     "LED:tlRed",
00376     "LED:tlBlu",
00377     
00378     "EAR:left~",
00379     "EAR:right"
00380   };
00381   
00382 
00383   //! the joint identifier strings used to refer to specific joints in OPEN-R (but not needed for others)
00384   /*!@showinitializer 
00385    * @warning IMPORTANT!!!!  DO NOT CHANGE THE ORDER OF ITEMS IN THIS TABLE!!!\n
00386    *
00387    * The offset consts defined in this file correspond to this table and will make life easier
00388    * if you feel the need to reorder things, but they aren't used perfect @e everywhere \n
00389    * In particular, assumptions are made that the pid joints will be in slots 0-numPIDJoints
00390    * and that the fast outputs (ie NOT ears) will be in slots 0-NumFastOutputs\n
00391    * There may be other assumptions not noted here!!!
00392    * @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*/
00393   const char* const PrimitiveName [NumOutputs] = {
00394     "PRM:/r2/c1-Joint2:j1",       //!< the left front leg   the rotator
00395     "PRM:/r2/c1/c2-Joint2:j2",    //!< the left front leg   the elevator 
00396     "PRM:/r2/c1/c2/c3-Joint2:j3", //!< the left front leg   the knee 
00397     "PRM:/r4/c1-Joint2:j1",       //!< the right front leg   the rotator
00398     "PRM:/r4/c1/c2-Joint2:j2",    //!< the right front leg    the elevator 
00399     "PRM:/r4/c1/c2/c3-Joint2:j3", //!< the right front leg   the knee 
00400     
00401     "PRM:/r3/c1-Joint2:j1",       //!< the left hind leg   the rotator
00402     "PRM:/r3/c1/c2-Joint2:j2",    //!< the left hind leg   the elevator 
00403     "PRM:/r3/c1/c2/c3-Joint2:j3", //!< the left hind leg   the knee
00404     "PRM:/r5/c1-Joint2:j1",       //!< the right hind leg   the rotator
00405     "PRM:/r5/c1/c2-Joint2:j2",    //!< the right hind leg   the elevator 
00406     "PRM:/r5/c1/c2/c3-Joint2:j3", //!< the right hind leg   the knee 
00407 
00408     "PRM:/r1/c1-Joint2:j1",       //!< the neck  tilt (12)
00409     "PRM:/r1/c1/c2-Joint2:j2",    //!< the neck   pan 
00410     "PRM:/r1/c1/c2/c3-Joint2:j3", //!< the neck   roll 
00411         
00412     "PRM:/r6/c2-Joint2:j2",       //!< the tail tilt (15)       // *** NOTE ***
00413     "PRM:/r6/c1-Joint2:j1",       //!< the tail pan             // CHANGE_ET 12/16/01 matches neck order
00414     
00415     "PRM:/r1/c1/c2/c3/c4-Joint2:j4", //!< the mouth (17)
00416     
00417     "PRM:/r1/c1/c2/c3/l1-LED2:l1", //!< lower  left  LED (18)
00418     "PRM:/r1/c1/c2/c3/l4-LED2:l4", //!< lower  right LED
00419     "PRM:/r1/c1/c2/c3/l2-LED2:l2", //!< middle left  LED
00420     "PRM:/r1/c1/c2/c3/l5-LED2:l5", //!< middle right LED
00421     "PRM:/r1/c1/c2/c3/l3-LED2:l3", //!< upper  left  LED
00422     "PRM:/r1/c1/c2/c3/l6-LED2:l6", //!< upper  right LED
00423     "PRM:/r1/c1/c2/c3/l7-LED2:l7", //!< top          LED
00424     
00425     "PRM:/r6/l1-LED2:l1", //!< back 1st left LED (corresponds to tail blue LED of ERS-210) (25)
00426     "PRM:/r6/l2-LED2:l2", //!< back 2nd left LED (corresponds to tail red  LED of ERS-210)
00427     "PRM:/r6/l3-LED2:l3", //!< back 3rd left LED
00428     "PRM:/r6/l4-LED2:l4", //!< back 3rd right LED
00429     "PRM:/r6/l5-LED2:l5", //!< back 2nd right LED
00430     "PRM:/r6/l6-LED2:l6", //!< back 1st right LED
00431  
00432     "PRM:/r6/l9-LED2:l9", //!< tail left LED   (31)
00433     "PRM:/r6/l7-LED2:l7", //!< tail center LED
00434     "PRM:/r6/l8-LED2:l8", //!< tail right LED
00435  
00436     "PRM:/r1/c1/c2/c3/l8-LED2:l8", //!< face front LED B
00437     "PRM:/r1/c1/c2/c3/l9-LED2:l9", //!< face front LED A
00438     "PRM:/r1/c1/c2/c3/la-LED2:la", //!< face front LED C
00439     "PRM:/r1/c1/c2/c3/lb-LED2:lb", //!< retractable head light
00440 
00441     "PRM:/r6/l2-LED2:l2", //!< tail red LED (corresponds to back 2nd left LED of ERS-220)  (38)
00442     "PRM:/r6/l1-LED2:l1", //!< tail blue LED  (corresponds to back 1st left LED of ERS-220)
00443 
00444     "PRM:/r1/c1/c2/c3/e1-Joint3:j5", //!< left ear (40)
00445     "PRM:/r1/c1/c2/c3/e2-Joint3:j6" //!< right ear
00446   };
00447 
00448   //Old PID table:
00449   /*const word Pid[NumPIDJoints][6] = {
00450     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00451     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00452     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00453     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00454     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00455     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00456     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00457     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00458     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00459     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00460     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00461     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00462     
00463     { 0x0A, 0x08, 0x0C, 0x0E, 0x02, 0x0F },
00464     { 0x0D, 0x08, 0x0B, 0x0E, 0x02, 0x0F },
00465     { 0x10, 0x08, 0x0C, 0x0E, 0x02, 0x0F }, // P was 0x0C, updated as seen on https://www.openr.org/page1_2001/gain.html 8/13/2002
00466     
00467     { 0x0A, 0x00, 0x18, 0x0E, 0x02, 0x0F },
00468     { 0x07, 0x00, 0x11, 0x0E, 0x02, 0x0F },
00469     
00470     { 0x0E, 0x08, 0x10, 0x0E, 0x02, 0x0F }, //  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
00471   };*/
00472       
00473   //! This table holds the default PID values for each joint.  @see PIDMC
00474   const float DefaultPIDs[NumPIDJoints][3] =
00475     {
00476       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00477       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00478       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00479       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00480       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00481       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00482       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00483       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00484       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00485       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00486       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00487       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00488 
00489       { 0x0A/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0C/(double)(1<<(16-0xF)) },
00490       { 0x0D/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0B/(double)(1<<(16-0xF)) },
00491       { 0x0A/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0C/(double)(1<<(16-0xF)) },
00492 
00493       { 0x0A/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x18/(double)(1<<(16-0xF)) },
00494       { 0x07/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x11/(double)(1<<(16-0xF)) },
00495 
00496       { 0x0E/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x10/(double)(1<<(16-0xF)) }
00497     };
00498   
00499   //!These values are Sony's recommended maximum joint velocities, in rad/ms
00500   /*! a value <= 0 means infinite speed (e.g. LEDs) */
00501   const float MaxOutputSpeed[NumOutputs] = {
00502     2.8143434e-03,     //Legs LR,FB,REK
00503     2.4980025e-03,
00504     2.8361600e-03,
00505     2.8143434e-03,
00506     2.4980025e-03,
00507     2.8361600e-03,
00508     2.8143434e-03,
00509     2.4980025e-03,
00510     2.8361600e-03,
00511     2.8143434e-03,
00512     2.4980025e-03,
00513     2.8361600e-03,
00514   
00515     2.1053034e-03,     //Head TPR
00516     3.0106930e-03,
00517     3.0106930e-03,
00518   
00519     4.4724062e-03,     //Tail
00520     4.4724062e-03,
00521   
00522     4.3742314e-03,     //Mouth
00523     
00524     0,0,0,//LEDs
00525     0,0,0,
00526     0,
00527     0,0,0, 
00528     0,0,0, 
00529     0,0,0, 
00530     0,0,0, 
00531     0,
00532     0,0,
00533 
00534     0,0                //Ears
00535   };
00536 
00537 #ifndef RAD
00538   //!Just a little macro for converting degrees to radians
00539 #define RAD(deg) (((deg) * M_PI ) / 180.0)
00540   //!a flag so we undef these after we're done - do you have a cleaner solution?
00541 #define __RI_RAD_FLAG
00542 #endif
00543 
00544   //! Defines the min and max index of entries in #outputRanges and #mechanicalLimits
00545   enum MinMaxRange_t { MinRange,MaxRange };
00546 
00547   //! This table holds the software limits of each of the outputs
00548   const double outputRanges[NumOutputs][2] =
00549     {
00550       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left front REK
00551       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right front REK
00552       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left back REK
00553       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right back REK
00554 
00555       { RAD(-82),RAD(43) },{ RAD(-89.6),RAD(89.6) },{ RAD(-29),RAD(29) }, //neck TPR
00556         
00557       { RAD(-22),RAD(22) },{ RAD(-22),RAD(22) }, // tail tp
00558 
00559       { RAD(-47),RAD(-3) }, //mouth
00560 
00561       {0,1},{0,1},{0,1},        // face left side LEDs x3
00562       {0,1},{0,1},{0,1},        // face right side LEDs x3
00563       {0,1},                    // head mode LED x1
00564       {0,1},{0,1},{0,1},        // back left multi LEDs x3
00565       {0,1},{0,1},{0,1},        // back right multi LEDs x3
00566       {0,1},{0,1},{0,1},        // tail LEDs x3
00567       {0,1},{0,1},{0,1},        // face front LEDs x3
00568       {0,1},                    // retractable head light x1
00569       {0,1},{0,1},              // 210 red/blue tail light
00570 
00571       {0,1},{0,1} //ears
00572     };
00573 
00574   //! This table holds the mechanical limits of each of the outputs
00575   const double mechanicalLimits[NumOutputs][2] =
00576     {
00577       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left front jsk
00578       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right front jsk
00579       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left back jsk
00580       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right back jsk
00581 
00582       { RAD(-85),RAD(46) },{ RAD(-92.6),RAD(92.6) },{ RAD(-32),RAD(32) }, //neck tpr
00583         
00584       { RAD(-25),RAD(25) },{ RAD(-25),RAD(25) }, // tail tp
00585 
00586       { RAD(-50),RAD(0) }, //mouth
00587         
00588       {0,1},{0,1},{0,1},        // face left side LEDs x3
00589       {0,1},{0,1},{0,1},        // face right side LEDs x3
00590       {0,1},                    // head mode LED x1
00591       {0,1},{0,1},{0,1},        // back left multi LEDs x3
00592       {0,1},{0,1},{0,1},        // back right multi LEDs x3
00593       {0,1},{0,1},{0,1},        // tail LEDs x3
00594       {0,1},{0,1},{0,1},        // face front LEDs x3
00595       {0,1},                     // retractable head light x1
00596       {0,1},{0,1},              // 210 red/blue tail light
00597 
00598       {0,1},{0,1} //ears
00599     };
00600 
00601 #ifdef __RI_RAD_FLAG
00602 #undef RAD
00603 #undef __RI_RAD_FLAG
00604 #endif
00605 
00606 }
00607 
00608 /*! @file
00609  * @brief Defines RobotInfo namespace for ERS-2xx series of robots, such as joint counts, offsets, names and PID values
00610  * @author Daishi MORI (Creator)
00611  *
00612  * $Author: ejt $
00613  * $Name: tekkotsu-1_4_1 $
00614  * $Revision: 1.2 $
00615  * $State: Exp $
00616  * $Date: 2003/06/12 23:41:40 $
00617  */
00618 
00619 #endif

Tekkotsu v1.4
Generated Sat Jul 19 00:06:30 2003 by Doxygen 1.3.2