Homepage Demos Overview Downloads Tutorials Reference
Credits

ERS7Info.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ERS7Info_h
00003 #define INCLUDED_ERS7Info_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 //! Contains information about the ERS-7 Robot, such as number of joints, PID defaults, timing information, etc.
00016 namespace ERS7Info {
00017 
00018   // *******************************
00019   //       ROBOT CONFIGURATION
00020   // *******************************
00021 
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=8;  //!< time between frames for the ears (ERS-7 doesn't seem to have any "slow" joints; this only applied for the ears on the ERS-210)
00026   const unsigned int NumSlowFrames=4;    //!< 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 ERS7Info::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 NumPIDJoints   = 18; //!< The number of joints which use PID motion - everything except ears
00033   const unsigned NumLEDs        = 27; //!< The number LEDs which can be controlled
00034   const unsigned NumBinJoints   =  2; //!< The number of binary joints - just the ears
00035   const unsigned NumOutputs     = NumPIDJoints + NumBinJoints + NumLEDs; //!< the total number of outputs
00036 
00037   //! true for joints which can be updated every 32 ms (all but the ears)
00038   const bool IsFastOutput[NumOutputs] = {
00039     true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true, //PID joints
00040     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, //leds
00041     true,true //ears
00042   };
00043   //! we need this so you can tell programmatically which joints are "real" and which are "fake" in a compatability mode
00044   const bool IsRealERS7[NumOutputs] = { 
00045     true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true, //PID joints
00046     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, //leds
00047     true,true //ears
00048   };
00049   //@}
00050 
00051   const unsigned JointsPerLeg   =  3; //!< The number of joints per leg
00052   const unsigned NumLegs        =  4; //!< The number of legs
00053   const unsigned NumLegJoints   =  JointsPerLeg*NumLegs; //!< the TOTAL number of joints on ALL legs
00054   const unsigned NumHeadJoints  =  3; //!< The number of joints in the neck
00055   const unsigned NumTailJoints  =  2; //!< The number of joints assigned to the tail
00056   const unsigned NumMouthJoints =  1; //!< the number of joints that control the mouth
00057   const unsigned NumEarJoints   =  2; //!< The number of joints which control the ears (NOT per ear, is total)
00058   const unsigned NumButtons     =  2+4+3+1; //!< the number of buttons that are available, 2 head, 4 paws, 3 back, 1 underbelly see ERS7Info::ButtonOffset_t
00059   const unsigned NumSensors     =  3+3+5;  //!< 3 IR (distance), 3 accel (force), 5 from power, see ERS7Info::SensorOffset_t
00060   
00061 
00062   // *******************************
00063   //         OUTPUT OFFSETS
00064   // *******************************
00065 
00066 
00067   //!Corresponds to entries in ERS7Info::PrimitiveName, defined at the end of this file
00068   //!@name Output Offsets
00069 
00070   const unsigned PIDJointOffset = 0; //!< The beginning of the PID Joints
00071   const unsigned LegOffset   = PIDJointOffset;           //!< the offset of the beginning of the leg joints
00072   const unsigned HeadOffset  = LegOffset+NumLegJoints;   //!< the offset of the beginning of the head joints
00073   const unsigned TailOffset  = HeadOffset+NumHeadJoints; //!< the offset of the beginning of the tail joints
00074   const unsigned MouthOffset = TailOffset+NumTailJoints; //!< the offset of the beginning of the mouth joint
00075 
00076   const unsigned LEDOffset   = PIDJointOffset + NumPIDJoints; //!< the offset of LEDs in WorldState::outputs and MotionCommand functions
00077 
00078   const unsigned BinJointOffset = LEDOffset + NumLEDs; //!< The beginning of the binary joints
00079   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
00080 
00081   //! The offsets of the individual legs
00082   enum LegOffset_t {
00083     LFrLegOffset = LegOffset+LFrLegOrder*JointsPerLeg, //!< beginning of left front leg
00084     RFrLegOffset = LegOffset+RFrLegOrder*JointsPerLeg, //!< beginning of right front leg
00085     LBkLegOffset = LegOffset+LBkLegOrder*JointsPerLeg, //!< beginning of left back leg
00086     RBkLegOffset = LegOffset+RBkLegOrder*JointsPerLeg  //!< beginning of right back leg
00087   };
00088   
00089   //@}
00090   
00091   //! 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
00092   enum LEDOffset_t {
00093     HeadColorLEDOffset = LEDOffset,
00094     HeadWhiteLEDOffset,
00095     ModeRedLEDOffset,
00096     ModeGreenLEDOffset,
00097     ModeBlueLEDOffset,
00098     WirelessLEDOffset,
00099     FaceLEDPanelOffset, //!< the first LED in the panel - add to this to get the other 13 (14 total)
00100     FrBackColorLEDOffset = FaceLEDPanelOffset+14, // blue/purple
00101     FrBackWhiteLEDOffset,
00102     MdBackColorLEDOffset,                    // orange
00103     MdBackWhiteLEDOffset,
00104     RrBackColorLEDOffset,                    // red
00105     RrBackWhiteLEDOffset,
00106     LEDABModeOffset, // allows you to control A/B mode setting (this is a "virtual" LED)
00107 
00108     // aliases for 2xx cross-compatibility
00109     BotLLEDOffset = FaceLEDPanelOffset+0,//!< aliases for backward compatability (use mode A); bottom left
00110     BotRLEDOffset = FaceLEDPanelOffset+1, //!< bottom right
00111     MidLLEDOffset = FaceLEDPanelOffset+2, //!< middle left
00112     MidRLEDOffset = FaceLEDPanelOffset+3, //!< middle right
00113     TopLLEDOffset = FaceLEDPanelOffset+6, //!< top left
00114     TopRLEDOffset = FaceLEDPanelOffset+7, //!< top right
00115     TopBrLEDOffset= HeadColorLEDOffset,//!< top bar
00116     TlRedLEDOffset= RrBackColorLEDOffset,//!< red tail light
00117     TlBluLEDOffset= FrBackColorLEDOffset //!< blue tail light
00118   };
00119   
00120   //! Bitmasks for use when specifying combinations of LEDs (see LedEngine ) Note that left/right are robot's point of view
00121   //!@name LED Bitmasks
00122   typedef unsigned int LEDBitMask_t; //!< So you can be clear when you're refering to a LED bitmask
00123   
00124   const LEDBitMask_t HeadColorLEDMask = 1<<(HeadColorLEDOffset-LEDOffset); //!< mask corresponding to HeadColorLEDOffset
00125   const LEDBitMask_t HeadWhiteLEDMask = 1<<(HeadWhiteLEDOffset-LEDOffset); //!< mask corresponding to HeadWhiteLEDOffset
00126   const LEDBitMask_t ModeRedLEDMask = 1<<(ModeRedLEDOffset-LEDOffset); //!< mask corresponding to ModeRedLEDOffset
00127   const LEDBitMask_t ModeGreenLEDMask = 1<<(ModeGreenLEDOffset-LEDOffset); //!< mask corresponding to ModeGreenLEDOffset
00128   const LEDBitMask_t ModeBlueLEDMask = 1<<(ModeBlueLEDOffset-LEDOffset); //!< mask corresponding to ModeBlueLEDOffset
00129   const LEDBitMask_t WirelessLEDMask = 1<<(WirelessLEDOffset-LEDOffset); //!< mask corresponding to WirelessLEDOffset
00130   const LEDBitMask_t FaceLEDPanelMask = 1<<(FaceLEDPanelOffset-LEDOffset); //!< mask corresponding to FaceLEDPanelOffset, selects only the first of the panel - shift this to get the others
00131   const LEDBitMask_t FrBackColorLEDMask = 1<<(FrBackColorLEDOffset-LEDOffset); //!< mask corresponding to FrBackColorLEDOffset
00132   const LEDBitMask_t FrBackWhiteLEDMask = 1<<(FrBackWhiteLEDOffset-LEDOffset); //!< mask corresponding to FrBackWhiteLEDOffset
00133   const LEDBitMask_t MdBackColorLEDMask = 1<<(MdBackColorLEDOffset-LEDOffset); //!< mask corresponding to MdBackColorLEDOffset
00134   const LEDBitMask_t MdBackWhiteLEDMask = 1<<(MdBackWhiteLEDOffset-LEDOffset); //!< mask corresponding to MdBackWhiteLEDOffset
00135   const LEDBitMask_t RrBackColorLEDMask = 1<<(RrBackColorLEDOffset-LEDOffset); //!< mask corresponding to RrBackColorLEDOffset
00136   const LEDBitMask_t RrBackWhiteLEDMask = 1<<(RrBackWhiteLEDOffset-LEDOffset); //!< mask corresponding to RrBackWhiteLEDOffset
00137   const LEDBitMask_t LEDABModeMask = 1<<(LEDABModeOffset-LEDOffset); //!< mask corresponding to LEDABModeOffset
00138 
00139   const LEDBitMask_t BotLLEDMask = 1<<(BotLLEDOffset-LEDOffset); //!< bottom left
00140   const LEDBitMask_t BotRLEDMask = 1<<(BotRLEDOffset-LEDOffset); //!< bottom right
00141   const LEDBitMask_t MidLLEDMask = 1<<(MidLLEDOffset-LEDOffset); //!< middle left
00142   const LEDBitMask_t MidRLEDMask = 1<<(MidRLEDOffset-LEDOffset); //!< middle right
00143   const LEDBitMask_t TopLLEDMask = 1<<(TopLLEDOffset-LEDOffset); //!< top left
00144   const LEDBitMask_t TopRLEDMask = 1<<(TopRLEDOffset-LEDOffset); //!< top right
00145   const LEDBitMask_t TopBrLEDMask= 1<<(TopBrLEDOffset-LEDOffset); //!< top bar
00146   const LEDBitMask_t TlRedLEDMask= 1<<(TlRedLEDOffset-LEDOffset); //!< red tail light
00147   const LEDBitMask_t TlBluLEDMask= 1<<(TlBluLEDOffset-LEDOffset); //!< blue tail light
00148 
00149   const LEDBitMask_t FaceLEDMask = (FaceLEDPanelMask<<0)|(FaceLEDPanelMask<<1)|(FaceLEDPanelMask<<2)|(FaceLEDPanelMask<<3)|(FaceLEDPanelMask<<4)|(FaceLEDPanelMask<<5)|(FaceLEDPanelMask<<6)|(FaceLEDPanelMask<<7)|(FaceLEDPanelMask<<8)|(FaceLEDPanelMask<<9)|(FaceLEDPanelMask<<10)|(FaceLEDPanelMask<<11)|(FaceLEDPanelMask<<12)|(FaceLEDPanelMask<<13); //!< LEDs for the face panel
00150   const LEDBitMask_t HeadLEDMask = FaceLEDMask|HeadColorLEDMask|HeadWhiteLEDMask|ModeRedLEDMask|ModeGreenLEDMask|ModeBlueLEDMask|WirelessLEDMask; //!< LEDs for face (all but back lights)
00151   const LEDBitMask_t BackLEDMask = FrBackColorLEDMask|FrBackWhiteLEDMask|MdBackColorLEDMask|MdBackWhiteLEDMask|RrBackColorLEDMask|RrBackWhiteLEDMask; //!< LEDS on the back
00152   const LEDBitMask_t TailLEDMask = 0; //!< LEDs on tail (ERS-7 has none)
00153   const LEDBitMask_t AllLEDMask  = ~0; //!< selects all of the leds
00154   //@}
00155 
00156 
00157   // *******************************
00158   //          INPUT OFFSETS
00159   // *******************************
00160 
00161 
00162   //! The order in which inputs should be stored
00163   //!@name Input Offsets
00164 
00165   //! holds offsets to different buttons in WorldState::buttons[]
00166   /*! Should be a straight mapping to the ButtonSourceIDs
00167    *
00168    *  Note that the chest (power) button is not a normal button.  It kills
00169    *  power to the motors at a hardware level, and isn't sensed in the
00170    *  normal way.  If you want to know when it is pressed (and you are
00171    *  about to shut down) see PowerSourceID::PauseSID.
00172    *
00173    *  @see WorldState::buttons @see ButtonSourceID_t */
00174   enum ButtonOffset_t {
00175     LFrPawOffset = LFrLegOrder,
00176     RFrPawOffset = RFrLegOrder,
00177     LBkPawOffset = LBkLegOrder,
00178     RBkPawOffset = RBkLegOrder,
00179     ChinButOffset= 4,
00180     HeadButOffset,
00181     FrontBackButOffset,
00182     MiddleBackButOffset,
00183     RearBackButOffset,
00184     WirelessSwOffset
00185   };
00186 
00187   //! holds offset to different sensor values in WorldState::sensors[]
00188   /*! @see WorldState::sensors[] */
00189   enum SensorOffset_t {
00190     NearIRDistOffset = 0,  //!< in millimeters
00191     FarIRDistOffset,  //!< in millimeters
00192     ChestIRDistOffset,  //!< in millimeters
00193     BAccelOffset, //!< backward acceleration, in @f$m/s^2@f$, negative if sitting on butt (positive for faceplant)
00194     LAccelOffset, //!< acceleration to the robot's left, in @f$m/s^2@f$, negative if lying on robot's left side
00195     DAccelOffset, //!< downward acceleration, in @f$m/s^2@f$, negative if standing up... be careful about the signs on all of these...
00196     PowerRemainOffset, //!< percentage, 0-1
00197     PowerThermoOffset, //!<  degrees Celcius
00198     PowerCapacityOffset, //!< milli-amp hours
00199     PowerVoltageOffset, //!< volts
00200     PowerCurrentOffset //!< milli-amp negative values (maybe positive while charging?)
00201   };
00202 
00203   //@}
00204 
00205 
00206   //! The length of the strings used for each of the outputs in outputNames (doesn't include null term)
00207   const unsigned outputNameLen = 9;
00208   //! A name of uniform length for referring to joints - handy for posture files, etc.
00209   const char* const outputNames[NumOutputs] = {
00210     "LFr:rotor",
00211     "LFr:elvtr",
00212     "LFr:knee~",
00213     "RFr:rotor",
00214     "RFr:elvtr",
00215     "RFr:knee~",
00216     "LBk:rotor",
00217     "LBk:elvtr",
00218     "LBk:knee~",
00219     "RBk:rotor",
00220     "RBk:elvtr",
00221     "RBk:knee~",
00222     
00223     "NECK:tilt",
00224     "NECK:pan~",
00225     "NECK:nod~",
00226     
00227     "TAIL:tilt",
00228     "TAIL:pan~",
00229     
00230     "MOUTH~~~~",
00231     
00232     "LED:headC",
00233     "LED:headW",
00234     "LED:modeR",
00235     "LED:modeG",
00236     "LED:modeB",
00237     "LED:wless",
00238     "LED:faceA",
00239     "LED:faceB",
00240     "LED:faceC",
00241     "LED:faceD",
00242     "LED:faceE",
00243     "LED:faceF",
00244     "LED:faceG",
00245     "LED:faceH",
00246     "LED:faceI",
00247     "LED:faceJ",
00248     "LED:faceK",
00249     "LED:faceL",
00250     "LED:faceM",
00251     "LED:faceN",
00252     "LED:bkFrC",
00253     "LED:bkFrW",
00254     "LED:bkMdC",
00255     "LED:bkMdW",
00256     "LED:bkRrC",
00257     "LED:bkRrW",
00258     "LED:ABmod",
00259     
00260     "EAR:left~",
00261     "EAR:right"
00262   };
00263   
00264 
00265   //! the joint identifier strings used to refer to specific joints in OPEN-R (but not needed for others)
00266   /*!@showinitializer 
00267    * @warning IMPORTANT!!!!  DO NOT CHANGE THE ORDER OF ITEMS IN THIS TABLE!!!\n
00268    *
00269    * The offset consts defined in this file correspond to this table and will make life easier
00270    * if you feel the need to reorder things, but they aren't used perfect @e everywhere \n
00271    * In particular, assumptions are made that the pid joints will be in slots 0-numPIDJoints
00272    * and that the fast outputs (ie NOT ears) will be in slots 0-NumFastOutputs\n
00273    * There may be other assumptions not noted here!!!
00274    * @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*/
00275   const char* const PrimitiveName [NumOutputs] = {
00276     "PRM:/r2/c1-Joint2:21",       //!< the left front leg   the rotator
00277     "PRM:/r2/c1/c2-Joint2:22",    //!< the left front leg   the elevator 
00278     "PRM:/r2/c1/c2/c3-Joint2:23", //!< the left front leg   the knee 
00279     "PRM:/r4/c1-Joint2:41",       //!< the right front leg   the rotator
00280     "PRM:/r4/c1/c2-Joint2:42",    //!< the right front leg    the elevator 
00281     "PRM:/r4/c1/c2/c3-Joint2:43", //!< the right front leg   the knee 
00282         
00283     "PRM:/r3/c1-Joint2:31",       //!< the left hind leg   the rotator
00284     "PRM:/r3/c1/c2-Joint2:32",    //!< the left hind leg   the elevator 
00285     "PRM:/r3/c1/c2/c3-Joint2:33", //!< the left hind leg   the knee
00286     "PRM:/r5/c1-Joint2:51",       //!< the right hind leg   the rotator
00287     "PRM:/r5/c1/c2-Joint2:52",    //!< the right hind leg   the elevator 
00288     "PRM:/r5/c1/c2/c3-Joint2:53", //!< the right hind leg   the knee 
00289       
00290     "PRM:/r1/c1-Joint2:11",       //!< the lower neck tilt (12)
00291     "PRM:/r1/c1/c2-Joint2:12",    //!< the neck pan 
00292     "PRM:/r1/c1/c2/c3-Joint2:13", //!< the upper neck tilt (nod)
00293         
00294     "PRM:/r6/c1-Joint2:61",       //!< the tail tilt
00295     "PRM:/r6/c2-Joint2:62",       //!< the tail rotate
00296         
00297     "PRM:/r1/c1/c2/c3/c4-Joint2:14", //!< the mouth (17)
00298         
00299     "PRM:/r1/c1/c2/c3/l1-LED2:l1", //!< Head light (color) (x6, 18)
00300     "PRM:/r1/c1/c2/c3/l2-LED2:l2", //!< Head light (white)
00301     "PRM:/r1/c1/c2/c3/l3-LED2:l3", //!< Red mode indicator
00302     "PRM:/r1/c1/c2/c3/l4-LED2:l4", //!< Green mode indicator
00303     "PRM:/r1/c1/c2/c3/l5-LED2:l5", //!< Blue mode indicator
00304     "PRM:/r1/c1/c2/c3/l6-LED2:l6", //!< wireless light
00305     
00306     "PRM:/r1/c1/c2/c3/la-LED3:la", //!< face lights... (x14, 24-37)
00307     "PRM:/r1/c1/c2/c3/lb-LED3:lb",    
00308     "PRM:/r1/c1/c2/c3/lc-LED3:lc", 
00309     "PRM:/r1/c1/c2/c3/ld-LED3:ld", 
00310     "PRM:/r1/c1/c2/c3/le-LED3:le",    
00311     "PRM:/r1/c1/c2/c3/lf-LED3:lf", 
00312     "PRM:/r1/c1/c2/c3/lg-LED3:lg", 
00313     "PRM:/r1/c1/c2/c3/lh-LED3:lh", 
00314     "PRM:/r1/c1/c2/c3/li-LED3:li", 
00315     "PRM:/r1/c1/c2/c3/lj-LED3:lj", 
00316     "PRM:/r1/c1/c2/c3/lk-LED3:lk", 
00317     "PRM:/r1/c1/c2/c3/ll-LED3:ll", 
00318     "PRM:/r1/c1/c2/c3/lm-LED3:lm", 
00319     "PRM:/r1/c1/c2/c3/ln-LED3:ln", //!< ...last face light (37)
00320 
00321     "PRM:/lu-LED3:lu", //!< front back light (color) (x6, 38)
00322     "PRM:/lv-LED3:lv", //!< front back light (white)
00323     "PRM:/lw-LED3:lw", //!< middle back light (color)
00324     "PRM:/lx-LED3:lx", //!< middle back light (white)
00325     "PRM:/ly-LED3:ly", //!< rear back light (color)
00326     "PRM:/lz-LED3:lz", //!< rear back light (white)
00327     "",  //!< the virtual mode A/B switcher
00328       
00329     "PRM:/r1/c1/c2/c3/e5-Joint4:15", //!< left ear (44)
00330     "PRM:/r1/c1/c2/c3/e6-Joint4:16" //!< right ear
00331   };
00332 
00333   //! use to open speaker connection with the system
00334   const char* const SpeakerLocator="PRM:/s1-Speaker:S1";
00335 
00336   //! use to open camera connection with the system
00337   const char* const CameraLocator="PRM:/r1/c1/c2/c3/i1-FbkImageSensor:F1";
00338 
00339   //! This table holds the default PID values for each joint.  see PIDMC
00340   const float DefaultPIDs[NumPIDJoints][3] =
00341     {
00342       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00343       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00344       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00345       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00346       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00347       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00348       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00349       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00350       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00351       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00352       { 0x14/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00353       { 0x1C/(double)(1<<(16-0xE)), 0x08/(double)(1<<(16-0x2)), 0x01/(double)(1<<(16-0xF)) },
00354 
00355       { 0x0A/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x02/(double)(1<<(16-0xF)) },
00356       { 0x08/(double)(1<<(16-0xE)), 0x02/(double)(1<<(16-0x2)), 0x04/(double)(1<<(16-0xF)) },
00357       { 0x08/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x02/(double)(1<<(16-0xF)) },
00358 
00359       { 0x0A/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x04/(double)(1<<(16-0xF)) },
00360       { 0x0A/(double)(1<<(16-0xE)), 0x04/(double)(1<<(16-0x2)), 0x04/(double)(1<<(16-0xF)) },
00361 
00362       { 0x08/(double)(1<<(16-0xE)), 0x00/(double)(1<<(16-0x2)), 0x04/(double)(1<<(16-0xF)) }
00363     };
00364     
00365   //! These will control the shift values given to the system.  see PIDMC
00366   /*! These are modified from the default values to give better range of values to the gains */
00367   const unsigned char DefaultPIDShifts[3] = {0x0E, 0x02-1, 0x0F-3};
00368     
00369   //!These values are Sony's recommended maximum joint velocities, in rad/ms
00370   /*! a value <= 0 means infinite speed (e.g. LEDs)
00371    *  
00372    *  These limits are <b>not</b> enforced by the framework.  They are simply available for you to use as you see fit.
00373    *  HeadPointerMC is (as of v1.6) the only included MotionCommand to actually use these values.
00374    *  
00375    *  This is disabled for the ERS-7 until Sony gives us values to use */
00376   const float MaxOutputSpeed[NumOutputs] = {
00377     0,     //Legs LR,FB,REK
00378     0,
00379     0,
00380     0,
00381     0,
00382     0,
00383     0,
00384     0,
00385     0,
00386     0,
00387     0,
00388     0,
00389   
00390     0,     //Head TPR
00391     0,
00392     0,
00393   
00394     0,     //Tail
00395     0,
00396   
00397     0,     //Mouth
00398     
00399     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //LEDs
00400     
00401     0,0                //Ears
00402   };
00403 
00404   #ifndef RAD
00405     //!Just a little macro for converting degrees to radians
00406   #define RAD(deg) (((deg) * M_PI ) / 180.0)
00407     //!a flag so we undef these after we're done - do you have a cleaner solution?
00408   #define __RI_RAD_FLAG
00409   #endif
00410   
00411   //! Defines the indexes to use to access the min and max entries of ERS7Info::outputRanges and ERS7Info::mechanicalLimits
00412   enum MinMaxRange_t { MinRange,MaxRange };
00413 
00414   //! This table holds the software limits of each of the outputs
00415   const double outputRanges[NumOutputs][2] =
00416     {
00417       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //left front REK
00418       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //right front REK
00419       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //left back REK
00420       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //right back REK
00421 
00422       { RAD(-75),RAD(0) },{ RAD(-88),RAD(88) },{ RAD(-15),RAD(45) }, //neck Tilt-pan-nod
00423         
00424       { RAD(5),RAD(60) },{ RAD(-45),RAD(45) }, // tail tp
00425 
00426       { RAD(-55),RAD(-3) }, //mouth
00427 
00428       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //misc LEDs
00429       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //Face LEDs
00430       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //back LEDs
00431       {0,1}, //virtual mode A/B switcher
00432     
00433       {0,1},{0,1} //ears
00434     };
00435 
00436   //! This table holds the mechanical limits of each of the outputs @todo same as outputLimits right now, don't know actual values yet
00437   const double mechanicalLimits[NumOutputs][2] =
00438     {
00439       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //left front REK
00440       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //right front REK
00441       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //left back REK
00442       { RAD(-115),RAD(130) },{ RAD(-10),RAD(88) },{ RAD(-25),RAD(122) }, //right back REK
00443 
00444       { RAD(-75),RAD(0) },{ RAD(-88),RAD(88) },{ RAD(-15),RAD(45) }, //neck Tilt-pan-nod
00445         
00446       { RAD(5),RAD(60) },{ RAD(-45),RAD(45) }, // tail tp
00447 
00448       { RAD(-55),RAD(-3) }, //mouth
00449 
00450       {0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1}, //LEDs
00451     
00452       {0,1},{0,1} //ears
00453     };
00454 
00455 #ifdef __RI_RAD_FLAG
00456 #undef RAD
00457 #undef __RI_RAD_FLAG
00458 #endif
00459 
00460 
00461   /*! @name CPC IDs
00462    * values defined by OPEN-R, used to interface with lower level OPEN-R code to read sensors - DOESN'T correspond to ERS7Info::PrimitiveName */
00463   static const int CPCJointMouth      =  0; //!< Mouth                           
00464   static const int CPCSwitchChin      =  1; //!< Chin sensor                     
00465   static const int CPCJointNeckNod    =  2; //!< Neck tilt2                      
00466   static const int CPCSensorHead      =  3; //!< Head sensor                     
00467   static const int CPCSensorNearPSD   =  4; //!< Head distance sensor(near)      
00468   static const int CPCSensorFarPSD    =  5; //!< Head distance sensor(far)       
00469   static const int CPCJointNeckPan    =  6; //!< Neck pan                        
00470   static const int CPCJointNeckTilt   =  7; //!< Neck tilt1                      
00471   static const int CPCSwitchLFPaw     =  8; //!< Left fore leg  paw sensor       
00472   static const int CPCJointLFKnee     =  9; //!< Left fore legJ3                 
00473   static const int CPCJointLFElevator = 10; //!< Left fore legJ2                 
00474   static const int CPCJointLFRotator  = 11; //!< Left fore legJ1                 
00475   static const int CPCSwitchLHPaw     = 12; //!< Left hind leg  paw sensor       
00476   static const int CPCJointLHKnee     = 13; //!< Left hind legJ3                 
00477   static const int CPCJointLHElevator = 14; //!< Left hind legJ2                 
00478   static const int CPCJointLHRotator  = 15; //!< Left hind legJ1                 
00479   static const int CPCSwitchRFPaw     = 16; //!< Right fore leg  paw sensor      
00480   static const int CPCJointRFKnee     = 17; //!< Right fore legJ3                
00481   static const int CPCJointRFElevator = 18; //!< Right fore legJ2                
00482   static const int CPCJointRFRotator  = 19; //!< Right fore legJ1                
00483   static const int CPCSwitchRHPaw     = 20; //!< Right hind leg  paw sensor      
00484   static const int CPCJointRHKnee     = 21; //!< Right hind legJ3                
00485   static const int CPCJointRHElevator = 22; //!< Right hind legJ2                
00486   static const int CPCJointRHRotator  = 23; //!< Right hind legJ1                
00487   static const int CPCJointTailTilt   = 24; //!< Tail tilt                       
00488   static const int CPCJointTailPan    = 25; //!< Tail pan                        
00489   static const int CPCSensorAccelFB   = 26; //!< Acceleration sensor(front-back) 
00490   static const int CPCSensorAccelLR   = 27; //!< Acceleration sensor(right-left) 
00491   static const int CPCSensorAccelUD   = 28; //!< Acceleration sensor(up-down)    
00492   static const int CPCSensorChestPSD  = 29; //!< Chest distance sensor           
00493   static const int CPCSwitchWireless  = 30; //!< Wireless LAN switch             
00494   static const int CPCSensorBackRear  = 31; //!< Back sensor(rear)               
00495   static const int CPCSensorBackMiddle= 32; //!< Back sensor(middle)             
00496   static const int CPCSensorBackFront = 33; //!< Back sensor(front)              
00497   //@}
00498 
00499 }
00500   
00501 /*! @file
00502  * @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
00503  * @author ejt (Creator)
00504  *
00505  * $Author: ejt $
00506  * $Name: tekkotsu-2_1 $
00507  * $Revision: 1.9 $
00508  * $State: Exp $
00509  * $Date: 2004/02/09 22:45:28 $
00510  */
00511 
00512 #endif

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