Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Tools/Debugging/GenericDebugData.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GenericDebugData.h
    00003 *
    00004 * Declaration of class GenericDebugData used for adjusting parameters on the robot.
    00005 *
    00006 * @author <a href="mailto:jhoffman@informatik.hu-berlin.de">Jan Hoffmann</a>
    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   /** Constructor */
    00023   GenericDebugData();
    00024
    00025   /** Destructor */
    00026   ~GenericDebugData();
    00027
    00028   enum GenericDebugDataID
    00029   {
    00030     numberOfFourierCoefficients = 0,
    00031     braitenbergPIDs = 1,
    00032     danielTest = 2,
    00033     defaultObstaclesLocator = 3,
    00034     imageProcessor = 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     gt2005BallLocator1,
    00047     gt2005BallLocator2,
    00048     gt2005TeamBallLocator,
    00049     gtCamKalmanBallFilter,
    00050     comboBallLocator,
    00051     // insert above this line
    00052     numOfGenericDebugDataIDs,
    00053     unknown
    00054   };
    00055
    00056   static const char* getGenericDebugDateName(GenericDebugDataID genericDebugDataID)
    00057   {
    00058     switch(genericDebugDataID)
    00059     {
    00060       case braitenbergPIDs: return "braitenbergPIDs";
    00061       case defaultObstaclesLocator: return "DefaultObstaclesLocator";
    00062       case MotionDetector: return "MotionDetector";
    00063       case numberOfFourierCoefficients: return "numberOfFourierCoefficients";
    00064       case danielTest: return "danielTest";
    00065       case imageProcessor: return "imageProcessor";
    00066       case gridImageProcessor2DebugParameters: return "gridImageProcessor2DebugParameters";
    00067       case linesSelfLocator: return "linesSelfLocator";
    00068       case ballLocatorPIDs: return "ballLocatorPIDs";
    00069       case bodyOffsets: return "bodyOffsets";
    00070       case odometryScale: return "odometryScale";
    00071       case motionStabilizer: return "motionStabilizer";
    00072       case yetAnotherInvKinParams: return "yetAnotherInvKinParams";
    00073       case yetAnotherInvKinPaws: return "yetAnotherInvKinPaws";
    00074       case noOdometrySelfLocator: return "noOdometrySelfLocator";
    00075       case teamMessageSendDelay: return "teamMessageSendDeay";
    00076       case gt2005BallLocator1: return "gt2005BallLocator1";
    00077       case gt2005BallLocator2: return "gt2005BallLocator2";
    00078       case gt2005TeamBallLocator: return "gt2005TeamBallLocator";
    00079       case comboBallLocator: return "comboBallLocator";
    00080       case gtCamKalmanBallFilter: return "gtCamKalmanBallFilter";
    00081       default: return "unnamed";
    00082     }
    00083   }
    00084
    00085   static const char* getParameterName(GenericDebugDataID genericDebugDataID, int index)
    00086   {
    00087     char noNames[10][100] = {"","","","","","","","","",""};
    00088     char imageProcessorNames[10][100] = {"gridSpacing","yThreshold","vThreshold","","","","","","",""};
    00089     char gridImageProcessor2DebugParametersNames[10][100] = {"scanLineSpacing","numOfLines","useFixedHorizon","returnCondition","-", "-", "-", "-", "-", "-"};
    00090     char linesSelfLocatorNames[10][100] = {"up","down","delay","height","z","y","trans","rot","",""};
    00091     char ballLocatorPIDNames[10][100] = {"ballX P","ballX I","ballX D","speedX P","speedX I","speedX D","","","",""};
    00092     char bodyOffsetNames[10][100] = {"bodyTiltOffset","bodyRollOffset","headTiltOffset","headRollOffset","tiltFactor","panFactor","tile2Factor","","",""};
    00093     char odometryScaleNames[10][100] = {"scaleX","scaleY","scaleRotation","counterRotation","","","","","",""};
    00094     char yetAnotherInvKinParamNames[10][100] = {"x","y","z","tilt","pan","roll","kick lateral","kick speed","body extra","kick length"};
    00095     char yetAnotherInvKinPawsNames[10][100] = {"fore x","fore y","hind x","hind y","kick height","use paw","smoothing","","",""};
    00096     char gt2005BallLocatorNames1[10][100] = {"systemNoise","measNoise","coeffOfFriction","timesPartProb","partProbThr","xBallRadius","randomLimitV","timeFctrThr","throwInProb",""};
    00097     char gt2005BallLocatorNames2[10][100] = {"velWeightXDirection","percentNumPartInside","partProbDecStep","nearPercept1","nearPercept2","nearPercept3","nearPercept4","farPercept1","farPercept2",""};
    00098     char gt2005TeamBallLocatorNames[10][100] = {"smallestProb","biggestProb","coeffOfFriction","systemNoise","timeFctrThr","lowerBound","upperBound","lowerValue","",""};
    00099     char comboBallLocatorNames[10][100] = {"FirstBL","SecondBL","setsTheState","CompWithCam","ShowVelocities","FirstTBL","SecondTBL","setsCommStateC","ShowVelocities",""};
    00100     char gtCamKalmanBallFilterNames[10][100] = {"Q1","Q2","Q3","Q4","RPri1","RPri2","RPri3","RPri4","",""};
    00101
    00102     switch(genericDebugDataID)
    00103     {
    00104       case imageProcessor: return imageProcessorNames[index];
    00105       case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersNames[index];
    00106       case linesSelfLocator: return linesSelfLocatorNames[index];
    00107       case ballLocatorPIDs: return ballLocatorPIDNames[index];
    00108       case bodyOffsets: return bodyOffsetNames[index];
    00109       case odometryScale: return odometryScaleNames[index];
    00110       case yetAnotherInvKinParams: return yetAnotherInvKinParamNames[index];
    00111       case yetAnotherInvKinPaws: return yetAnotherInvKinPawsNames[index];
    00112       case gt2005BallLocator1: return gt2005BallLocatorNames1[index];
    00113       case gt2005BallLocator2: return gt2005BallLocatorNames2[index];
    00114       case gt2005TeamBallLocator: return gt2005TeamBallLocatorNames[index];
    00115       case comboBallLocator: return comboBallLocatorNames[index];
    00116       case gtCamKalmanBallFilter: return gtCamKalmanBallFilterNames[index];
    00117       default: return noNames[index];
    00118     }
    00119   }
    00120
    00121   static MessageID getMessageID(GenericDebugDataID genericDebugDataID)
    00122   {
    00123     switch(genericDebugDataID)
    00124     {
    00125       case imageProcessor: return idImageProcessorParameters;
    00126       case linesSelfLocator: return idLinesSelfLocatorParameters;
    00127       case bodyOffsets: return idBodyOffsets;
    00128       case odometryScale: return idOdometryScale;
    00129       case yetAnotherInvKinParams: return idYetAnotherInvKinParams;
    00130       case yetAnotherInvKinPaws: return idYetAnotherInvKinPaws;
    00131       case gt2005BallLocator1: return idGT2005BallLocator1;
    00132       case gt2005BallLocator2: return idGT2005BallLocator2;
    00133       case gt2005TeamBallLocator: return idGT2005TeamBallLocator;
    00134       case comboBallLocator: return idComboBallLocator;
    00135       case gtCamKalmanBallFilter: return idGTCamKalmanBallFilter;
    00136       default: return idGenericDebugData;
    00137     }
    00138   }
    00139
    00140   static double getDefaultValue(GenericDebugDataID genericDebugDataID, int index)
    00141   {
    00142     double imageProcessorValues[10] = {5,15,8,0,0,0,0,0,0,0};
    00143     double gridImageProcessor2DebugParametersValues[10] = {5,40,0,0,0,0,0,0,0,0};
    00144     double linesSelfLocatorValues[10] = {0.01,0.005,2,150,10,2,200,0.5,0,0};
    00145     double yetAnotherInvKinParamsValues[10] = {23.0,0.0,106.0,10.2,10,10,0,0,0,0};
    00146     double yetAnotherInvKinPawsValues[10] = {36.0,7.0,111.0,32.2,0,0,0,0,0,0};
    00147     double gt2005BallLocator1Values[10] = {2.1328658564525527, 1.1681396, 3.977, 1.5005028759756203, 6.9667348197050852, 3.4395392005696981, 26.425595357345873, 8.6334179475266453, 16.310347444929196, 0};
    00148     double gt2005BallLocator2Values[10] = {15.05297, 20.75787543, 4.2172, 11.9061195, 30.848, 38.5559, 8.76583, 16.1997, 14.1873, 0};
    00149     double gt2005TeamBallLocatorValues[10] = {5, 8, 4, 0, 10, 20, 80, 100, 0, 0};
    00150     double comboBallLocatorValues[10] = {2, 1, 1, 0, 2, 1, 1, 0, 0, 0};
    00151     double gtCamKalmanBallFilterValues[10] = {2, 2, 30, 30, 1, 1, 50, 50, 0, 0};
    00152
    00153     switch(genericDebugDataID)
    00154     {
    00155       case imageProcessor: return imageProcessorValues[index];
    00156       case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersValues[index];
    00157       case linesSelfLocator: return linesSelfLocatorValues[index];
    00158       case yetAnotherInvKinParams: return yetAnotherInvKinParamsValues[index];
    00159       case yetAnotherInvKinPaws: return yetAnotherInvKinPawsValues[index];
    00160       case gt2005BallLocator1: return gt2005BallLocator1Values[index];
    00161       case gt2005BallLocator2: return gt2005BallLocator2Values[index];
    00162       case gt2005TeamBallLocator: return gt2005TeamBallLocatorValues[index];
    00163       case comboBallLocator: return comboBallLocatorValues[index];
    00164       case gtCamKalmanBallFilter: return gtCamKalmanBallFilterValues[index];
    00165       default: return 0;
    00166     }
    00167   }
    00168
    00169   static double getMinValue(GenericDebugDataID genericDebugDataID, int index)
    00170   {
    00171     double gridImageProcessor2DebugParametersValues[10] = {1,1,0,0,0,0,0,0,0,0};
    00172     double yetAnotherInvKinParamsValues[10] = {0,0,60,9.5,8.5,8.5,0,0,0,0};
    00173     double yetAnotherInvKinPawsValues[10] = {0,0,60,9.5,8.5,8.5,0,0,0,0};
    00174     double gt2005BallLocator1Values[10] = {0,0,0,0,0,0,0,0,0,0};
    00175     double gt2005BallLocator2Values[10] = {0,0,0,0,0,0,0,0,0,0};
    00176     double gt2005TeamBallLocatorValues[10] = {0,0,0,0,0,0,0,0,0,0};
    00177     double comboBallLocatorValues[10] = {1,0,0,0,0,1,0,1,0,0};
    00178     double gtCamKalmanBallFilterValues[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    00179
    00180     switch(genericDebugDataID)
    00181     {
    00182       case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersValues[index];
    00183       case yetAnotherInvKinParams: return yetAnotherInvKinParamsValues[index];
    00184       case yetAnotherInvKinPaws: return yetAnotherInvKinPawsValues[index];
    00185       case gt2005BallLocator1: return gt2005BallLocator1Values[index];
    00186       case gt2005BallLocator2: return gt2005BallLocator2Values[index];
    00187       case gt2005TeamBallLocator: return gt2005TeamBallLocatorValues[index];
    00188       case comboBallLocator: return comboBallLocatorValues[index];
    00189       case gtCamKalmanBallFilter: return gtCamKalmanBallFilterValues[index];
    00190       default: return 0;
    00191     }
    00192   }
    00193
    00194   static double getMaxValue(GenericDebugDataID genericDebugDataID, int index)
    00195   {
    00196     double gridImageProcessor2DebugParametersValues[10] = {100,200,1,100,0,0,0,0,0,0};
    00197     double yetAnotherInvKinParamsValues[10] = {100,100,200,10.5,12,12,80,150,100,100};
    00198     double yetAnotherInvKinPawsValues[10] = {100,100,200,100,100,100,0,0,0,0};
    00199     double gt2005BallLocator1Values[10] = {100,100,100,100,100,200,180,100,200,100};
    00200     double gt2005BallLocator2Values[10] = {100,100,100,100,100,100,100,100,100,100};
    00201     double gt2005TeamBallLocatorValues[10] = {100,50,100,100,100,100,100,100,100,100};
    00202     double comboBallLocatorValues[10] = {10,10,3,1,1,2,2,2,1,0};
    00203     double gtCamKalmanBallFilterValues[10] = {100,100,100,100,100,100,100,100,100,100};
    00204
    00205     switch(genericDebugDataID)
    00206     {
    00207       case gridImageProcessor2DebugParameters: return gridImageProcessor2DebugParametersValues[index];
    00208       case yetAnotherInvKinParams: return yetAnotherInvKinParamsValues[index];
    00209       case yetAnotherInvKinPaws: return yetAnotherInvKinPawsValues[index];
    00210       case gt2005BallLocator1: return gt2005BallLocator1Values[index];
    00211       case gt2005BallLocator2: return gt2005BallLocator2Values[index];
    00212       case gt2005TeamBallLocator: return gt2005TeamBallLocatorValues[index];
    00213       case comboBallLocator: return comboBallLocatorValues[index];
    00214       case gtCamKalmanBallFilter: return gtCamKalmanBallFilterValues[index];
    00215       default: return 0;
    00216     }
    00217   }
    00218
    00219   int id;
    00220   double data[10];
    00221 };
    00222
    00223 /**
    00224  * Streaming operator that reads GenericDebugData from a stream.
    00225  * @param stream The stream from which is read.
    00226  * @param d The GenericDebugData object.
    00227  * @return The stream.
    00228  */
    00229 In& operator>>(In& stream, GenericDebugData& d);
    00230
    00231 /**
    00232  * Streaming operator that writes GenericDebugData to a stream.
    00233  * @param stream The stream to write on.
    00234  * @param d The GenericDebugData object.
    00235  * @return The stream.
    00236  */
    00237 Out& operator<<(Out& stream, GenericDebugData& d);
    00238
    00239 #endif //__GenericDebugData_h_