00001
00002 #ifndef INCLUDED_BioloidInfo_h
00003 #define INCLUDED_BioloidInfo_h
00004
00005 #include <cmath>
00006 #include <stdlib.h>
00007 #include "CommonInfo.h"
00008 using namespace RobotInfo;
00009
00010
00011 #if defined(TGT_BIOLOID)
00012 # define TGT_IS_BIOLOID
00013 # define TGT_HAS_WEBCAM 1
00014 # ifdef BIOLOID_BEGINNER_KIT
00015 # define TGT_HAS_LEDS 4
00016 # else
00017 # define TGT_HAS_LEDS 18
00018 # endif
00019 #endif
00020
00021
00022 namespace BioloidInfo {
00023
00024
00025
00026
00027
00028 extern const char* const TargetName;
00029
00030 const unsigned int FrameTime=32;
00031 const unsigned int NumFrames=1;
00032 const unsigned int SoundBufferTime=32;
00033
00034
00035 const unsigned NumWheels = 0;
00036
00037 const unsigned JointsPerArm = 0;
00038 const unsigned NumArms = 0;
00039 const unsigned NumArmJoints = JointsPerArm*NumArms;
00040
00041 const unsigned JointsPerLeg = 0;
00042 const unsigned NumLegs = 0;
00043 const unsigned NumLegJoints = JointsPerLeg*NumLegs;
00044 const unsigned NumHeadJoints = 0;
00045 const unsigned NumTailJoints = 0;
00046 const unsigned NumMouthJoints = 0;
00047 const unsigned NumEarJoints = 0;
00048 const unsigned NumButtons = 0;
00049 const unsigned NumSensors = 2;
00050 const unsigned NumFacePanelLEDs = 0;
00051
00052 #ifdef BIOLOID_BEGINNER_KIT
00053 const unsigned NumLEDs = 4;
00054 const unsigned NumPIDJoints = 4 + NumWheels + NumArmJoints + NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints;;
00055 #else
00056 const unsigned NumLEDs = 18;
00057 const unsigned NumPIDJoints = 18 + NumWheels + NumArmJoints + NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints;;
00058 #endif
00059
00060 const unsigned NumOutputs = NumWheels + NumPIDJoints + NumLEDs;
00061 const unsigned NumReferenceFrames = NumOutputs+1;
00062
00063 using namespace Camera75DOF;
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 const unsigned PIDJointOffset = 0;
00076 const unsigned WheelOffset = PIDJointOffset;
00077
00078 const unsigned LEDOffset = PIDJointOffset + NumPIDJoints;
00079
00080 const unsigned BaseFrameOffset = NumOutputs;
00081
00082 enum WheelOffset_t {
00083 LWheelOffset=WheelOffset,
00084 RWheelOffset
00085 };
00086
00087
00088
00089 enum LEDOffset_t { };
00090
00091 typedef unsigned int LEDBitMask_t;
00092
00093 const LEDBitMask_t FaceLEDMask = 0;
00094
00095 const LEDBitMask_t AllLEDMask = (LEDBitMask_t)~0;
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 enum ButtonOffset_t { };
00118
00119
00120 const char* const buttonNames[NumButtons+1] = { NULL };
00121
00122
00123
00124 enum SensorOffset_t {
00125 PowerThermoOffset,
00126 PowerVoltageOffset,
00127 };
00128
00129
00130 const char* const sensorNames[NumSensors+1] = {
00131 "PowerThermo","PowerVoltage", NULL
00132 };
00133
00134
00135
00136
00137
00138 const char* const outputNames[NumReferenceFrames+1] = {
00139 "SERVO:000",
00140 "SERVO:001",
00141 "SERVO:002",
00142 "SERVO:003",
00143 #ifndef BIOLOID_BEGINNER_KIT
00144 "SERVO:004",
00145 "SERVO:005",
00146 "SERVO:006",
00147 "SERVO:007",
00148 "SERVO:008",
00149 "SERVO:009",
00150 "SERVO:010",
00151 "SERVO:011",
00152 "SERVO:012",
00153 "SERVO:013",
00154 "SERVO:014",
00155 "SERVO:015",
00156 "SERVO:016",
00157 "SERVO:017",
00158 #endif
00159 "LED:00000",
00160 "LED:00001",
00161 "LED:00002",
00162 "LED:00003",
00163 #ifndef BIOLOID_BEGINNER_KIT
00164 "LED:00004",
00165 "LED:00005",
00166 "LED:00006",
00167 "LED:00007",
00168 "LED:00008",
00169 "LED:00009",
00170 "LED:00010",
00171 "LED:00011",
00172 "LED:00012",
00173 "LED:00013",
00174 "LED:00014",
00175 "LED:00015",
00176 "LED:00016",
00177 "LED:00017",
00178 #endif
00179 "BaseFrame",
00180 NULL
00181 };
00182
00183
00184 extern const Capabilities capabilities;
00185
00186
00187 enum ServoParam_t {
00188 DYNAMIXEL_SLOPE=0,
00189 DYNAMIXEL_PUNCH,
00190 DYNAMIXEL_MARGIN
00191 };
00192
00193
00194
00195
00196 const float DefaultPIDs[NumPIDJoints][3] = {
00197 {32,32,0}, {32,32,0}, {32,32,0}, {32,32,0},
00198 #ifndef BIOLOID_BEGINNER_KIT
00199 {32,32,0}, {32,32,0}, {32,32,0}, {32,32,0},
00200 {32,32,0}, {32,32,0}, {32,32,0}, {32,32,0},
00201 {32,32,0}, {32,32,0}, {32,32,0}, {32,32,0},
00202 {32,32,0}, {32,32,0},
00203 #endif
00204 };
00205
00206
00207
00208
00209
00210
00211
00212
00213 const float MaxOutputSpeed[NumOutputs] = {
00214
00215 0,0,0,0,
00216 #ifndef BIOLOID_BEGINNER_KIT
00217 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,
00218 #endif
00219
00220 0,0,0,0,
00221 #ifndef BIOLOID_BEGINNER_KIT
00222 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,
00223 #endif
00224 };
00225
00226 #ifndef RAD
00227
00228 #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00229
00230 #define __RI_RAD_FLAG
00231 #endif
00232
00233
00234 const float outputRanges[NumOutputs][2] = {
00235
00236 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00237 #ifndef BIOLOID_BEGINNER_KIT
00238 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00239 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00240 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00241 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00242 #endif
00243
00244
00245 {0,1}, {0,1}, {0,1}, {0,1},
00246 #ifndef BIOLOID_BEGINNER_KIT
00247 {0,1}, {0,1}, {0,1}, {0,1},
00248 {0,1}, {0,1}, {0,1}, {0,1},
00249 {0,1}, {0,1}, {0,1}, {0,1},
00250 {0,1}, {0,1},
00251 #endif
00252 };
00253
00254
00255
00256 const float mechanicalLimits[NumOutputs][2] = {
00257
00258 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00259 #ifndef BIOLOID_BEGINNER_KIT
00260 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00261 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00262 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00263 {RAD(-150),RAD(150)}, {RAD(-150),RAD(150)},
00264 #endif
00265
00266
00267 {0,1}, {0,1}, {0,1}, {0,1},
00268 #ifndef BIOLOID_BEGINNER_KIT
00269 {0,1}, {0,1}, {0,1}, {0,1},
00270 {0,1}, {0,1}, {0,1}, {0,1},
00271 {0,1}, {0,1}, {0,1}, {0,1},
00272 {0,1}, {0,1},
00273 #endif
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