Homepage Demos Overview Downloads Tutorials Reference
Credits

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

Tekkotsu v2.1
Generated Tue Mar 16 23:19:13 2004 by Doxygen 1.3.5