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

Tekkotsu v2.2.2
Generated Tue Jan 4 15:43:13 2005 by Doxygen 1.4.0