Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LynxArm6Info.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_LynxArm6Info_h
00003 #define INCLUDED_LynxArm6Info_h
00004 
00005 #include <cmath>
00006 #include <cstdlib>
00007 #include "CommonInfo.h"
00008 using namespace RobotInfo;
00009 
00010 // see http://tekkotsu.org/porting.html#configuration for more information on TGT_HAS_* flags
00011 #if defined(TGT_LYNXARM6)
00012 #  define TGT_HAS_ARMS 1
00013 #endif
00014 
00015 namespace LynxArm6Info {
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=32;        //!< time between frames in the motion system (milliseconds)
00024   const unsigned int NumFrames=1;        //!< the number of frames per buffer (don't forget also double buffered)
00025   const unsigned int SoundBufferTime=32; //!< the number of milliseconds per sound buffer... I'm not sure if this can be changed
00026   
00027   //!@name Output Types Information
00028   const unsigned NumWheels = 0; //!< no wheels, just legs
00029   
00030   const unsigned JointsPerArm   =  6;
00031   const unsigned NumArms        =  1;
00032   const unsigned NumArmJoints   =  JointsPerArm*NumArms;
00033   
00034   const unsigned JointsPerLeg   =  0; //!< The number of joints per leg
00035   const unsigned NumLegs        =  0; //!< The number of legs
00036   const unsigned NumLegJoints   =  JointsPerLeg*NumLegs; //!< the TOTAL number of joints on ALL legs
00037   const unsigned NumHeadJoints  =  0; //!< The number of joints in the neck
00038   const unsigned NumTailJoints  =  0; //!< The number of joints assigned to the tail
00039   const unsigned NumMouthJoints =  0; //!< the number of joints that control the mouth
00040   const unsigned NumEarJoints   =  0; //!< The number of joints which control the ears (NOT per ear, is total)
00041   const unsigned NumButtons     =  0; //!< the number of buttons that are available, 2 head, 4 paws, 3 back, 1 underbelly see ERS7Info::ButtonOffset_t
00042   const unsigned NumSensors     =  4;  //!< the four input pins
00043   const unsigned NumLEDs        =  0; //!< The number of LEDs which can be controlled
00044   const unsigned NumFacePanelLEDs = 0; //!< The number of face panel LEDs
00045   
00046   const unsigned NumPIDJoints   = NumArmJoints + NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints; //!< The number of joints which use PID motion - everything except ears
00047   const unsigned NumOutputs     = NumPIDJoints + NumLEDs; //!< the total number of outputs
00048   const unsigned NumReferenceFrames = NumOutputs + 1 + NumArms + 1; //!< for the base, gripper (* NumArms), and camera reference frames
00049 
00050   // webcam ?
00051   const float CameraHorizFOV=56.9/180*M_PI; //!< horizontal field of view (radians)
00052   const float CameraVertFOV=45.2/180*M_PI; //!< vertical field of view (radians)
00053   const float CameraFOV=CameraHorizFOV; //!< should be set to maximum of #CameraHorizFOV or #CameraVertFOV
00054   const unsigned int CameraResolutionX=320; //!< the number of pixels available in the 'full' layer
00055   const unsigned int CameraResolutionY=240; //!< the number of pixels available in the 'full' layer
00056   //@}
00057 
00058 
00059   // *******************************
00060   //         OUTPUT OFFSETS
00061   // *******************************
00062 
00063   //!Corresponds to entries in ERS7Info::PrimitiveName, defined at the end of this file
00064   //!@name Output Offsets
00065 
00066   const unsigned PIDJointOffset = 0; //!< The beginning of the PID Joints
00067   const unsigned ArmOffset   = PIDJointOffset;
00068 
00069   const unsigned BaseFrameOffset   = NumOutputs; //!< Use with kinematics to refer to base reference frame
00070   const unsigned GripperFrameOffset    = BaseFrameOffset+1; //!< Use with kinematics to refer to paw reference frames
00071 
00072   //! 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
00073   /*! @hideinitializer */
00074   enum LEDOffset_t { };
00075   
00076   typedef unsigned int LEDBitMask_t; //!< So you can be clear when you're refering to a LED bitmask
00077   //! LEDs for the face panel (all FaceLEDPanelMask<<(0:NumFacePanelLEDs-1) entries)
00078   const LEDBitMask_t FaceLEDMask = 0;
00079   //! selects all of the leds
00080   const LEDBitMask_t AllLEDMask  = (LEDBitMask_t)~0;
00081   //@}
00082 
00083 
00084   // *******************************
00085   //          INPUT OFFSETS
00086   // *******************************
00087 
00088 
00089   //! The order in which inputs should be stored
00090   //!@name Input Offsets
00091 
00092   //! holds offsets to different buttons in WorldState::buttons[]
00093   /*! Should be a straight mapping to the ButtonSourceIDs
00094    *
00095    *  Note that the chest (power) button is not a normal button.  It kills
00096    *  power to the motors at a hardware level, and isn't sensed in the
00097    *  normal way.  If you want to know when it is pressed (and you are
00098    *  about to shut down) see PowerSrcID::PauseSID.
00099    *
00100    *  @see WorldState::buttons @see ButtonSourceID_t
00101    * @hideinitializer */
00102   enum ButtonOffset_t { };
00103 
00104   //! Provides a string name for each button
00105   const char* const buttonNames[NumButtons+1] = { NULL }; // plus one and NULL entry to workaround gcc 3.4.2 internal error
00106 
00107   //! holds offset to different sensor values in WorldState::sensors[]
00108   /*! @see WorldState::sensors[] */
00109   enum SensorOffset_t { SensorAOffset, SensorBOffset, SensorCOffset, SensorDOffset };
00110 
00111   //! Provides a string name for each sensor
00112   const char* const sensorNames[NumSensors] = { "SensorA", "SensorB", "SensorC", "SensorD" };
00113 
00114   //@}
00115 
00116 
00117   //! Names for each of the outputs
00118   const char* const outputNames[NumOutputs] = {
00119     "Shldr:rot","Shldr:elv","Elbow",
00120     "Wrist:rot","Wrist:elv","Gripper"
00121   };
00122   
00123   //! allocation declared in RobotInfo.cc
00124   extern Capabilities capabilities;
00125   
00126   //! This table holds the default PID values for each joint.  see PIDMC
00127   const float DefaultPIDs[NumPIDJoints][3] = {
00128     {1,0,0}, {1,0,0}, {1,0,0},
00129     {1,0,0}, {1,0,0}, {1,0,0},
00130   };
00131     
00132   //!These values are Sony's recommended maximum joint velocities, in rad/ms
00133   /*! a value <= 0 means infinite speed (e.g. LEDs)
00134    *  
00135    *  These limits are <b>not</b> enforced by the framework.  They are simply available for you to use as you see fit.
00136    *  HeadPointerMC and PostureMC are primary examples of included classes which do respect these values (although they can be overridden)
00137    *  
00138    *  These values were obtained from the administrators of the Sony OPEN-R BBS */
00139   const float MaxOutputSpeed[NumOutputs] = {
00140     4.86510529e-3, //Legs LR,FB,REK
00141     5.27962099e-3,
00142     5.27962099e-3,
00143     4.86510529e-3,
00144     5.27962099e-3,
00145     5.27962099e-3
00146   };
00147 
00148   #ifndef RAD
00149     //!Just a little macro for converting degrees to radians
00150   #define RAD(deg) (((deg) * M_PI ) / 180.0)
00151     //!a flag so we undef these after we're done - do you have a cleaner solution?
00152   #define __RI_RAD_FLAG
00153   #endif
00154   
00155   //! This table holds the software limits of each of the outputs, first index is the output offset, second index is MinMaxRange_t (i.e. MinRange or MaxRange)
00156   const double outputRanges[NumOutputs][2] =
00157     {
00158       { RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },
00159       { RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },
00160     };
00161 
00162   //! This table holds the mechanical limits of each of the outputs, first index is the output offset, second index is MinMaxRange_t (i.e. MinRange or MaxRange)
00163   /*! Same as #outputRanges */
00164   const double mechanicalLimits[NumOutputs][2] =
00165     {
00166       { RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },
00167       { RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },
00168     };
00169 
00170 #ifdef __RI_RAD_FLAG
00171 #undef RAD
00172 #undef __RI_RAD_FLAG
00173 #endif
00174 }
00175 
00176 #endif

Tekkotsu v4.0
Generated Thu Nov 22 00:54:53 2007 by Doxygen 1.5.4