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

# Modules/HeadControl/HeadControl.h

Go to the documentation of this file.

    00001 /**
    00002 * @file HeadControl.h
    00003 *
    00004 * This file contains a generic class for HeadControl.
    00005 */
    00006
    00007 #ifndef __HeadControl_h_
    00008 #define __HeadControl_h_
    00009
    00010 #ifdef _WIN32
    00011 #pragma warning(disable:4786)
    00012 // the constructor with all it's long parameter type names results in a too
    00013 // long debug identifier
    00014 #endif
    00015
    00016
    00017 #include "Tools/Module/Module.h"
    00018
    00019 #include "Representations/Perception/SensorDataBuffer.h"
    00020 #include "Representations/Perception/BodyPosture.h"
    00021 #include "Representations/Perception/CameraMatrix.h"
    00022
    00023 #include "Representations/Cognition/LandmarksState.h"
    00024 #include "Representations/Cognition/RobotPose.h"
    00025 #include "Representations/Cognition/RobotState.h"
    00026 #include "Representations/Cognition/BallModel.h"
    00027 #include "Representations/Cognition/ObstaclesModel.h"
    00028
    00029 #include "Representations/Motion/OdometryData.h"
    00030 #include "Representations/Motion/HeadControlMode.h"
    00031 #include "Representations/Motion/HeadMotionRequest.h"
    00032 #include "Representations/Motion/PIDData.h"
    00033 #include "Representations/Motion/MotionInfo.h"
    00034 #include "Representations/RoboCup/GameControlData.h"
    00035
    00036 #include "Tools/Debugging/DebugDrawings.h"
    00037 #include "Tools/RobotConfiguration.h"
    00038 #include "Tools/RingBuffer.h"
    00039
    00040 #ifdef _WIN32
    00041 #pragma warning(disable:4786)
    00042 // the constructor with all it's long parameter type names results in a too
    00043 // long debug identifier
    00044 #endif
    00045
    00046 /**
    00047 * @class HeadControlInterfaces
    00048 *
    00049 * The interfaces of the HeadControl module.
    00050 */
    00051 class HeadControlInterfaces
    00052 {
    00053 public:
    00054   /** Constructor. */
    00055   HeadControlInterfaces(
    00056     const unsigned long& frameNumber,
    00057     const SensorDataBuffer& sensorDataBuffer,
    00058     const CameraMatrix& cameraMatrix,
    00059     const OdometryData& currentOdometryData,
    00060     const BodyPosture& bodyPosture,
    00061     const LandmarksPercept& landmarksPercept,
    00062     const BallModel& ballModel,
    00063     const RobotPose& robotPose,
    00064     const LandmarksState& landmarksState,
    00065     const RobotState& robotState,
    00066     const MotionRequest& mR,
    00067     const MotionInfo& motionInfo,
    00068     const HeadControlMode& headControlMode,
    00069     const ObstaclesModel& obstaclesModel,
    00070     const bool headIsBlockedBySpecialActionOrWalk,
    00071     const GameControlData& gameControlData,
    00072     HeadMotionRequest& headMotionRequest,
    00073     PIDData& pidData)
    00074     :
    00075     frameNumber(frameNumber),
    00076     headControlMode(headControlMode),
    00077     obstaclesModel(obstaclesModel),
    00078     robotPose(robotPose),
    00079     cameraMatrix(cameraMatrix),
    00080     currentOdometryData(currentOdometryData),
    00081     landmarksPercept(landmarksPercept),
    00082     ballModel(ballModel),
    00083     robotState(robotState),
    00084     sensorDataBuffer(sensorDataBuffer),
    00085     bodyPosture(bodyPosture),
    00086     motionRequest(mR),
    00087     motionInfo(motionInfo),
    00088     landmarksState(landmarksState),
    00089     headIsBlockedBySpecialActionOrWalk(headIsBlockedBySpecialActionOrWalk),
    00090     headMotionRequest(headMotionRequest),
    00091     pidData(pidData),
    00092     gameControlData(gameControlData)
    00093   {}
    00094
    00095 protected:
    00096   /** A reference to the frame number */
    00097   const unsigned long& frameNumber;
    00098
    00099   /** A modus from the behavior how to move the head */
    00100   const HeadControlMode& headControlMode;
    00101
    00102   /** The robots current position and orientation */
    00103   const RobotPose& robotPose;
    00104
    00105   /** The position and rotation of the camera relative to the robot */
    00106   const CameraMatrix& cameraMatrix;
    00107
    00108   /** The odometry of the last Motion frame */
    00109   const OdometryData& currentOdometryData;
    00110
    00111   /** Detected landmarks */
    00112   const LandmarksPercept& landmarksPercept;
    00113
    00114   /** The position and the speed of the ball */
    00115   const BallModel& ballModel;
    00116
    00117   /** The current body sensor data */
    00118   const SensorDataBuffer& sensorDataBuffer;
    00119
    00120   /** The neck height and body tilt */
    00121   const BodyPosture& bodyPosture;
    00122
    00123   /** motionRequest that is currently executed */
    00124   const MotionRequest& motionRequest;
    00125
    00126   /** information about the executed motions */
    00127   const MotionInfo& motionInfo;
    00128
    00129   /** the currently seen landmarks */
    00130   const LandmarksState& landmarksState;
    00131
    00132   /** The current state of the robot*/
    00133   const RobotState& robotState;
    00134
    00135   /** Specifies if the head is blocked by a special action or walk.*/
    00136   const bool headIsBlockedBySpecialActionOrWalk;
    00137
    00138   /** game Manager */
    00139   const GameControlData& gameControlData;
    00140
    00141   /** Head joint angles that have to be set. */
    00142   HeadMotionRequest& headMotionRequest;
    00143
    00144   /** obstacles model */
    00145   const ObstaclesModel& obstaclesModel;
    00146
    00147   /** PID servo gains */
    00148   PIDData& pidData;
    00149 };
    00150
    00151 /**
    00152 * A generic class for HeadControl modules.
    00153 *
    00154 * The modul calculates a new head motion which has to be set by the motion module
    00155 * based on the desired head mode and the current
    00156 * collection of percepts stored in the world state as well as the current
    00157 * sensor informations .
    00158 */
    00159 class HeadControl : public Module, public HeadControlInterfaces, public RobotDimensions
    00160 {
    00161 public:
    00162 /*
    00163 * Constructor.
    00164 * @param interfaces The paramters of the HeadControl module.
    00165   */
    00166   HeadControl(const HeadControlInterfaces& interfaces)
    00167     : HeadControlInterfaces(interfaces),
    00168       RobotDimensions(getRobotConfiguration().getRobotDimensions())
    00169   {}
    00170
    00171   /** Destructor */
    00172   virtual ~HeadControl() {}
    00173 };
    00174
    00175 #endif //__HeadControl_h_