00001
00002
00003
00004
00005
00006
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 ;
00031 Vector2<double> getPlayerSpeed(int player,int color = Player::red) const ;
00032 double getPlayerOrientation(int player,int color = Player::red) const ;
00033 double getTimestamp() const ;
00034 BallModel getBallModel() const ;
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
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 double camWorldstate[46];
00104
00105 unsigned long frameNumber;
00106 private:
00107 int flip;
00108
00109 };
00110
00111
00112
00113
00114
00115
00116
00117 In& operator>>(In& stream,GTCamWorldState& state);
00118
00119
00120
00121
00122
00123
00124
00125 Out& operator<<(Out& stream, const GTCamWorldState& state);
00126
00127 #endif