Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ERS210Info.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ERS210Info_h
00003 #define INCLUDED_ERS210Info_h
00004 
00005 #include <math.h>
00006 #ifndef PLATFORM_APERIOS
00007 typedef unsigned short word; //!< otherwise defined in Types.h
00008 #else
00009 #include <Types.h>
00010 #endif
00011 
00012 #include "CommonInfo.h"
00013 using namespace RobotInfo;
00014 
00015 #if TGT_ERS2xx
00016 #include "ERS2xxInfo.h"
00017 #endif
00018 
00019 //! Contains information about the ERS-210 Robot, such as number of joints, PID defaults, timing information, etc.
00020 namespace ERS210Info {
00021 
00022 #if TGT_ERS2xx
00023   using namespace ERS2xxInfo;
00024 #else
00025   // *******************************
00026   //       ROBOT CONFIGURATION
00027   // *******************************
00028 
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 ERS210Info::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     =  8; //!< the number of buttons that are available, see ERS210Info::ButtonOffset_t
00047   const unsigned NumSensors     =  1+3+1+5;  //!< 1 dist, 3 accel, 1 thermo, 5 from power, see ERS210Info::SensorOffset_t
00048   const unsigned NumLEDs        =  9; //!< 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 
00061   const bool IsFastOutput[NumOutputs] = { true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,false,false }; //!< true for joints which can be updated every 32 ms (all but the ears)
00062   //! we need this so you can tell programmatically which joints are "real" and which are "fake" in ERS-2xx target mode
00063   const bool IsRealERS210[NumOutputs] = { true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true };
00064   //@}
00065 
00066 
00067   // *******************************
00068   //         OUTPUT OFFSETS
00069   // *******************************
00070 
00071 
00072   //!Corresponds to entries in ERS210Info::PrimitiveName, defined at the end of this file
00073   //!@name Output Offsets
00074 
00075   const unsigned PIDJointOffset = 0; //!< The beginning of the PID Joints
00076   const unsigned LegOffset   = PIDJointOffset;           //!< the offset of the beginning of the leg joints
00077   const unsigned HeadOffset  = LegOffset+NumLegJoints;   //!< the offset of the beginning of the head joints
00078   const unsigned TailOffset  = HeadOffset+NumHeadJoints; //!< the offset of the beginning of the tail joints
00079   const unsigned MouthOffset = TailOffset+NumTailJoints; //!< the offset of the beginning of the mouth joint
00080 
00081   const unsigned LEDOffset   = PIDJointOffset + NumPIDJoints; //!< the offset of LEDs in WorldState::outputs and MotionCommand functions
00082 
00083   const unsigned BinJointOffset = LEDOffset + NumLEDs; //!< The beginning of the binary joints
00084   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
00085 
00086   const unsigned BaseFrameOffset   = NumOutputs; //!< Use with kinematics to refer to base reference frame
00087   const unsigned PawFrameOffset    = BaseFrameOffset+1; //!< Use with kinematics to refer to paw reference frames (add appropriate LegOrder_t to specify which paw)
00088   const unsigned CameraFrameOffset = PawFrameOffset+NumLegs; //!< Use with kinematics to refer to camera reference frame
00089   const unsigned IRFrameOffset = CameraFrameOffset+1; //!< Use with kinematics to refer to infrared (distance) sensor reference frame
00090   
00091   //! The offsets of the individual legs
00092   enum LegOffset_t {
00093     LFrLegOffset = LegOffset+LFrLegOrder*JointsPerLeg, //!< beginning of left front leg
00094     RFrLegOffset = LegOffset+RFrLegOrder*JointsPerLeg, //!< beginning of right front leg
00095     LBkLegOffset = LegOffset+LBkLegOrder*JointsPerLeg, //!< beginning of left back leg
00096     RBkLegOffset = LegOffset+RBkLegOrder*JointsPerLeg  //!< beginning of right back leg
00097   };
00098   
00099   //@}
00100   
00101   //! 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
00102   enum LEDOffset_t {
00103     BotLLEDOffset = LEDOffset,//!< bottom left (red - sad)
00104     BotRLEDOffset, //!< bottom right (red - sad)
00105     MidLLEDOffset, //!< middle left (green - happy)
00106     MidRLEDOffset, //!< middle right (green - happy)
00107     TopLLEDOffset, //!< top left (red - angry)
00108     TopRLEDOffset, //!< top right (red - angry)
00109     TopBrLEDOffset,//!< top bar (green)
00110     TlRedLEDOffset,//!< red tail light
00111     TlBluLEDOffset, //!< blue tail light
00112  
00113     // alias for 220 cross-compatibility
00114     FaceFrontLeftLEDOffset = BotLLEDOffset,   //!< alias for 220 cross-compatibility
00115     FaceFrontRightLEDOffset = BotRLEDOffset,  //!< alias for 220 cross-compatibility
00116     FaceCenterLeftLEDOffset = MidLLEDOffset,  //!< alias for 220 cross-compatibility
00117     FaceCenterRightLEDOffset = MidRLEDOffset, //!< alias for 220 cross-compatibility
00118     FaceBackLeftLEDOffset = TopLLEDOffset,    //!< alias for 220 cross-compatibility
00119     FaceBackRightLEDOffset = TopRLEDOffset,   //!< alias for 220 cross-compatibility
00120     ModeLEDOffset = TopBrLEDOffset,           //!< alias for 220 cross-compatibility
00121     TailRightLEDOffset = TlRedLEDOffset,      //!< alias for 220 cross-compatibility
00122     TailLeftLEDOffset = TlBluLEDOffset        //!< alias for 220 cross-compatibility
00123   };
00124   
00125   //! Bitmasks for use when specifying combinations of LEDs (see LedEngine ) Note that left/right are robot's point of view
00126   //!@name LED Bitmasks
00127   typedef unsigned int LEDBitMask_t; //!< So you can be clear when you're refering to a LED bitmask
00128   const LEDBitMask_t BotLLEDMask = 1<<(BotLLEDOffset-LEDOffset); //!< bottom left (red - sad)
00129   const LEDBitMask_t BotRLEDMask = 1<<(BotRLEDOffset-LEDOffset); //!< bottom right (red - sad)
00130   const LEDBitMask_t MidLLEDMask = 1<<(MidLLEDOffset-LEDOffset); //!< middle left (green - happy)
00131   const LEDBitMask_t MidRLEDMask = 1<<(MidRLEDOffset-LEDOffset); //!< middle right (green - happy)
00132   const LEDBitMask_t TopLLEDMask = 1<<(TopLLEDOffset-LEDOffset); //!< top left (red - angry)
00133   const LEDBitMask_t TopRLEDMask = 1<<(TopRLEDOffset-LEDOffset); //!< top right (red - angry)
00134   const LEDBitMask_t TopBrLEDMask= 1<<(TopBrLEDOffset-LEDOffset); //!< top bar (green)
00135   const LEDBitMask_t TlRedLEDMask= 1<<(TlRedLEDOffset-LEDOffset); //!< red tail light
00136   const LEDBitMask_t TlBluLEDMask= 1<<(TlBluLEDOffset-LEDOffset); //!< blue tail light
00137 
00138   const LEDBitMask_t FaceLEDMask = BotLLEDMask|BotRLEDMask|MidLLEDMask|MidRLEDMask|TopLLEDMask|TopRLEDMask|TopBrLEDMask; //!< LEDs for face (all but tail)
00139   const LEDBitMask_t HeadLEDMask = BotLLEDMask|BotRLEDMask|MidLLEDMask|MidRLEDMask|TopLLEDMask|TopRLEDMask|TopBrLEDMask; //!< LEDs for face (all but tail)
00140   const LEDBitMask_t BackLEDMask = 0; //!< 210 has no back LEDs
00141   const LEDBitMask_t TailLEDMask = TlRedLEDMask|TlBluLEDMask; //!< LEDs on tail
00142   const LEDBitMask_t AllLEDMask  = (LEDBitMask_t)~0; //!< selects all of the leds
00143   //@}
00144 
00145 
00146   // *******************************
00147   //          INPUT OFFSETS
00148   // *******************************
00149 
00150 
00151   //! The order in which inputs should be stored
00152   //!@name Input Offsets
00153 
00154   //! holds offsets to different buttons in WorldState::buttons[]
00155   /*! Should be a straight mapping to the ButtonSourceIDs
00156    *
00157    *  Note that the chest (power) button is not a normal button.  It kills
00158    *  power to the motors at a hardware level, and isn't sensed in the
00159    *  normal way.  If you want to know when it is pressed (and you are
00160    *  about to shut down) see PowerSourceID::PauseSID.
00161    *
00162    *  @see WorldState::buttons @see ButtonSourceID_t */
00163   enum ButtonOffset_t {
00164     LFrPawOffset = LFrLegOrder,
00165     RFrPawOffset = RFrLegOrder,
00166     LBkPawOffset = LBkLegOrder,
00167     RBkPawOffset = RBkLegOrder,
00168     ChinButOffset= 4,
00169     BackButOffset,
00170     HeadFrButOffset, //!< not in reliable pressure units, but 1.0 is fairly stiff pressure, 0 is none
00171     HeadBkButOffset //!< not in reliable pressure units, but 1.0 is fairly stiff pressure, 0 is none
00172   };
00173   
00174   //! Provides a string name for each button
00175   const char* const buttonNames[NumButtons] = {
00176     "LFrPaw","RFrPaw","LBkPaw","RBkPaw",
00177     "ChinBut","BackBut",
00178     "HeadFrBut","HeadBkBut"
00179   };
00180 
00181   //! holds offset to different sensor values in WorldState::sensors[]
00182   /*! @see WorldState::sensors[] */
00183   enum SensorOffset_t {
00184     IRDistOffset = 0,  //!< in millimeters
00185     BAccelOffset, //!< backward acceleration, in @f$m/s^2@f$, negative if sitting on butt (positive for faceplant)
00186     LAccelOffset, //!< acceleration to the robot's left, in @f$m/s^2@f$, negative if lying on robot's left side
00187     DAccelOffset, //!< downward acceleration, in @f$m/s^2@f$, negative if standing up... be careful about the signs on all of these...
00188     ThermoOffset, //!< in degrees Celcius
00189     PowerRemainOffset, //!< percentage, 0-1
00190     PowerThermoOffset, //!<  degrees Celcius
00191     PowerCapacityOffset, //!< milli-amp hours
00192     PowerVoltageOffset, //!< volts
00193     PowerCurrentOffset //!< milli-amp negative values (maybe positive while charging?)
00194   };
00195 
00196   //! Provides a string name for each sensor
00197   const char* const sensorNames[NumSensors] = {
00198     "IRDist",
00199     "BAccel","LAccel","DAccel",
00200     "Thermo",
00201     "PowerRemain","PowerThermo","PowerCapacity","PowerVoltage","PowerCurrent"
00202   };
00203 
00204   //@}
00205 
00206 
00207   //! The length of the strings used for each of the outputs in outputNames (doesn't include null term)
00208   const unsigned outputNameLen = 9;
00209   //! A name of uniform length for referring to joints - handy for posture files, etc.
00210   const char* const outputNames[NumOutputs] = {
00211     "LFr:rotor",
00212     "LFr:elvtr",
00213     "LFr:knee~",
00214     "RFr:rotor",
00215     "RFr:elvtr",
00216     "RFr:knee~",
00217     "LBk:rotor",
00218     "LBk:elvtr",
00219     "LBk:knee~",
00220     "RBk:rotor",
00221     "RBk:elvtr",
00222     "RBk:knee~",
00223     
00224     "NECK:tilt",
00225     "NECK:pan~",
00226     "NECK:roll",
00227     
00228     "TAIL:tilt",
00229     "TAIL:pan~",
00230     
00231     "MOUTH~~~~",
00232     
00233     "LED:botL~",
00234     "LED:botR~",
00235     "LED:midL~",
00236     "LED:midR~",
00237     "LED:topL~",
00238     "LED:topR~",
00239     "LED:topBr",
00240     
00241     "LED:tlRed",
00242     "LED:tlBlu",
00243     
00244     "EAR:left~",
00245     "EAR:right"
00246   };
00247   
00248 
00249   //! the joint identifier strings used to refer to specific joints in OPEN-R (but not needed for others)
00250   /*!@showinitializer 
00251    * @warning IMPORTANT!!!!  DO NOT CHANGE THE ORDER OF ITEMS IN THIS TABLE!!!\n
00252    *
00253    * The offset consts defined in this file correspond to this table and will make life easier
00254    * if you feel the need to reorder things, but they aren't used perfect @e everywhere \n
00255    * In particular, assumptions are made that the pid joints will be in slots 0-numPIDJoints
00256    * and that the fast outputs (ie NOT ears) will be in slots 0-NumFastOutputs\n
00257    * There may be other assumptions not noted here!!!
00258    * @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*/
00259   const char* const PrimitiveName [NumOutputs] = {
00260     "PRM:/r2/c1-Joint2:j1",       //!< the left front leg   the rotator
00261     "PRM:/r2/c1/c2-Joint2:j2",    //!< the left front leg   the elevator 
00262     "PRM:/r2/c1/c2/c3-Joint2:j3", //!< the left front leg   the knee 
00263     "PRM:/r4/c1-Joint2:j1",       //!< the right front leg   the rotator
00264     "PRM:/r4/c1/c2-Joint2:j2",    //!< the right front leg    the elevator 
00265     "PRM:/r4/c1/c2/c3-Joint2:j3", //!< the right front leg   the knee 
00266     
00267     "PRM:/r3/c1-Joint2:j1",       //!< the left hind leg   the rotator
00268     "PRM:/r3/c1/c2-Joint2:j2",    //!< the left hind leg   the elevator 
00269     "PRM:/r3/c1/c2/c3-Joint2:j3", //!< the left hind leg   the knee
00270     "PRM:/r5/c1-Joint2:j1",       //!< the right hind leg   the rotator
00271     "PRM:/r5/c1/c2-Joint2:j2",    //!< the right hind leg   the elevator 
00272     "PRM:/r5/c1/c2/c3-Joint2:j3", //!< the right hind leg   the knee 
00273 
00274     "PRM:/r1/c1-Joint2:j1",       //!< the neck  tilt (12)
00275     "PRM:/r1/c1/c2-Joint2:j2",    //!< the neck   pan 
00276     "PRM:/r1/c1/c2/c3-Joint2:j3", //!< the neck   roll 
00277     
00278     "PRM:/r6/c2-Joint2:j2",       //!< the tail tilt (15)       // *** NOTE ***
00279     "PRM:/r6/c1-Joint2:j1",       //!< the tail pan             // CHANGE_ET 12/16/01 matches neck order
00280     
00281     "PRM:/r1/c1/c2/c3/c4-Joint2:j4", //!< the mouth (17)
00282     
00283     "PRM:/r1/c1/c2/c3/l1-LED2:l1", //!< lower  left  LED (18)
00284     "PRM:/r1/c1/c2/c3/l4-LED2:l4", //!< lower  right LED
00285     "PRM:/r1/c1/c2/c3/l2-LED2:l2", //!< middle left  LED
00286     "PRM:/r1/c1/c2/c3/l5-LED2:l5", //!< middle right LED
00287     "PRM:/r1/c1/c2/c3/l3-LED2:l3", //!< upper  left  LED
00288     "PRM:/r1/c1/c2/c3/l6-LED2:l6", //!< upper  right LED
00289     "PRM:/r1/c1/c2/c3/l7-LED2:l7", //!< top          LED
00290     
00291     "PRM:/r6/l2-LED2:l2", //!< tail red  LED
00292     "PRM:/r6/l1-LED2:l1", //!< tail blue LED
00293     
00294     "PRM:/r1/c1/c2/c3/e1-Joint3:j5", //!< left ear (27)
00295     "PRM:/r1/c1/c2/c3/e2-Joint3:j6" //!< right ear
00296   };
00297 
00298   //! use to open speaker connectio with the system
00299   const char* const SpeakerLocator="PRM:/r1/c1/c2/c3/s1-Speaker:S1";
00300 
00301   //! use to open camera connection with the system
00302   const char* const CameraLocator="PRM:/r1/c1/c2/c3/i1-FbkImageSensor:F1";
00303 
00304   //Old PID table:
00305   /*const word Pid[NumPIDJoints][6] = {
00306     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00307     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00308     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00309     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00310     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00311     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00312     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00313     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00314     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00315     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00316     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00317     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00318     
00319     { 0x0A, 0x08, 0x0C, 0x0E, 0x02, 0x0F },
00320     { 0x0D, 0x08, 0x0B, 0x0E, 0x02, 0x0F },
00321     { 0x10, 0x08, 0x0C, 0x0E, 0x02, 0x0F }, // P was 0x0C, updated as seen on https://www.openr.org/page1_2001/gain.html 8/13/2002
00322     
00323     { 0x0A, 0x00, 0x18, 0x0E, 0x02, 0x0F },
00324     { 0x07, 0x00, 0x11, 0x0E, 0x02, 0x0F },
00325     
00326     { 0x0E, 0x08, 0x10, 0x0E, 0x02, 0x0F }, //  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
00327   };*/
00328 
00329   //! This table holds the default PID values for each joint.  see PIDMC
00330   const float DefaultPIDs[NumPIDJoints][3] =
00331     {
00332       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00333       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00334       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00335       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00336       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00337       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00338       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00339       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00340       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00341       { 0x16/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x08/(double)(1<<(16-0xF)) },
00342       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x06/(double)(1<<(16-0xF)) },
00343       { 0x23/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x05/(double)(1<<(16-0xF)) },
00344 
00345       { 0x0A/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0C/(double)(1<<(16-0xF)) },
00346       { 0x0D/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0B/(double)(1<<(16-0xF)) },
00347       { 0x0A/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x0C/(double)(1<<(16-0xF)) },
00348 
00349       { 0x0A/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x18/(double)(1<<(16-0xF)) },
00350       { 0x07/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x11/(double)(1<<(16-0xF)) },
00351 
00352       { 0x0E/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x10/(double)(1<<(16-0xF)) }
00353     };
00354 
00355   //! These will control the shift values given to the system.  see PIDMC
00356   const unsigned char DefaultPIDShifts[3] = {0x0E, 0x02, 0x0F};
00357     
00358   //!These values are Sony's recommended maximum joint velocities, in rad/ms
00359   /*! a value <= 0 means infinite speed (e.g. LEDs) 
00360    *  
00361    *  These limits are <b>not</b> enforced by the framework.  They are simply available for you to use as you see fit.
00362    *  HeadPointerMC is (as of v1.6) the only included MotionCommand to actually use these values. */
00363   const float MaxOutputSpeed[NumOutputs] = {
00364     2.8143434e-03,     //Legs LR,FB,REK
00365     2.4980025e-03,
00366     2.8361600e-03,
00367     2.8143434e-03,
00368     2.4980025e-03,
00369     2.8361600e-03,
00370     2.8143434e-03,
00371     2.4980025e-03,
00372     2.8361600e-03,
00373     2.8143434e-03,
00374     2.4980025e-03,
00375     2.8361600e-03,
00376   
00377     2.1053034e-03,     //Head TPR
00378     3.0106930e-03,
00379     3.0106930e-03,
00380   
00381     4.4724062e-03,     //Tail
00382     4.4724062e-03,
00383   
00384     4.3742314e-03,     //Mouth
00385     
00386     0,0,0,0,0,0,0,0,0, //LEDs
00387     
00388     0,0                //Ears
00389   };
00390 
00391   #ifndef RAD
00392     //!Just a little macro for converting degrees to radians
00393   #define RAD(deg) (((deg) * M_PI ) / 180.0)
00394     //!a flag so we undef these after we're done - do you have a cleaner solution?
00395   #define __RI_RAD_FLAG
00396   #endif
00397   
00398   //! Defines the indexes to use to access the min and max entries of ERS210Info::outputRanges and ERS210Info::mechanicalLimits
00399   enum MinMaxRange_t { MinRange,MaxRange };
00400 
00401   //! This table holds the software limits of each of the outputs
00402   const double outputRanges[NumOutputs][2] =
00403     {
00404       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left front REK
00405       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right front REK
00406       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left back REK
00407       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right back REK
00408 
00409       { RAD(-82),RAD(43) },{ RAD(-89.6),RAD(89.6) },{ RAD(-29),RAD(29) }, //neck TPR
00410         
00411       { RAD(-22),RAD(22) },{ RAD(-22),RAD(22) }, // tail tp
00412 
00413       { RAD(-47),RAD(-3) }, //mouth
00414 
00415       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00416     
00417       {0,1},{0,1} //ears
00418     };
00419 
00420   //! This table holds the mechanical limits of each of the outputs
00421   const double mechanicalLimits[NumOutputs][2] =
00422     {
00423       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left front jsk
00424       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right front jsk
00425       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left back jsk
00426       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right back jsk
00427 
00428       { RAD(-85),RAD(46) },{ RAD(-92.6),RAD(92.6) },{ RAD(-32),RAD(32) }, //neck tpr
00429         
00430       { RAD(-25),RAD(25) },{ RAD(-25),RAD(25) }, // tail tp
00431 
00432       { RAD(-50),RAD(0) }, //mouth
00433 
00434       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00435     
00436       {0,1},{0,1} //ears
00437     };
00438 
00439 #ifdef __RI_RAD_FLAG
00440 #undef RAD
00441 #undef __RI_RAD_FLAG
00442 #endif
00443 
00444 #endif //TGT_ERS2xx check
00445 
00446   /*! @name CPC IDs
00447    * values defined by OPEN-R, used to interface with lower level OPEN-R code to read sensors - DOESN'T correspond to ERS210Info::PrimitiveName */
00448   static const int CPCJointNeckTilt           =  0; // Head
00449   static const int CPCJointNeckPan            =  1;
00450   static const int CPCJointNeckRoll           =  2;
00451   static const int CPCSensorHeadBackPressure  =  3;
00452   static const int CPCSensorHeadFrontPressure =  4;
00453   static const int CPCSensorPSD               =  5;
00454   static const int CPCJointMouth              =  6;
00455   static const int CPCSensorChinSwitch        =  7;
00456   static const int CPCJointLFRotator          =  8; // Left front leg
00457   static const int CPCJointLFElevator         =  9;
00458   static const int CPCJointLFKnee             = 10;
00459   static const int CPCSensorLFPaw             = 11;
00460   static const int CPCJointLHRotator          = 12; // Left hind leg
00461   static const int CPCJointLHElevator         = 13;
00462   static const int CPCJointLHKnee             = 14;
00463   static const int CPCSensorLHPaw             = 15;
00464   static const int CPCJointRFRotator          = 16; // Right front leg
00465   static const int CPCJointRFElevator         = 17;
00466   static const int CPCJointRFKnee             = 18;
00467   static const int CPCSensorRFPaw             = 19;
00468   static const int CPCJointRHRotator          = 20; // Right hind leg
00469   static const int CPCJointRHElevator         = 21;
00470   static const int CPCJointRHKnee             = 22;
00471   static const int CPCSensorRHPaw             = 23;
00472   static const int CPCJointTailPan            = 24; // Tail
00473   static const int CPCJointTailTilt           = 25;
00474   static const int CPCSensorThermoSensor      = 26;
00475   static const int CPCSensorBackSwitch        = 27;
00476   static const int CPCSensorAccelFB           = 28; //!< Front-back; see RobotInfo::BAccelOffset 
00477   static const int CPCSensorAccelLR           = 29; //!< Left-right; see RobotInfo::LAccelOffset 
00478   static const int CPCSensorAccelUD           = 30; //!< Up-down; see RobotInfo::DAccelOffset 
00479   //@}
00480 
00481 }
00482   
00483 /*! @file
00484  * @brief Defines RobotInfo namespace for ERS-210 models, gives some information about the robot's capabilities, such as joint counts, offsets, names and PID values
00485  * @author ejt (Creator)
00486  *
00487  * $Author: ejt $
00488  * $Name: tekkotsu-2_4_1 $
00489  * $Revision: 1.20 $
00490  * $State: Exp $
00491  * $Date: 2005/06/01 05:47:48 $
00492  */
00493 
00494 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:46 2005 by Doxygen 1.4.4