Tekkotsu 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 "CommonERSInfo.h"
00006 
00007 // see http://tekkotsu.org/porting.html#configuration for more information on TGT_HAS_* flags
00008 #if defined(TGT_ERS210)
00009 # define TGT_HAS_LEDS 9
00010 # define TGT_HAS_BUTTONS 8
00011 # define TGT_HAS_IR_DISTANCE 1
00012 #endif
00013 
00014 //! Contains information about the ERS-210 Robot, such as number of joints, PID defaults, timing information, etc.
00015 namespace ERS210Info {
00016 
00017   // *******************************
00018   //       ROBOT CONFIGURATION
00019   // *******************************
00020 
00021   extern const char* const TargetName; //!< the name of the model, to be used for logging and remote GUIs
00022 
00023   const unsigned int FrameTime=8;        //!< time between frames in the motion system (milliseconds)
00024   const unsigned int NumFrames=4;        //!< the number of frames per buffer (don't forget also double buffered)
00025   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)
00026   const unsigned int NumSlowFrames=1;    //!< the number of frames per buffer being sent to ears (double buffered as well)
00027   const unsigned int SoundBufferTime=32; //!< the number of milliseconds per sound buffer... I'm not sure if this can be changed
00028   
00029   //!Corresponds to entries in ERS210Info::PrimitiveName, defined at the end of this file, these are the primary grouping
00030   /*!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 */
00031   //!@name Output Types Information
00032   const unsigned NumWheels = 0; //!< no wheels, just legs
00033   
00034   const unsigned JointsPerArm   =  0; //!< no arms, just legs
00035   const unsigned NumArms        =  0; //!< no arms, just legs
00036   const unsigned NumArmJoints   =  JointsPerArm*NumArms;
00037   
00038   const unsigned JointsPerLeg   =  3; //!< The number of joints per leg
00039   const unsigned NumLegs        =  4; //!< The number of legs
00040   const unsigned NumLegJoints   =  JointsPerLeg*NumLegs; //!< the TOTAL number of joints on ALL legs
00041   const unsigned NumHeadJoints  =  3; //!< The number of joints in the neck
00042   const unsigned NumTailJoints  =  2; //!< The number of joints assigned to the tail
00043   const unsigned NumMouthJoints =  1; //!< the number of joints that control the mouth
00044   const unsigned NumEarJoints   =  2; //!< The number of joints which control the ears (NOT per ear, is total)
00045   const unsigned NumButtons     =  8; //!< the number of buttons that are available, see ERS210Info::ButtonOffset_t
00046   const unsigned NumSensors     =  1+3+1+5;  //!< 1 dist, 3 accel, 1 thermo, 5 from power, see ERS210Info::SensorOffset_t
00047   const unsigned NumLEDs        =  9; //!< The number of LEDs which can be controlled
00048   
00049   const unsigned NumPIDJoints   = NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints; //!< The number of joints which use PID motion - everything except ears
00050   const unsigned NumBinJoints   = NumEarJoints; //!< The number of binary joints - just the ears (Aperios only)
00051   const unsigned NumOutputs     = NumPIDJoints + NumBinJoints + NumLEDs; //!< the total number of outputs
00052   const unsigned NumReferenceFrames = NumOutputs + 1 + NumLegs + 1 + 1; //!< for the base, paw, camera, and IR sensor reference frames
00053 
00054   using namespace CameraERS2xx;
00055   
00056   const float BallOfFootRadius=27.922f/2; //!< radius of the ball of the foot
00057   const float CylinderOfFootRadius=24.606f/2; //!< radius of the cylinder of the foot
00058 
00059   //! true for joints which can be updated every 32 ms (all but the ears)
00060   /*! @hideinitializer */
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 };
00062   //@}
00063   
00064   
00065   
00066   // *******************************
00067   //         OUTPUT OFFSETS
00068   // *******************************
00069 
00070 
00071   //!Corresponds to entries in ERS210Info::PrimitiveName, defined at the end of this file
00072   //!@name Output Offsets
00073 
00074   const unsigned PIDJointOffset = 0; //!< The beginning of the PID Joints
00075   const unsigned LegOffset   = PIDJointOffset;           //!< the offset of the beginning of the leg joints
00076   const unsigned HeadOffset  = LegOffset+NumLegJoints;   //!< the offset of the beginning of the head joints
00077   const unsigned TailOffset  = HeadOffset+NumHeadJoints; //!< the offset of the beginning of the tail joints
00078   const unsigned MouthOffset = TailOffset+NumTailJoints; //!< the offset of the beginning of the mouth joint
00079 
00080   const unsigned LEDOffset   = PIDJointOffset + NumPIDJoints; //!< the offset of LEDs in WorldState::outputs and MotionCommand functions
00081 
00082   const unsigned BinJointOffset = LEDOffset + NumLEDs; //!< The beginning of the binary joints
00083   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
00084 
00085   const unsigned BaseFrameOffset   = NumOutputs; //!< Use with kinematics to refer to base reference frame
00086   const unsigned FootFrameOffset    = BaseFrameOffset+1; //!< Use with kinematics to refer to paw reference frames (add appropriate LegOrder_t to specify which paw)
00087   const unsigned PawFrameOffset    = FootFrameOffset; //!< Aibo-era alias for FootFrameOffset
00088   const unsigned CameraFrameOffset = FootFrameOffset+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 ordering of legs
00092   enum LegOrder_t {
00093     LFrLegOrder = 0, //!< left front leg
00094     RFrLegOrder,     //!< right front leg
00095     LBkLegOrder,     //!< left back leg
00096     RBkLegOrder      //!< right back leg
00097   };
00098   
00099   //! The offsets within appendages (the legs)  Note that the ordering matches the actual physical ordering of joints on the appendage (and not that of the head's TPROffset_t's)
00100   enum REKOffset_t {
00101     RotatorOffset=0, //!< moves leg forward or backward along body
00102     ElevatorOffset,  //!< moves leg toward or away from body
00103     KneeOffset       //!< moves knee
00104   };
00105   
00106   //! The offsets of appendages with tilt (elevation), pan (heading), and roll or nod joints (i.e. head)  Note that the ordering matches the actual physical ordering of joints on the appendage (and not that of the leg's REKOffset_t's)
00107   enum TPROffset_t {
00108     TiltOffset = 0, //!< tilt/elevation (vertical)
00109     PanOffset,      //!< pan/heading (horizontal)
00110     RollOffset,      //!< roll (rotational)
00111     NodOffset=RollOffset       //!< nod (second tilt)
00112   };
00113   
00114   //! The offsets of the individual legs
00115   enum LegOffset_t {
00116     LFrLegOffset = LegOffset+LFrLegOrder*JointsPerLeg, //!< beginning of left front leg
00117     RFrLegOffset = LegOffset+RFrLegOrder*JointsPerLeg, //!< beginning of right front leg
00118     LBkLegOffset = LegOffset+LBkLegOrder*JointsPerLeg, //!< beginning of left back leg
00119     RBkLegOffset = LegOffset+RBkLegOrder*JointsPerLeg  //!< beginning of right back leg
00120   };
00121   
00122   //@}
00123   
00124   //! 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
00125   enum LEDOffset_t {
00126     BotLLEDOffset = LEDOffset,//!< bottom left (red - sad)
00127     BotRLEDOffset, //!< bottom right (red - sad)
00128     MidLLEDOffset, //!< middle left (green - happy)
00129     MidRLEDOffset, //!< middle right (green - happy)
00130     TopLLEDOffset, //!< top left (red - angry)
00131     TopRLEDOffset, //!< top right (red - angry)
00132     TopBrLEDOffset,//!< top bar (green)
00133     TlRedLEDOffset,//!< red tail light
00134     TlBluLEDOffset, //!< blue tail light
00135  
00136     // alias for 220 cross-compatibility
00137     FaceFrontLeftLEDOffset = BotLLEDOffset,   //!< alias for 220 cross-compatibility
00138     FaceFrontRightLEDOffset = BotRLEDOffset,  //!< alias for 220 cross-compatibility
00139     FaceCenterLeftLEDOffset = MidLLEDOffset,  //!< alias for 220 cross-compatibility
00140     FaceCenterRightLEDOffset = MidRLEDOffset, //!< alias for 220 cross-compatibility
00141     FaceBackLeftLEDOffset = TopLLEDOffset,    //!< alias for 220 cross-compatibility
00142     FaceBackRightLEDOffset = TopRLEDOffset,   //!< alias for 220 cross-compatibility
00143     ModeLEDOffset = TopBrLEDOffset,           //!< alias for 220 cross-compatibility
00144     TailRightLEDOffset = TlRedLEDOffset,      //!< alias for 220 cross-compatibility
00145     TailLeftLEDOffset = TlBluLEDOffset        //!< alias for 220 cross-compatibility
00146   };
00147   
00148   //! Bitmasks for use when specifying combinations of LEDs (see LedEngine ) Note that left/right are robot's point of view
00149   //!@name LED Bitmasks
00150   typedef unsigned int LEDBitMask_t; //!< So you can be clear when you're refering to a LED bitmask
00151   const LEDBitMask_t BotLLEDMask = 1<<(BotLLEDOffset-LEDOffset); //!< bottom left (red - sad)
00152   const LEDBitMask_t BotRLEDMask = 1<<(BotRLEDOffset-LEDOffset); //!< bottom right (red - sad)
00153   const LEDBitMask_t MidLLEDMask = 1<<(MidLLEDOffset-LEDOffset); //!< middle left (green - happy)
00154   const LEDBitMask_t MidRLEDMask = 1<<(MidRLEDOffset-LEDOffset); //!< middle right (green - happy)
00155   const LEDBitMask_t TopLLEDMask = 1<<(TopLLEDOffset-LEDOffset); //!< top left (red - angry)
00156   const LEDBitMask_t TopRLEDMask = 1<<(TopRLEDOffset-LEDOffset); //!< top right (red - angry)
00157   const LEDBitMask_t TopBrLEDMask= 1<<(TopBrLEDOffset-LEDOffset); //!< top bar (green)
00158   const LEDBitMask_t TlRedLEDMask= 1<<(TlRedLEDOffset-LEDOffset); //!< red tail light
00159   const LEDBitMask_t TlBluLEDMask= 1<<(TlBluLEDOffset-LEDOffset); //!< blue tail light
00160 
00161   //! LEDs for face (all but tail)
00162   const LEDBitMask_t FaceLEDMask
00163   = BotLLEDMask | BotRLEDMask
00164   | MidLLEDMask | MidRLEDMask
00165   | TopLLEDMask | TopRLEDMask
00166   | TopBrLEDMask;
00167 
00168   //! LEDs for face (all but tail)
00169   const LEDBitMask_t HeadLEDMask
00170   = BotLLEDMask | BotRLEDMask
00171   | MidLLEDMask | MidRLEDMask
00172   | TopLLEDMask | TopRLEDMask
00173   | TopBrLEDMask;
00174 
00175   const LEDBitMask_t BackLEDMask = 0; //!< 210 has no back LEDs
00176   const LEDBitMask_t TailLEDMask = TlRedLEDMask|TlBluLEDMask; //!< LEDs on tail
00177   const LEDBitMask_t AllLEDMask  = (LEDBitMask_t)~0; //!< selects all of the leds
00178   //@}
00179   
00180   //! Offset needed so that the centroid of the robot is correct relative to the bounding box
00181   const fmat::Column<3> AgentBoundingBoxBaseFrameOffset = fmat::pack(0,0,0); 
00182 
00183   //! Half of the length, width, and height of the robot
00184   const fmat::Column<3> AgentBoundingBoxHalfDims = fmat::pack(304.8/2, 304.8/2, 0);
00185   
00186   
00187   // *******************************
00188   //          INPUT OFFSETS
00189   // *******************************
00190 
00191 
00192   //! The order in which inputs should be stored
00193   //!@name Input Offsets
00194 
00195   //! holds offsets to different buttons in WorldState::buttons[]
00196   /*! Should be a straight mapping to the ButtonSourceIDs
00197    *
00198    *  Note that the chest (power) button is not a normal button.  It kills
00199    *  power to the motors at a hardware level, and isn't sensed in the
00200    *  normal way.  If you want to know when it is pressed (and you are
00201    *  about to shut down) see PowerSrcID::PauseSID.
00202    *
00203    *  @see WorldState::buttons @see ButtonSourceID_t */
00204   enum ButtonOffset_t {
00205     LFrPawOffset = LFrLegOrder,
00206     RFrPawOffset = RFrLegOrder,
00207     LBkPawOffset = LBkLegOrder,
00208     RBkPawOffset = RBkLegOrder,
00209     ChinButOffset= 4,
00210     BackButOffset,
00211     HeadFrButOffset, //!< not in reliable pressure units, but 1.0 is fairly stiff pressure, 0 is none
00212     HeadButOffset=HeadFrButOffset,  //!< for ERS-7 compatibility
00213     HeadBkButOffset //!< not in reliable pressure units, but 1.0 is fairly stiff pressure, 0 is none
00214   };
00215   
00216   //! Provides a string name for each button
00217   const char* const buttonNames[NumButtons] = {
00218     "LFrPaw","RFrPaw","LBkPaw","RBkPaw",
00219     "ChinBut","BackBut",
00220     "HeadFrBut","HeadBkBut"
00221   };
00222 
00223   //! holds offset to different sensor values in WorldState::sensors[]
00224   /*! @see WorldState::sensors[] */
00225   enum SensorOffset_t {
00226     IRDistOffset = 0,  //!< in millimeters
00227     BAccelOffset, //!< backward acceleration, in @f$m/s^2@f$, negative if sitting on butt (positive for faceplant)
00228     LAccelOffset, //!< acceleration to the robot's left, in @f$m/s^2@f$, negative if lying on robot's left side
00229     DAccelOffset, //!< downward acceleration, in @f$m/s^2@f$, negative if standing up... be careful about the signs on all of these...
00230     ThermoOffset, //!< in degrees Celcius
00231     PowerRemainOffset, //!< percentage, 0-1
00232     PowerThermoOffset, //!<  degrees Celcius
00233     PowerCapacityOffset, //!< milli-amp hours
00234     PowerVoltageOffset, //!< volts
00235     PowerCurrentOffset //!< milli-amp negative values (maybe positive while charging?)
00236   };
00237 
00238   //! Provides a string name for each sensor
00239   const char* const sensorNames[NumSensors] = {
00240     "IRDist",
00241     "BAccel","LAccel","DAccel",
00242     "Thermo",
00243     "PowerRemain","PowerThermo","PowerCapacity","PowerVoltage","PowerCurrent"
00244   };
00245 
00246   //@}
00247 
00248 
00249   //! Names for each of the outputs
00250   const char* const outputNames[NumReferenceFrames+1] = {
00251     "LFr:rotor",
00252     "LFr:elvtr",
00253     "LFr:knee",
00254     "RFr:rotor",
00255     "RFr:elvtr",
00256     "RFr:knee",
00257     "LBk:rotor",
00258     "LBk:elvtr",
00259     "LBk:knee",
00260     "RBk:rotor",
00261     "RBk:elvtr",
00262     "RBk:knee",
00263     
00264     "NECK:tilt",
00265     "NECK:pan",
00266     "NECK:roll",
00267     
00268     "TAIL:tilt",
00269     "TAIL:pan",
00270     
00271     "MOUTH",
00272     
00273     "LED:botL",
00274     "LED:botR",
00275     "LED:midL",
00276     "LED:midR",
00277     "LED:topL",
00278     "LED:topR",
00279     "LED:topBr",
00280     
00281     "LED:tlRed",
00282     "LED:tlBlu",
00283     
00284     "EAR:left",
00285     "EAR:right",
00286 
00287     "BaseFrame",
00288     "LFrFootFrame",
00289     "RFrFootFrame",
00290     "LBkFootFrame",
00291     "RBkFootFrame",
00292     "CameraFrame",
00293     "IRFrame",
00294     NULL
00295   };
00296   
00297   
00298   //! provides polymorphic robot capability detection/mapping
00299   class ERS210Capabilities : public Capabilities {
00300   public:
00301     //! constructor
00302     ERS210Capabilities()
00303     : Capabilities(TargetName,NumReferenceFrames,outputNames,NumButtons,buttonNames,NumSensors,sensorNames,PIDJointOffset,NumPIDJoints,LEDOffset,NumLEDs,NumOutputs)
00304     {
00305       // ers-7 button alias
00306       buttonToIndex["HeadBut"]=HeadButOffset;
00307       // 220 led aliases
00308       frameToIndex["LED:bkL1"]=TailLeftLEDOffset;
00309       frameToIndex["LED:bkL2"]=TailRightLEDOffset;
00310     }
00311   };
00312   //! allocation declared in RobotInfo.cc
00313   extern const ERS210Capabilities capabilities;
00314   
00315   
00316   //! the joint identifier strings used to refer to specific joints in OPEN-R (but not needed for others)
00317   /*!@showinitializer 
00318    * @warning IMPORTANT!!!!  DO NOT CHANGE THE ORDER OF ITEMS IN THIS TABLE!!!\n
00319    *
00320    * The offset consts defined in this file correspond to this table and will make life easier
00321    * if you feel the need to reorder things, but they aren't used perfect @e everywhere \n
00322    * In particular, assumptions are made that the pid joints will be in slots 0-numPIDJoints
00323    * and that the fast outputs (ie NOT ears) will be in slots 0-NumFastOutputs\n
00324    * There may be other assumptions not noted here!!!
00325    * @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*/
00326   const char* const PrimitiveName [NumOutputs] = {
00327     "PRM:/r2/c1-Joint2:j1",       //!< the left front leg   the rotator
00328     "PRM:/r2/c1/c2-Joint2:j2",    //!< the left front leg   the elevator 
00329     "PRM:/r2/c1/c2/c3-Joint2:j3", //!< the left front leg   the knee 
00330     "PRM:/r4/c1-Joint2:j1",       //!< the right front leg   the rotator
00331     "PRM:/r4/c1/c2-Joint2:j2",    //!< the right front leg    the elevator 
00332     "PRM:/r4/c1/c2/c3-Joint2:j3", //!< the right front leg   the knee 
00333     
00334     "PRM:/r3/c1-Joint2:j1",       //!< the left hind leg   the rotator
00335     "PRM:/r3/c1/c2-Joint2:j2",    //!< the left hind leg   the elevator 
00336     "PRM:/r3/c1/c2/c3-Joint2:j3", //!< the left hind leg   the knee
00337     "PRM:/r5/c1-Joint2:j1",       //!< the right hind leg   the rotator
00338     "PRM:/r5/c1/c2-Joint2:j2",    //!< the right hind leg   the elevator 
00339     "PRM:/r5/c1/c2/c3-Joint2:j3", //!< the right hind leg   the knee 
00340 
00341     "PRM:/r1/c1-Joint2:j1",       //!< the neck  tilt (12)
00342     "PRM:/r1/c1/c2-Joint2:j2",    //!< the neck   pan 
00343     "PRM:/r1/c1/c2/c3-Joint2:j3", //!< the neck   roll 
00344     
00345     "PRM:/r6/c2-Joint2:j2",       //!< the tail tilt (15)       // *** NOTE ***
00346     "PRM:/r6/c1-Joint2:j1",       //!< the tail pan             // CHANGE_ET 12/16/01 matches neck order
00347     
00348     "PRM:/r1/c1/c2/c3/c4-Joint2:j4", //!< the mouth (17)
00349     
00350     "PRM:/r1/c1/c2/c3/l1-LED2:l1", //!< lower  left  LED (18)
00351     "PRM:/r1/c1/c2/c3/l4-LED2:l4", //!< lower  right LED
00352     "PRM:/r1/c1/c2/c3/l2-LED2:l2", //!< middle left  LED
00353     "PRM:/r1/c1/c2/c3/l5-LED2:l5", //!< middle right LED
00354     "PRM:/r1/c1/c2/c3/l3-LED2:l3", //!< upper  left  LED
00355     "PRM:/r1/c1/c2/c3/l6-LED2:l6", //!< upper  right LED
00356     "PRM:/r1/c1/c2/c3/l7-LED2:l7", //!< top          LED
00357     
00358     "PRM:/r6/l2-LED2:l2", //!< tail red  LED
00359     "PRM:/r6/l1-LED2:l1", //!< tail blue LED
00360     
00361     "PRM:/r1/c1/c2/c3/e1-Joint3:j5", //!< left ear (27)
00362     "PRM:/r1/c1/c2/c3/e2-Joint3:j6" //!< right ear
00363   };
00364 
00365   //! use to open speaker connectio with the system
00366   const char* const SpeakerLocator="PRM:/r1/c1/c2/c3/s1-Speaker:S1";
00367 
00368   //! use to open camera connection with the system
00369   const char* const CameraLocator="PRM:/r1/c1/c2/c3/i1-FbkImageSensor:F1";
00370 
00371   //Old PID table:
00372   /*const word Pid[NumPIDJoints][6] = {
00373     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00374     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00375     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00376     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00377     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00378     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00379     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00380     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00381     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00382     { 0x16, 0x04, 0x08, 0x0E, 0x02, 0x0F },
00383     { 0x14, 0x04, 0x06, 0x0E, 0x02, 0x0F },
00384     { 0x23, 0x04, 0x05, 0x0E, 0x02, 0x0F },
00385     
00386     { 0x0A, 0x08, 0x0C, 0x0E, 0x02, 0x0F },
00387     { 0x0D, 0x08, 0x0B, 0x0E, 0x02, 0x0F },
00388     { 0x10, 0x08, 0x0C, 0x0E, 0x02, 0x0F }, // P was 0x0C, updated as seen on https://www.openr.org/page1_2001/gain.html 8/13/2002
00389     
00390     { 0x0A, 0x00, 0x18, 0x0E, 0x02, 0x0F },
00391     { 0x07, 0x00, 0x11, 0x0E, 0x02, 0x0F },
00392     
00393     { 0x0E, 0x08, 0x10, 0x0E, 0x02, 0x0F }, //  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
00394   };*/
00395 
00396   //! This table holds the default PID values for each joint.  see PIDMC
00397   const float DefaultPIDs[NumPIDJoints][3] =
00398     {
00399       { 0x16/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x08/(float)(1<<(16-0xF)) },
00400       { 0x14/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x06/(float)(1<<(16-0xF)) },
00401       { 0x23/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x05/(float)(1<<(16-0xF)) },
00402       { 0x16/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x08/(float)(1<<(16-0xF)) },
00403       { 0x14/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x06/(float)(1<<(16-0xF)) },
00404       { 0x23/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x05/(float)(1<<(16-0xF)) },
00405       { 0x16/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x08/(float)(1<<(16-0xF)) },
00406       { 0x14/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x06/(float)(1<<(16-0xF)) },
00407       { 0x23/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x05/(float)(1<<(16-0xF)) },
00408       { 0x16/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x08/(float)(1<<(16-0xF)) },
00409       { 0x14/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x06/(float)(1<<(16-0xF)) },
00410       { 0x23/(float)(1<<(16-0xE)), 0x04/(float)(1<<(16-0x2)), 0x05/(float)(1<<(16-0xF)) },
00411 
00412       { 0x0A/(float)(1<<(16-0xE)), 0x08/(float)(1<<(16-0x2)), 0x0C/(float)(1<<(16-0xF)) },
00413       { 0x0D/(float)(1<<(16-0xE)), 0x08/(float)(1<<(16-0x2)), 0x0B/(float)(1<<(16-0xF)) },
00414       { 0x0A/(float)(1<<(16-0xE)), 0x08/(float)(1<<(16-0x2)), 0x0C/(float)(1<<(16-0xF)) },
00415 
00416       { 0x0A/(float)(1<<(16-0xE)), 0x00/(float)(1<<(16-0x2)), 0x18/(float)(1<<(16-0xF)) },
00417       { 0x07/(float)(1<<(16-0xE)), 0x00/(float)(1<<(16-0x2)), 0x11/(float)(1<<(16-0xF)) },
00418 
00419       { 0x0E/(float)(1<<(16-0xE)), 0x08/(float)(1<<(16-0x2)), 0x10/(float)(1<<(16-0xF)) }
00420     };
00421 
00422   //! These will control the shift values given to the system.  see PIDMC
00423   const unsigned char DefaultPIDShifts[3] = {0x0E, 0x02, 0x0F};
00424     
00425   //!These values are Sony's recommended maximum joint velocities, in rad/s
00426   /*! a value <= 0 means infinite speed (e.g. LEDs) 
00427    *  
00428    *  These limits are <b>not</b> enforced by the framework.  They are simply available for you to use as you see fit.
00429    *  HeadPointerMC is (as of v1.6) the only included MotionCommand to actually use these values. */
00430   const float MaxOutputSpeed[NumOutputs] = {
00431     2.8143434f,     //Legs LR,FB,REK
00432     2.4980025f,
00433     2.8361600f,
00434     2.8143434f,
00435     2.4980025f,
00436     2.8361600f,
00437     2.8143434f,
00438     2.4980025f,
00439     2.8361600f,
00440     2.8143434f,
00441     2.4980025f,
00442     2.8361600f,
00443   
00444     2.1053034f,     //Head TPR
00445     3.0106930f,
00446     3.0106930f,
00447   
00448     4.4724062f,     //Tail
00449     4.4724062f,
00450   
00451     4.3742314f,     //Mouth
00452     
00453     0,0,0,0,0,0,0,0,0, //LEDs
00454     
00455     0,0                //Ears
00456   };
00457 
00458   #ifndef RAD
00459     //!Just a little macro for converting degrees to radians
00460   #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00461     //!a flag so we undef these after we're done - do you have a cleaner solution?
00462   #define __RI_RAD_FLAG
00463   #endif
00464   
00465   //! This table holds the software limits of each of the outputs
00466   const float outputRanges[NumOutputs][2] =
00467     {
00468       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left front REK
00469       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right front REK
00470       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //left back REK
00471       { RAD(-117),RAD(117) },{ RAD(-11),RAD(89) },{ RAD(-27),RAD(147) }, //right back REK
00472 
00473       { RAD(-82),RAD(43) },{ RAD(-89.6f),RAD(89.6f) },{ RAD(-29),RAD(29) }, //neck TPR
00474         
00475       { RAD(-22),RAD(22) },{ RAD(-22),RAD(22) }, // tail tp
00476 
00477       { RAD(-47),RAD(-3) }, //mouth
00478 
00479       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00480     
00481       {0,1},{0,1} //ears
00482     };
00483 
00484   //! This table holds the mechanical limits of each of the outputs
00485   const float mechanicalLimits[NumOutputs][2] =
00486     {
00487       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left front jsk
00488       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right front jsk
00489       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //left back jsk
00490       { RAD(-120),RAD(120) },{ RAD(-14),RAD(92) },{ RAD(-30),RAD(150) }, //right back jsk
00491 
00492       { RAD(-85),RAD(46) },{ RAD(-92.6f),RAD(92.6f) },{ RAD(-32),RAD(32) }, //neck tpr
00493         
00494       { RAD(-25),RAD(25) },{ RAD(-25),RAD(25) }, // tail tp
00495 
00496       { RAD(-50),RAD(0) }, //mouth
00497 
00498       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00499     
00500       {0,1},{0,1} //ears
00501     };
00502 
00503 #ifdef __RI_RAD_FLAG
00504 #undef RAD
00505 #undef __RI_RAD_FLAG
00506 #endif
00507 
00508   /*! @name CPC IDs
00509    * values defined by OPEN-R, used to interface with lower level OPEN-R code to read sensors - DOESN'T correspond to ERS210Info::PrimitiveName */
00510   const int CPCJointNeckTilt           =  0; // Head
00511   const int CPCJointNeckPan            =  1;
00512   const int CPCJointNeckRoll           =  2;
00513   const int CPCSensorHeadBackPressure  =  3;
00514   const int CPCSensorHeadFrontPressure =  4;
00515   const int CPCSensorPSD               =  5;
00516   const int CPCJointMouth              =  6;
00517   const int CPCSensorChinSwitch        =  7;
00518   const int CPCJointLFRotator          =  8; // Left front leg
00519   const int CPCJointLFElevator         =  9;
00520   const int CPCJointLFKnee             = 10;
00521   const int CPCSensorLFPaw             = 11;
00522   const int CPCJointLHRotator          = 12; // Left hind leg
00523   const int CPCJointLHElevator         = 13;
00524   const int CPCJointLHKnee             = 14;
00525   const int CPCSensorLHPaw             = 15;
00526   const int CPCJointRFRotator          = 16; // Right front leg
00527   const int CPCJointRFElevator         = 17;
00528   const int CPCJointRFKnee             = 18;
00529   const int CPCSensorRFPaw             = 19;
00530   const int CPCJointRHRotator          = 20; // Right hind leg
00531   const int CPCJointRHElevator         = 21;
00532   const int CPCJointRHKnee             = 22;
00533   const int CPCSensorRHPaw             = 23;
00534   const int CPCJointTailPan            = 24; // Tail
00535   const int CPCJointTailTilt           = 25;
00536   const int CPCSensorThermoSensor      = 26;
00537   const int CPCSensorBackSwitch        = 27;
00538   const int CPCSensorAccelFB           = 28; //!< Front-back; see RobotInfo::BAccelOffset 
00539   const int CPCSensorAccelLR           = 29; //!< Left-right; see RobotInfo::LAccelOffset 
00540   const int CPCSensorAccelUD           = 30; //!< Up-down; see RobotInfo::DAccelOffset 
00541   //@}
00542 
00543 }
00544   
00545 /*! @file
00546  * @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
00547  * @author ejt (Creator)
00548  */
00549 
00550 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:38 2016 by Doxygen 1.6.3