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

# Representations/Cognition/GTCamWorldState.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GTRemoteCamWorldState.h
    00003 *
    00004 * Definition of class GTRemoteCamWorldState
    00005 *
    00006 * @author Matthias Meyer
    00007 */
    00008 #ifndef __GTCAMWORLDSTATE_h_
    00009 #define __GTCAMWORLDSTATE_h_
    00010
    00011 #include "Representations/Cognition/BallModel.h"
    00012 #include "Representations/Cognition/PlayerPoseCollection.h"
    00013 #include "Representations/Cognition/RobotPose.h"
    00014 #include "Tools/Debugging/Debugging.h"
    00015
    00016 #include "Tools/Player.h"
    00017
    00018
    00019 class GTCamWorldState {
    00020   friend class RemoteCam;
    00021   friend class RobotControlGTCamSocket;
    00022   friend class GTCamHandler;
    00023   friend class MSH2005KickLoggerSymbols;
    00024 public:
    00025
    00026   static const int SIZEOFWORLDSTATE;
    00027
    00028   GTCamWorldState(bool flip = false);
    00029   virtual ~GTCamWorldState();
    00030   Vector2<double> getPlayerPos(int player,int color = Player::red) const ;    // Player = 0..3
    00031   Vector2<double> getPlayerSpeed(int player,int color  = Player::red) const ; // Get Player Speed
    00032   double getPlayerOrientation(int player,int color = Player::red) const ;
    00033   double getTimestamp() const ;                   // Timestamp of worldmodel
    00034   BallModel getBallModel() const ;                // Ball location + speed
    00035   void setPlayerPos(Vector2<double> pos,int player,int color = Player::red);
    00036   void setPlayerSpeed(Vector2<double> speed,int player,int color = Player::red);
    00037   void setPlayerOrientation(double angle, int player,int color = Player::red);
    00038   void setTimestamp(double stamp);
    00039   void setFlip(bool x);
    00040   PlayerPoseCollection getPlayerPoseCollection(int player, int color = Player::red);
    00041   RobotPose getRobotPose(int player,int color = Player::red) const ;
    00042   RobotPose getRobotPose() const;
    00043   double getSyncTimestamp() const;
    00044   void setSyncTimestamp(double stamp);
    00045   unsigned long getFrameNumber() const;
    00046   void setBallPos(double X, double Y);
    00047   void setBallSpeedX(double speedX);
    00048   void setBallSpeedY(double speedY);
    00049   void setBallSpeed(double speedX, double speedY);
    00050   bool playerWasSeen(int player, int color = Player::red) const;
    00051
    00052 private:
    00053   bool is_NAN(double test) const;
    00054 //public:
    00055   /*  Worldstate
    00056   0: timestamp
    00057   1: sync timestamp
    00058   2: ball x
    00059   3: ball y
    00060   4: ball speed x
    00061   5: ball speed y
    00062   6: robot1 x
    00063   7: robot1 y
    00064   8: robot1 orientation
    00065   9: robot1 speed x
    00066   10: robot1 speed y
    00067   11: robot2 x
    00068   12: robot2 y
    00069   13: robot2 orientation
    00070   14: robot2 speed x
    00071   15: robot2 speed y
    00072   16: robot3 x
    00073   17: robot3 y
    00074   18: robot3 orientation
    00075   19: robot3 speed x
    00076   20: robot3 speed y
    00077   21: robot4 x
    00078   22: robot4 y
    00079   23: robot4 orientation
    00080   24: robot4 speed x
    00081   25: robot4 speed y
    00082   26: robot5 x
    00083   27: robot5 y
    00084   28: robot5 orientation
    00085   29: robot5 speed x
    00086   30: robot5 speed y
    00087   31: robot6 x
    00088   32: robot6 y
    00089   33: robot6 orientation
    00090   34: robot6 speed x
    00091   35: robot6 speed y
    00092   36: robot7 x
    00093   37: robot7 y
    00094   38: robot7 orientation
    00095   39: robot7 speed x
    00096   40: robot7 speed y
    00097   41: robot8 x
    00098   42: robot8 y
    00099   43: robot8 orientation
    00100   44: robot8 speed x
    00101   45: robot8 speed y
    00102   */
    00103   double camWorldstate[46];
    00104
    00105   unsigned long frameNumber;
    00106 private:
    00107   int flip;
    00108
    00109 };
    00110
    00111 /**
    00112 * Streaming operator that reads a GTRemoteCamWorldState from a stream.
    00113 * @param stream The stream from which is read.
    00114 * @param state The Worldstate.
    00115 * @return The stream.
    00116 */
    00117 In& operator>>(In& stream,GTCamWorldState& state);
    00118
    00119 /**
    00120 * Streaming operator that writes a GTRemoteCamWorldState to a stream.
    00121 * @param stream The stream to write on.
    00122 * @param state is the GTRemoteCamWorldState object.
    00123 * @return The stream.
    00124 */
    00125 Out& operator<<(Out& stream, const GTCamWorldState& state);
    00126
    00127 #endif