00001 #ifndef INCLUDED_MantisArmInfo_h
00002 #define INCLUDED_MantisArmInfo_h
00003
00004 #include <cmath>
00005 #include <stdlib.h>
00006 #include "CommonInfo.h"
00007 using namespace RobotInfo;
00008
00009
00010 #if defined(TGT_MANTISARM)
00011 # define TGT_IS_MANTISARM
00012 # define TGT_HAS_ARMS 1
00013 # define TGT_HAS_LEDS 6
00014 #endif
00015
00016
00017 namespace MantisArmInfo {
00018
00019
00020
00021
00022
00023 extern const char* const TargetName;
00024
00025 const unsigned int FrameTime = 32;
00026 const unsigned int NumFrames = 1;
00027 const unsigned int SoundBufferTime = 32;
00028
00029
00030 const unsigned NumWheels = 0;
00031
00032 const unsigned JointsPerArm = 6;
00033 const unsigned NumArms = 1;
00034 const unsigned NumArmJoints = JointsPerArm*NumArms;
00035
00036 const unsigned JointsPerLeg = 0;
00037 const unsigned NumLegs = 0;
00038 const unsigned NumLegJoints = JointsPerLeg*NumLegs;
00039
00040 const unsigned NumHeadJoints = 0;
00041 const unsigned NumTailJoints = 0;
00042 const unsigned NumMouthJoints = 0;
00043 const unsigned NumEarJoints = 0;
00044 const unsigned NumButtons = 3;
00045 const unsigned NumSensors = 0;
00046 const unsigned NumFacePanelLEDs = 0;
00047
00048 const unsigned NumPIDJoints = NumArmJoints + NumLegJoints + NumHeadJoints + NumTailJoints + NumMouthJoints;
00049 const unsigned NumLEDs = NumPIDJoints;
00050
00051 const unsigned NumOutputs = NumWheels + NumPIDJoints + NumLEDs;
00052 const unsigned NumReferenceFrames = NumOutputs + NumLegs + NumArms + 1;
00053
00054 const unsigned FingerJointsPerArm = 0;
00055
00056 using namespace Camera75DOF;
00057
00058 const float BallOfFootRadius = 0;
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 const unsigned PIDJointOffset = 0;
00069 const unsigned ArmOffset = PIDJointOffset;
00070 const unsigned LEDOffset = PIDJointOffset + NumPIDJoints;
00071 const unsigned BaseFrameOffset = NumOutputs;
00072 const unsigned FootFrameOffset = BaseFrameOffset+1;
00073 const unsigned GripperFrameOffset = FootFrameOffset+NumLegs;
00074 const unsigned CameraFrameOffset = GripperFrameOffset+NumArms;
00075
00076 const unsigned LeftIRFrameOffset = CameraFrameOffset+1;
00077 const unsigned CenterIRFrameOffset = LeftIRFrameOffset+1;
00078 const unsigned IRFrameOffset = CenterIRFrameOffset;
00079 const unsigned RightIRFrameOffset = CenterIRFrameOffset+1;
00080
00081
00082
00083 enum ArmOrder_t {
00084 MdArmOrder = 0,
00085 };
00086
00087
00088 enum SEKOffset_t {
00089 SweepOffset = 0,
00090 ElevatorOffset,
00091 Twist1Offset,
00092 ElbowOffset,
00093 Twist2Offset,
00094 WristOffset
00095 };
00096
00097
00098 enum TPROffset_t {
00099 PanOffset = 0,
00100 TiltOffset,
00101 NodOffset = TiltOffset,
00102 RollOffset
00103 };
00104
00105
00106
00107 enum ArmOffset_t {
00108 MdArmOffset = ArmOffset+MdArmOrder*JointsPerArm,
00109 };
00110
00111
00112
00113 enum LEDOffset_t {
00114 ElevatorLEDOffset=LEDOffset,
00115 ShoulderLEDOffset,
00116 Twist1LEDOffset,
00117 ElbowLEDOffset,
00118 Twist2LEDOffset,
00119 WristLEDOffset
00120 };
00121
00122
00123 const LEDOffset_t RedLEDOffset = ElevatorLEDOffset;
00124 const LEDOffset_t YellowLEDOffset = ShoulderLEDOffset;
00125 const LEDOffset_t GreenLEDOffset = ElbowLEDOffset;
00126 const LEDOffset_t BlueLEDOffset = WristLEDOffset;
00127
00128 typedef unsigned int LEDBitMask_t;
00129
00130 const LEDBitMask_t RedLEDMask = 1<<(ElevatorLEDOffset-LEDOffset);
00131 const LEDBitMask_t YellowLEDMask = 1<<(ShoulderLEDOffset-LEDOffset);
00132 const LEDBitMask_t GreenLEDMask = 1<<(ElbowLEDOffset-LEDOffset);
00133 const LEDBitMask_t BlueLEDMask = (1<<(WristLEDOffset-LEDOffset));
00134
00135
00136 const LEDBitMask_t FaceLEDMask = 0;
00137
00138 const LEDBitMask_t AllLEDMask = (LEDBitMask_t)~0;
00139
00140
00141
00142
00143 const fmat::Column<3> AgentBoundingBoxBaseFrameOffset = fmat::pack(400,70,350);
00144
00145
00146 const fmat::Column<3> AgentBoundingBoxHalfDims = fmat::pack(100,100,100);
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 enum ButtonOffset_t { GreenButOffset, RedButOffset, YellowButOffset };
00169
00170
00171 const char* const buttonNames[NumButtons+1] = { "GreenBut", "RedBut", "YellowBut", NULL };
00172
00173
00174
00175 enum SensorOffset_t {};
00176
00177
00178 const char* const sensorNames[NumSensors+1] = {
00179 NULL
00180 };
00181
00182
00183
00184
00185
00186 const char* const outputNames[NumReferenceFrames+1] = {
00187
00188 "elevator", "shoulder", "twist1", "elbow", "twist2", "wrist",
00189
00190
00191 "LED:elevator", "LED:shoulder", "LED:twist1", "LED:elbow", "LED:twist2", "LED:wrist",
00192
00193
00194 "BaseFrame", "FingerFrame",
00195
00196 NULL
00197 };
00198
00199
00200 class MantisArmCapabilities : public Capabilities {
00201 public:
00202
00203 MantisArmCapabilities()
00204 : Capabilities(TargetName,NumReferenceFrames,outputNames,
00205 NumButtons,buttonNames,NumSensors,sensorNames,
00206 PIDJointOffset,NumPIDJoints,LEDOffset,NumLEDs,NumOutputs)
00207 {}
00208 };
00209
00210
00211 extern const MantisArmCapabilities capabilities;
00212
00213
00214
00215 enum ServoParam_t {
00216 DYNAMIXEL_SLOPE = 0,
00217 DYNAMIXEL_PUNCH,
00218 DYNAMIXEL_MARGIN
00219 };
00220
00221
00222 const float DefaultPIDs[NumPIDJoints][3] = {
00223 {10,32,0},
00224 {10,32,0},
00225 {10,32,0},
00226 {10,32,0},
00227 {10,32,0},
00228 {10,32,0}
00229 };
00230
00231
00232
00233 const float MaxOutputSpeed[NumOutputs] = {
00234
00235 1.f, 1.f, 1.f, 1.f, 1.f, 1.f,
00236
00237 0,0,0,0,0,0
00238 };
00239
00240 #ifndef RAD
00241
00242 #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00243
00244 #define __RI_RAD_FLAG
00245 #endif
00246
00247
00248 const float outputRanges[NumOutputs][2] = {
00249
00250 {RAD(-100),RAD(100)},
00251 {RAD(-100),RAD(100)},
00252 {RAD(-100),RAD(100)},
00253 {RAD(-100),RAD(100)},
00254 {RAD(-100),RAD(100)},
00255 {RAD(-100),RAD(100)},
00256
00257
00258 {0,1},{0,1},
00259 {0,1},{0,1},
00260 {0,1},{0,1},
00261 };
00262
00263
00264
00265 const float mechanicalLimits[NumOutputs][2] = {
00266
00267 {RAD(-100),RAD(100)},
00268 {RAD(-100),RAD(100)},
00269 {RAD(-100),RAD(100)},
00270 {RAD(-100),RAD(100)},
00271
00272 {0,1},{0,1},
00273 {0,1},{0,1},
00274 };
00275
00276 #ifdef __RI_RAD_FLAG
00277 #undef RAD
00278 #undef __RI_RAD_FLAG
00279 #endif
00280 }
00281
00282
00283
00284
00285
00286
00287 #endif