00001
00002 #ifndef INCLUDED_QwerkInfo_h
00003 #define INCLUDED_QwerkInfo_h
00004
00005 #include <cmath>
00006 #include <stdlib.h>
00007 #include "CommonInfo.h"
00008 using namespace RobotInfo;
00009
00010
00011 #if defined(TGT_QWERK)
00012 # define TGT_IS_QWERK
00013 # define TGT_HAS_WEBCAM 1
00014 # define TGT_HAS_WHEELS 4
00015 # define TGT_HAS_LEDS 10
00016 #endif
00017
00018
00019 namespace QwerkInfo {
00020
00021
00022
00023
00024
00025 extern const char* const TargetName;
00026
00027 const unsigned int FrameTime=25;
00028 const unsigned int NumFrames=1;
00029 const unsigned int SoundBufferTime=32;
00030
00031
00032 const unsigned NumWheels = 4;
00033
00034 const unsigned JointsPerArm = 0;
00035 const unsigned NumArms = 0;
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 = 0;
00042 const unsigned NumTailJoints = 0;
00043 const unsigned NumMouthJoints = 0;
00044 const unsigned NumEarJoints = 0;
00045 const unsigned NumButtons = 4;
00046 const unsigned NumSensors = 17;
00047 const unsigned NumLEDs = 10;
00048 const unsigned NumFacePanelLEDs = 0;
00049
00050 const unsigned NumPIDJoints = NumWheels + NumArmJoints + NumLegJoints+NumHeadJoints+NumTailJoints+NumMouthJoints;;
00051 const unsigned NumOutputs = NumWheels + 16 + NumLEDs;
00052 const unsigned NumReferenceFrames = NumOutputs + 1 + NumArms;
00053
00054 using namespace CameraGeneric60;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 const unsigned PIDJointOffset = 0;
00067 const unsigned WheelOffset = PIDJointOffset;
00068
00069 const unsigned LEDOffset = PIDJointOffset + NumPIDJoints;
00070
00071 const unsigned BaseFrameOffset = NumOutputs;
00072
00073 enum WheelOffset_t {
00074 LWheelOffset=WheelOffset,
00075 RWheelOffset
00076 };
00077
00078
00079
00080 enum LEDOffset_t { };
00081
00082 typedef unsigned int LEDBitMask_t;
00083
00084 const LEDBitMask_t FaceLEDMask = 0;
00085
00086 const LEDBitMask_t AllLEDMask = (LEDBitMask_t)~0;
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 enum ButtonOffset_t { Button0, Button1, Button2, Button3 };
00109
00110
00111 const char* const buttonNames[NumButtons+1] = { "Button0", "Button1", "Button2", "Button3", NULL };
00112
00113
00114
00115 enum SensorOffset_t { AnalogInValues0, AnalogInValues1,
00116 AnalogInValues2, AnalogInValues3,
00117 AnalogInValues4, AnalogInValues5,
00118 AnalogInValues6, AnalogInValues7,
00119 DigitalInStates0, DigitalInStates1,
00120 DigitalInStates2, DigitalInStates3,
00121 DigitalInStates4, DigitalInStates5,
00122 DigitalInStates6, DigitalInStates7,
00123 BatteryVoltage };
00124
00125
00126 const char* const sensorNames[NumSensors] = {
00127 "analogInValues0",
00128 "analogInValues1",
00129 "analogInValues2",
00130 "analogInValues3",
00131 "analogInValues4",
00132 "analogInValues5",
00133 "analogInValues6",
00134 "analogInValues7",
00135 "digitalInStates0",
00136 "digitalInStates1",
00137 "digitalInStates2",
00138 "digitalInStates3",
00139 "digitalInStates4",
00140 "digitalInStates5",
00141 "digitalInStates6",
00142 "digitalInStates7",
00143 "BatteryVoltage"
00144 };
00145
00146
00147
00148
00149
00150 const char* const outputNames[NumReferenceFrames+1] = {
00151 "WHEEL:000",
00152 "WHEEL:001",
00153 "WHEEL:002",
00154 "WHEEL:003",
00155 "SERVO:000",
00156 "SERVO:001",
00157 "SERVO:002",
00158 "SERVO:003",
00159 "SERVO:004",
00160 "SERVO:005",
00161 "SERVO:006",
00162 "SERVO:007",
00163 "SERVO:008",
00164 "SERVO:009",
00165 "SERVO:010",
00166 "SERVO:011",
00167 "SERVO:012",
00168 "SERVO:013",
00169 "SERVO:014",
00170 "SERVO:015",
00171 "LED:00000",
00172 "LED:00001",
00173 "LED:00002",
00174 "LED:00003",
00175 "LED:00004",
00176 "LED:00005",
00177 "LED:00006",
00178 "LED:00007",
00179 "LED:00008",
00180 "LED:00009",
00181
00182 "BaseFrame",
00183 NULL
00184 };
00185
00186
00187 extern const Capabilities capabilities;
00188
00189
00190 const float DefaultPIDs[NumPIDJoints+1][3] = { {0,0,0} };
00191
00192
00193
00194
00195
00196
00197
00198
00199 const float MaxOutputSpeed[NumOutputs] = {
00200 1.f,
00201 1.f,
00202 3.14f,
00203 6.28f,
00204
00205 0,0,0,0,0,0,0,0,0,0
00206 };
00207
00208 #ifndef RAD
00209
00210 #define RAD(deg) (((deg) * (float)M_PI ) / 180.0f)
00211
00212 #define __RI_RAD_FLAG
00213 #endif
00214
00215
00216 const float outputRanges[NumOutputs][2] =
00217 {
00218 { -1 , 1 },
00219 { -1 , 1 },
00220 { RAD(-90) , RAD(90) },
00221 { RAD(-90) , RAD(90) },
00222
00223
00224 {0,1}, {0,1}, {0,1}, {0,1}, {0,1},
00225 {0,1}, {0,1}, {0,1}, {0,1}, {0,1}
00226 };
00227
00228
00229
00230 const float mechanicalLimits[NumOutputs][2] =
00231 {
00232 { -1 , 1 },
00233 { -1 , 1 },
00234 { RAD(-90) , RAD(90) },
00235 { RAD(-90) , RAD(90) },
00236
00237
00238 {0,1}, {0,1}, {0,1}, {0,1}, {0,1},
00239 {0,1}, {0,1}, {0,1}, {0,1}, {0,1}
00240 };
00241
00242 #ifdef __RI_RAD_FLAG
00243 #undef RAD
00244 #undef __RI_RAD_FLAG
00245 #endif
00246 }
00247
00248
00249
00250
00251
00252
00253 #endif