00001
00002 #ifndef INCLUDED_HandEyeZInfo_h
00003 #define INCLUDED_HandEyeZInfo_h
00004
00005 #include <cmath>
00006 #include <stdlib.h>
00007 #include "CommonInfo.h"
00008 using namespace RobotInfo;
00009
00010
00011 #if defined(TGT_HANDEYEZ)
00012 # define TGT_IS_BIOLOID
00013 # define TGT_IS_HANDEYEZ
00014 # define TGT_HAS_CAMERA 1
00015
00016 # define TGT_HAS_LEDS 5
00017 # define TGT_HAS_ARMS 1
00018 # define TGT_HAS_HEAD 1
00019 # define WALKMC_NO_WARN_NOOP
00020 #endif
00021
00022
00023 namespace HandEyeZInfo {
00024
00025
00026
00027
00028
00029 extern const char* const TargetName;
00030
00031 const unsigned int FrameTime=32;
00032 const unsigned int NumFrames=1;
00033 const unsigned int SoundBufferTime=32;
00034
00035
00036 const unsigned NumWheels = 0;
00037
00038 const unsigned JointsPerArm = 5;
00039 const unsigned NumArms = 1;
00040 const unsigned NumArmJoints = JointsPerArm*NumArms;
00041
00042 const unsigned JointsPerLeg = 0;
00043 const unsigned NumLegs = 0;
00044 const unsigned NumLegJoints = JointsPerLeg*NumLegs;
00045 const unsigned NumHeadJoints = 2;
00046 const unsigned NumTailJoints = 0;
00047 const unsigned NumMouthJoints = 0;
00048 const unsigned NumEarJoints = 0;
00049 const unsigned NumButtons = 3;
00050 const unsigned NumSensors = 2;
00051 const unsigned NumFacePanelLEDs = 0;
00052
00053
00054 const unsigned NumLEDs = 7;
00055 const unsigned NumPIDJoints = NumWheels + NumArmJoints + NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints;;
00056
00057 const unsigned NumOutputs = NumWheels + NumPIDJoints + NumLEDs;
00058 const unsigned NumReferenceFrames = NumOutputs + 1 + NumArms + 1;
00059
00060 using namespace Camera75DOF;
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 const unsigned PIDJointOffset = 0;
00073
00074 const unsigned ArmOffset = PIDJointOffset;
00075
00076 const unsigned HeadOffset = ArmOffset+NumArmJoints;
00077
00078 const unsigned LEDOffset = PIDJointOffset + NumPIDJoints;
00079
00080 const unsigned BaseFrameOffset = NumOutputs;
00081 const unsigned GripperFrameOffset = BaseFrameOffset+1;
00082 const unsigned CameraFrameOffset = GripperFrameOffset+NumArms;
00083
00084
00085 enum ArmOffset_t {
00086 ArmShoulderOffset = ArmOffset,
00087 ArmElbowOffset,
00088 WristOffset,
00089 WristYawOffset = WristOffset,
00090 LeftGripperOffset,
00091 RightGripperOffset,
00092
00093
00094 };
00095
00096
00097 enum TPROffset_t {
00098 PanOffset = 0,
00099 TiltOffset,
00100 };
00101
00102
00103 enum HeadOffset_t {
00104 HeadPanOffset = HeadOffset,
00105 HeadTiltOffset,
00106 };
00107
00108
00109
00110 enum LEDOffset_t {
00111 ArmShoulderLEDOffset = LEDOffset,
00112 ArmElbowLEDOffset,
00113 ArmWristLEDOffset,
00114 ArmLeftGripperLEDOffset,
00115 ArmRightGripperLEDOffset,
00116 NeckPanLEDOffset,
00117 NeckTiltLEDOffset
00118 };
00119
00120 typedef unsigned int LEDBitMask_t;
00121 const LEDBitMask_t ArmShoulderLEDMask = 1 << (ArmShoulderLEDOffset-LEDOffset);
00122 const LEDBitMask_t ArmElbowLEDMask = 1 << (ArmElbowLEDOffset-LEDOffset);
00123 const LEDBitMask_t ArmWristLEDMask = 1 << (ArmWristLEDOffset-LEDOffset);
00124 const LEDBitMask_t ArmLeftGripperLEDMask = 1 << (ArmLeftGripperLEDOffset-LEDOffset);
00125 const LEDBitMask_t ArmRightGripperLEDMask = 1 << (ArmRightGripperLEDOffset-LEDOffset);
00126 const LEDBitMask_t NeckPanLEDMask = 1 << (NeckPanLEDOffset-LEDOffset);
00127 const LEDBitMask_t NeckTiltLEDMask = 1 << (NeckTiltLEDOffset-LEDOffset);
00128
00129
00130 const LEDBitMask_t FaceLEDMask = 0;
00131
00132
00133 const LEDBitMask_t AllLEDMask = (LEDBitMask_t)~0;
00134
00135
00136
00137
00138 const fmat::Column<3> AgentBoundingBoxBaseFrameOffset = fmat::pack(0,0,0);
00139
00140
00141 const fmat::Column<3> AgentBoundingBoxHalfDims = fmat::pack(304.8/2, 304.8/2, 0);
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 enum ButtonOffset_t { GreenButOffset, RedButOffset, YellowButOffset };
00157
00158
00159 const char* const buttonNames[NumButtons+1] = { "GreenBut", "RedBut", "YellowBut", NULL };
00160
00161
00162
00163 enum SensorOffset_t {
00164 PowerThermoOffset,
00165 PowerVoltageOffset,
00166 };
00167
00168
00169 const char* const sensorNames[NumSensors+1] = {
00170 "PowerThermo","PowerVoltage", NULL
00171 };
00172
00173
00174
00175
00176
00177 const char* const outputNames[NumReferenceFrames+1] = {
00178 "ARM:shldr","ARM:elbow","ARM:wristYaw", "Arm:LeftGripper", "ArmRightGripper",
00179 "NECK:pan", "NECK:tilt",
00180
00181 "LED:ARM:shldr",
00182 "LED:ARM:elbow",
00183 "LED:ARM:wrist",
00184 "LED ARM:lgrip",
00185 "LED ARM:rgrip",
00186 "LED:NECK:pan",
00187 "LED:NECK:tilt",
00188
00189
00190
00191 "BaseFrame",
00192 "GripperFrame",
00193 "CameraFrame",
00194 NULL
00195 };
00196
00197
00198 class HandEyeZCapabilities : public Capabilities {
00199 public:
00200
00201 HandEyeZCapabilities()
00202 : Capabilities(TargetName,NumReferenceFrames,outputNames,NumButtons,buttonNames,NumSensors,sensorNames,PIDJointOffset,NumPIDJoints,LEDOffset,NumLEDs,NumOutputs)
00203 {
00204 frameToIndex["ARM:wrist"] = WristYawOffset;
00205 frameToIndex["NECK:nod"] = HeadTiltOffset;
00206 }
00207 };
00208
00209 extern const HandEyeZCapabilities capabilities;
00210
00211
00212
00213
00214 const float DefaultPIDs[NumPIDJoints][5] = {
00215 {32,32,0}, {32,32,0}, {32,32,0}, {32,32,0}, {32,32,0},
00216 {32,32,0}, {32,32,0},
00217 };
00218
00219
00220
00221
00222
00223
00224
00225 const float MaxOutputSpeed[NumOutputs] = {
00226
00227 0,0,0,0,0,0,0,
00228
00229 0,0,0,0,0,
00230 };
00231
00232 #ifndef RAD
00233
00234 #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00235
00236 #define __RI_RAD_FLAG
00237 #endif
00238
00239
00240 const float outputRanges[NumOutputs][2] = {
00241
00242 {RAD(-130),RAD(130)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {-0.5f,0.5f}, {-0.5f,0.5f},
00243 {RAD(-63),RAD(63)}, {RAD(-95),RAD(68)},
00244
00245
00246 {0,1}, {0,1}, {0,1}, {0,1}, {0,1},
00247 {0,1}, {0,1},
00248 };
00249
00250
00251 const float mechanicalLimits[NumOutputs][2] = {
00252
00253 {RAD(-120),RAD(120)}, {RAD(-120),RAD(120)}, {RAD(-120),RAD(120)}, {-0.5f, 0.5f} ,{-0.5f, 0.5f},
00254 {RAD(-150),RAD(150)}, {RAD(-92),RAD(75)},
00255
00256
00257 {0,1}, {0,1}, {0,1}, {0,1}, {0,1},
00258 {0,1}, {0,1},
00259 };
00260
00261 #ifdef __RI_RAD_FLAG
00262 #undef RAD
00263 #undef __RI_RAD_FLAG
00264 #endif
00265 }
00266
00267
00268
00269
00270
00271
00272 #endif