00001
00002 #ifndef INCLUDED_Regis1Info_h
00003 #define INCLUDED_Regis1Info_h
00004
00005 #include <stdlib.h>
00006 #include <cmath>
00007 #include "CommonInfo.h"
00008 using namespace RobotInfo;
00009
00010
00011 #if defined(TGT_REGIS1)
00012 # define TGT_HAS_WHEELS 2
00013 # define TGT_HAS_ARMS 1
00014 # define TGT_HAS_CAMERA 1
00015 # define TGT_HAS_HEAD 1
00016 #endif
00017
00018
00019 namespace Regis1Info {
00020
00021
00022
00023
00024
00025 extern const char* const TargetName;
00026
00027 const unsigned int FrameTime=15;
00028 const unsigned int NumFrames=1;
00029 const unsigned int SoundBufferTime=32;
00030
00031
00032 const unsigned NumWheels = 2;
00033
00034 const unsigned JointsPerArm = 6;
00035 const unsigned NumArms = 1;
00036 const unsigned NumArmJoints = JointsPerArm*NumArms;
00037
00038 const unsigned JointsPerLeg = 0;
00039 const unsigned NumLegs = 0;
00040 const unsigned NumLegJoints = JointsPerLeg*NumLegs;
00041 const unsigned NumHeadJoints = 4;
00042 const unsigned NumTailJoints = 0;
00043 const unsigned NumMouthJoints = 0;
00044 const unsigned NumEarJoints = 0;
00045 const unsigned NumButtons = 0;
00046 const unsigned NumSensors = 0;
00047 const unsigned NumLEDs = 0;
00048 const unsigned NumFacePanelLEDs = 0;
00049
00050 const unsigned NumPIDJoints = NumWheels+NumArmJoints+NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints;
00051 const unsigned NumBinJoints = NumEarJoints;
00052 const unsigned NumOutputs = NumPIDJoints + NumBinJoints + NumLEDs;
00053 const unsigned NumReferenceFrames = NumOutputs + 1 + NumArms + 1;
00054
00055 using namespace CameraSTX;
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 const unsigned PIDJointOffset = 0;
00067 const unsigned WheelOffset = PIDJointOffset;
00068 const unsigned ArmOffset = WheelOffset+NumWheels;
00069 const unsigned HeadOffset = ArmOffset+NumArmJoints;
00070
00071 const unsigned LEDOffset = PIDJointOffset + NumPIDJoints;
00072 const unsigned BinJointOffset = LEDOffset + NumLEDs;
00073 const unsigned EarOffset = BinJointOffset;
00074
00075 const unsigned BaseFrameOffset = NumOutputs;
00076 const unsigned GripperFrameOffset = BaseFrameOffset+1;
00077 const unsigned CameraFrameOffset = GripperFrameOffset+NumArms;
00078
00079 enum WheelOffset_t {
00080 LWheelOffset=WheelOffset,
00081 RWheelOffset
00082 };
00083
00084
00085 enum HeadOffset_t {
00086 HeadBaseOffset = HeadOffset,
00087 HeadPanOffset = HeadBaseOffset,
00088 HeadShoulderOffset,
00089 HeadElbowOffset,
00090 HeadTiltOffset = HeadElbowOffset,
00091 HeadWristOffset,
00092 HeadNodOffset = HeadWristOffset
00093 };
00094
00095
00096 enum TPROffset_t {
00097 PanOffset = HeadBaseOffset - HeadOffset,
00098 TiltOffset = HeadElbowOffset - HeadOffset,
00099 NodOffset = HeadWristOffset - HeadOffset
00100 };
00101
00102 enum ArmOffset_t {
00103 ArmBaseOffset = ArmOffset,
00104 ArmShoulderOffset,
00105 ArmElbowOffset,
00106 ArmWristOffset,
00107 ArmWristRotateOffset,
00108 ArmGripperOffset
00109 };
00110
00111 enum ArmJoint{
00112 ArmBase,
00113 ArmShoulder,
00114 ArmElbow,
00115 ArmWrist,
00116 ArmWristRotate,
00117 ArmGripper
00118 };
00119
00120 enum ButtonOffset_t { };
00121
00122 const char* const buttonNames[NumButtons + 1] = { NULL };
00123
00124 enum SensorOffset_t { };
00125
00126 const char* const sensorNames[NumSensors + 1] = { NULL };
00127
00128
00129 const char* const outputNames[NumReferenceFrames+1] = {
00130 "WHEEL:L",
00131 "WHEEL:R",
00132 "ARM:base","ARM:shldr","ARM:elbow","ARM:wrist","ARM:wristRot","ARM:gripper",
00133 "GNk:Pan","GNk:Shldr","GNk:Elbow","GNk:Pitch",
00134 "BaseFrame","GripperFrame","CameraFrame",
00135 NULL
00136 };
00137
00138
00139 class Regis1Capabilities : public Capabilities {
00140 public:
00141
00142 Regis1Capabilities()
00143 : Capabilities(TargetName,NumReferenceFrames,outputNames,NumButtons,buttonNames,NumSensors,sensorNames,PIDJointOffset,NumPIDJoints,LEDOffset,NumLEDs,NumOutputs)
00144 {
00145
00146 frameToIndex["NECK:tilt"]=HeadTiltOffset;
00147 frameToIndex["NECK:pan"]=HeadPanOffset;
00148 frameToIndex["NECK:nod"]=HeadNodOffset;
00149 }
00150 };
00151
00152 extern const Regis1Capabilities capabilities;
00153
00154 const float DefaultPIDs[NumPIDJoints][3] = {
00155 {1,0,0},
00156 {1,0,0},
00157 {1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0},
00158 {1,0,0},{1,0,0},{1,0,0},{1,0,0}
00159 };
00160
00161
00162 const float MaxOutputSpeed[NumOutputs] = {
00163 1.f,
00164 1.f,
00165 1.f, 1.f, 1.f, 1.f, 1.f, 1.f,
00166 1.f, 1.f, 1.f, 1.f
00167 };
00168
00169 #ifndef RAD
00170
00171 #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00172
00173 #define __RI_RAD_FLAG
00174 #endif
00175
00176
00177 const float outputRanges[NumOutputs][2] = {
00178 { -1 , 1 },
00179 { -1 , 1 },
00180 { RAD(-90),RAD(90) },{ RAD(-94.45f),RAD(94.45f) },{ RAD(-94.45f),RAD(94.45f) },{ RAD(-94.45f),RAD(94.45f) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },
00181 { RAD(-100),RAD(100) },{ RAD(-190),RAD(10) },{ RAD(-60),RAD(140) },{ RAD(-50),RAD(150) }
00182 };
00183
00184
00185
00186 const float mechanicalLimits[NumOutputs][2] = {
00187 { -1 , 1 },
00188 { -1 , 1 },
00189 { RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },{ RAD(-90),RAD(90) },
00190 { RAD(-100),RAD(100) },{ RAD(-10),RAD(190) },{ RAD(-140),RAD(60) },{ RAD(-150),RAD(50) }
00191 };
00192
00193
00194 #ifdef __RI_RAD_FLAG
00195 #undef RAD
00196 #undef __RI_RAD_FLAG
00197 #endif
00198 }
00199
00200
00201
00202
00203
00204
00205 #endif