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