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

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