00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __GenericDebugData_h_
00010 #define __GenericDebugData_h_
00011
00012 #include "Tools/Streams/InOut.h"
00013 #include "Tools/MessageQueue/MessageIDs.h"
00014
00015
00016
00017
00018
00019 class GenericDebugData
00020 {
00021 public:
00022
00023 GenericDebugData();
00024
00025
00026 ~GenericDebugData();
00027
00028 enum GenericDebugDataID
00029 {
00030 numberOfFourierCoefficients = 0,
00031 braitenbergPIDs = 1,
00032 danielTest = 2,
00033 defaultObstaclesLocator = 3,
00034 linesImageProcessor = 4,
00035 MotionDetector = 5,
00036 gridImageProcessor2DebugParameters = 6,
00037 linesSelfLocator = 7,
00038 ballLocatorPIDs = 8,
00039 bodyOffsets = 9,
00040 odometryScale = 10,
00041 motionStabilizer = 11,
00042 yetAnotherInvKinParams = 12,
00043 yetAnotherInvKinPaws = 13,
00044 noOdometrySelfLocator = 14,
00045 teamMessageSendDelay = 15,
00046
00047 numOfGenericDebugDataIDs,
00048 unknown
00049 };
00050
00051 static const char* getGenericDebugDateName(GenericDebugDataID genericDebugDataID)
00052 {
00053 switch(genericDebugDataID)
00054 {
00055 case braitenbergPIDs: return "braitenbergPIDs";
00056 case defaultObstaclesLocator: return "DefaultObstaclesLocator";
00057 case MotionDetector: return "MotionDetector";
00058 case numberOfFourierCoefficients: return "numberOfFourierCoefficients";
00059 case danielTest: return "danielTest";
00060 case linesImageProcessor: return "linesImageProcessor";
00061 case gridImageProcessor2DebugParameters: return "gridImageProcessor2DebugParameters";
00062 case linesSelfLocator: return "linesSelfLocator";
00063 case ballLocatorPIDs: return "ballLocatorPIDs";
00064 case bodyOffsets: return "bodyOffsets";
00065 case odometryScale: return "odometryScale";
00066 case motionStabilizer: return "motionStabilizer";
00067 case yetAnotherInvKinParams: return "yetAnotherInvKinParams";
00068 case yetAnotherInvKinPaws: return "yetAnotherInvKinPaws";
00069 case noOdometrySelfLocator: return "noOdometrySelfLocator";
00070 case teamMessageSendDelay: return "teamMessageSendDeay";
00071 default: return "unnamed";
00072 }
00073 }
00074
00075 static const char* getParameterName(GenericDebugDataID genericDebugDataID, int index)
00076 {
00077 char noNames[10][100] = {"","","","","","","","","",""};
00078 char linesImageProcessorNames[10][100] = {"gridSpacing","yThreshold","vThreshold","","","","","","",""};
00079 char gridImageProcessor2DebugParametersNames[10][100] = {"scanLineSpacing","numOfLines","useFixedHorizon","returnCondition","-", "-", "-", "-", "-", "-"};
00080 char linesSelfLocatorNames[10][100] = {"up","down","delay","height","z","y","trans","rot","",""};
00081 char ballLocatorPIDNames[10][100] = {"ballX P","ballX I","ballX D","speedX P","speedX I","speedX D","","","",""};
00082 char bodyOffsetNames[10][100] = {"bodyTiltOffset","bodyRollOffset","headTiltOffset","headRollOffset","tiltFactor","panFactor","tile2Factor","","",""};
00083 char odometryScaleNames[10][100] = {"scaleX","scaleY","scaleRotation","counterRotation","","","","","",""};
00084 char yetAnotherInvKinParamNames[10][100] = {"x","y","z","tilt","pan","roll","kick lateral","kick speed","body extra","kick length"};
00085 char yetAnotherInvKinPawsNames[10][100] = {"fore x","fore y","hind x","hind y","kick height","use paw","smoothing","","",""};
00086
00087 switch(genericDebugDataID)
00088 {
00089 case linesImageProcessor: return linesImageProcessorNames[index];
00090 case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersNames[index];
00091 case linesSelfLocator: return linesSelfLocatorNames[index];
00092 case ballLocatorPIDs: return ballLocatorPIDNames[index];
00093 case bodyOffsets: return bodyOffsetNames[index];
00094 case odometryScale: return odometryScaleNames[index];
00095 case yetAnotherInvKinParams: return yetAnotherInvKinParamNames[index];
00096 case yetAnotherInvKinPaws: return yetAnotherInvKinPawsNames[index];
00097 default: return noNames[index];
00098 }
00099 }
00100
00101 static MessageID getMessageID(GenericDebugDataID genericDebugDataID)
00102 {
00103 switch(genericDebugDataID)
00104 {
00105 case linesSelfLocator: return idLinesSelfLocatorParameters;
00106 case bodyOffsets: return idBodyOffsets;
00107 case odometryScale: return idOdometryScale;
00108 case yetAnotherInvKinParams: return idYetAnotherInvKinParams;
00109 case yetAnotherInvKinPaws: return idYetAnotherInvKinPaws;
00110 default: return idGenericDebugData;
00111 }
00112 }
00113
00114 static double getDefaultValue(GenericDebugDataID genericDebugDataID, int index)
00115 {
00116 double linesImageProcessorValues[10] = {5,15,8,0,0,0,0,0,0,0};
00117 double gridImageProcessor2DebugParametersValues[10] = {5,40,0,0,0,0,0,0,0,0};
00118 double linesSelfLocatorValues[10] = {0.01,0.005,2,150,10,2,200,0.5,0,0};
00119 double yetAnotherInvKinParamsValues[10] = {23.0,0.0,106.0,10.2,10,10,0,0,0,0};
00120 double yetAnotherInvKinPawsValues[10] = {36.0,7.0,111.0,32.2,0,0,0,0,0,0};
00121
00122 switch(genericDebugDataID)
00123 {
00124 case linesImageProcessor: return linesImageProcessorValues[index];
00125 case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersValues[index];
00126 case linesSelfLocator: return linesSelfLocatorValues[index];
00127 case yetAnotherInvKinParams: return yetAnotherInvKinParamsValues[index];
00128 case yetAnotherInvKinPaws: return yetAnotherInvKinPawsValues[index];
00129 default: return 0;
00130 }
00131 }
00132
00133 static double getMinValue(GenericDebugDataID genericDebugDataID, int index)
00134 {
00135 double gridImageProcessor2DebugParametersValues[10] = {1,1,0,0,0,0,0,0,0,0};
00136 double yetAnotherInvKinParamsValues[10] = {0,0,60,9.5,8.5,8.5,0,0,0,0};
00137 double yetAnotherInvKinPawsValues[10] = {0,0,60,9.5,8.5,8.5,0,0,0,0};
00138
00139 switch(genericDebugDataID)
00140 {
00141 case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersValues[index];
00142 case yetAnotherInvKinParams: return yetAnotherInvKinParamsValues[index];
00143 case yetAnotherInvKinPaws: return yetAnotherInvKinPawsValues[index];
00144 default: return 0;
00145 }
00146 }
00147
00148 static double getMaxValue(GenericDebugDataID genericDebugDataID, int index)
00149 {
00150 double gridImageProcessor2DebugParametersValues[10] = {100,200,1,100,0,0,0,0,0,0};
00151 double yetAnotherInvKinParamsValues[10] = {100,100,200,10.5,12,12,80,150,100,100};
00152 double yetAnotherInvKinPawsValues[10] = {100,100,200,100,100,100,0,0,0,0};
00153
00154 switch(genericDebugDataID)
00155 {
00156 case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersValues[index];
00157 case yetAnotherInvKinParams: return yetAnotherInvKinParamsValues[index];
00158 case yetAnotherInvKinPaws: return yetAnotherInvKinPawsValues[index];
00159 default: return 0;
00160 }
00161 }
00162
00163 int id;
00164 double data[10];
00165 };
00166
00167
00168
00169
00170
00171
00172
00173 In& operator>>(In& stream, GenericDebugData& d);
00174
00175
00176
00177
00178
00179
00180
00181 Out& operator<<(Out& stream, GenericDebugData& d);
00182
00183 #endif //__GenericDebugData_h_
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341