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

# Representations/Perception/CalibrationRequest.h

Go to the documentation of this file.

    00001 /**
    00002  * @file CalibrationRequest.h
    00003  *
    00004  * Declaration of class CalibrationRequest
    00005  *
    00006  * @author Matthias Juengel
    00007  */
    00008
    00009 #ifndef __CalibrationRequest_h_
    00010 #define __CalibrationRequest_h_
    00011
    00012 #include "Tools/Streams/InOut.h"
    00013
    00014 /**
    00015 * @class CalibrationRequest
    00016 *
    00017 * A request for calibration.
    00018 */
    00019 class CalibrationRequest
    00020 {
    00021 public:
    00022
    00023   /** constructor */
    00024   CalibrationRequest();
    00025
    00026   /** destructor */
    00027   ~CalibrationRequest();
    00028
    00029   enum CalibrationMode
    00030   {
    00031     none,
    00032       calibrateColors,
    00033       calibrateBallSideDetector,
    00034       numOfCalibrationModes
    00035   };
    00036
    00037   enum CalibrationFeedback
    00038   {
    00039     noFeedback,
    00040       colorIsGreen,
    00041       colorIsOrange,
    00042       ballRolledByLeft,
    00043       ballRolledByRight,
    00044       ballDidNotRollBy,
    00045       numOfCalibrationFeedbacks
    00046   };
    00047
    00048   //! Returns the name of a CalibrationMode.
    00049   static char* getCalibrationModeName(CalibrationMode calibrationMode)
    00050   {
    00051     switch(calibrationMode)
    00052     {
    00053     case none: return "none";
    00054     case calibrateColors: return "calibrateColors";
    00055     case calibrateBallSideDetector: return"calibrateBallSideDetector";
    00056     default: return "undefined CalibrationMode";
    00057     }
    00058   };
    00059
    00060   //! Returns the name of a CalibrationFeedback.
    00061   static char* getCalibrationFeedbackName(CalibrationFeedback calibrationFeedback)
    00062   {
    00063     switch(calibrationFeedback)
    00064     {
    00065     case noFeedback: return "noFeedback";
    00066     case colorIsGreen: return "colorIsGreen";
    00067     case colorIsOrange: return "colorIsOrange";
    00068     case ballRolledByLeft: return"ballRolledByLeft";
    00069     case ballRolledByRight: return"ballRolledByRight";
    00070     case ballDidNotRollBy: return"ballDidNotRollBy";
    00071     default: return "undefined CalibrationFeedback";
    00072     }
    00073   };
    00074
    00075   CalibrationMode mode;
    00076   CalibrationFeedback feedback;
    00077 };
    00078
    00079
    00080 /**
    00081  * Streaming operator that reads a CalibrationRequest from a stream.
    00082  * @param stream The stream from which is read.
    00083  * @param calibrationRequest The CalibrationRequest object.
    00084  * @return The stream.
    00085  */
    00086 In& operator>>(In& stream,CalibrationRequest& calibrationRequest);
    00087
    00088 /**
    00089  * Streaming operator that writes a CalibrationRequest to a stream.
    00090  * @param stream The stream to write on.
    00091  * @param calibrationRequest The CalibrationRequest object.
    00092  * @return The stream.
    00093  */
    00094 Out& operator<<(Out& stream, const CalibrationRequest& calibrationRequest);
    00095
    00096
    00097
    00098 #endif //__CalibrationRequest_h_