Homepage Demos Overview Downloads Tutorials Reference
Credits

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

Tekkotsu v2.0
Generated Wed Jan 21 03:20:28 2004 by Doxygen 1.3.4