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

Tekkotsu v3.0
Generated Wed Oct 4 00:03:43 2006 by Doxygen 1.4.7