00001 /** 00002 * @file RobotPose.h 00003 * 00004 * The file contains the definition of the class RobotPose. 00005 * 00006 * @author <A href=mailto:roefer@tzi.de>Thomas Röfer</A> 00007 */ 00008 00009 #ifndef __RobotPose_h_ 00010 #define __RobotPose_h_ 00011 00012 #include "Tools/Streams/InOut.h" 00013 #include "Tools/Math/Pose2D.h" 00014 00015 /** 00016 * @class RobotPose 00017 * A Pose2D with validity. 00018 */ 00019 class RobotPose : public Pose2D 00020 { 00021 private: 00022 double validity; /**< The validity of the robot pose. */ 00023 00024 public: 00025 /** 00026 * Constructor. 00027 */ 00028 RobotPose() {validity = 0; frameNumber = 0;} 00029 00030 const RobotPose& operator=(const RobotPose& other) 00031 { 00032 (Pose2D&) *this = (const Pose2D&) other; 00033 validity = other.validity; 00034 frameNumber = other.frameNumber; 00035 return *this; 00036 } 00037 00038 /** 00039 * Cast Contructor. 00040 */ 00041 RobotPose (const Pose2D& otherPose) { 00042 (Pose2D&) *this = otherPose; 00043 validity=0; 00044 } 00045 00046 const RobotPose& operator=(const Pose2D& other) 00047 { 00048 (Pose2D&) *this = other; 00049 //don't touch validity and frameNumber here! 00050 return *this; 00051 } 00052 00053 /** 00054 * The function sets the current pose. 00055 * @param p The pose. 00056 */ 00057 void setPose(const Pose2D& p) { 00058 (Pose2D&) *this = p; 00059 } 00060 00061 /** 00062 * The function sets the validity of the current pose. 00063 * @param v The validity. 00064 */ 00065 void setValidity(const double v) {validity = v;} 00066 00067 /** 00068 * The function sets the frame number of the current pose. 00069 */ 00070 void setFrameNumber(unsigned long frameNumber) {this->frameNumber = frameNumber;} 00071 00072 00073 00074 /** 00075 * The function returns the current pose. 00076 * @return The pose. 00077 * @attention this function is obsolete and should not be used any more 00078 * @attention instead this object IS a pose instead of owning one 00079 */ 00080 const Pose2D getPose() const { 00081 return (const Pose2D&) *this; 00082 } 00083 00084 /** 00085 * The function returns the validity of the current pose. 00086 * @return The validity. 00087 */ 00088 const double& getValidity() const {return validity;} 00089 00090 /**< The frame number when perceived. */ 00091 unsigned long frameNumber; 00092 00093 /**< Speed measured by perceived distance to goal. */ 00094 double speedbyDistanceToGoal; 00095 00096 /**< The distance to the field border */ 00097 double distanceToBorder; 00098 00099 /**< The angle to the field border */ 00100 double angleToBorder; 00101 }; 00102 00103 /** 00104 * Streaming operator that reads a robot pose from a stream. 00105 * @param stream The stream from which is read. 00106 * @param robotPose The robot pose object. 00107 * @return The stream. 00108 */ 00109 In& operator>>(In& stream,RobotPose& robotPose); 00110 00111 /** 00112 * Streaming operator that writes a robot pose to a stream. 00113 * @param stream The stream to write on. 00114 * @param robotPose The robot pose object. 00115 * @return The stream. 00116 */ 00117 Out& operator<<(Out& stream, const RobotPose& robotPose); 00118 00119 00120 #endif //__RobotPose_h_ 00121 00122 /* 00123 * Change log : 00124 * 00125 * $Log: RobotPose.h,v $ 00126 * Revision 1.1.1.1 2004/05/22 17:25:15 cvsadm 00127 * created new repository GT2004_WM 00128 * 00129 * Revision 1.8 2004/03/27 16:16:37 juengel 00130 * Added distanceToBorder and angleToBorder. 00131 * 00132 * Revision 1.7 2004/01/22 11:42:53 spranger 00133 * changed speedbydistancetogoal to remove some compiler warnings 00134 * 00135 * Revision 1.6 2004/01/22 08:55:43 spranger 00136 * added speedbydistancetogoal member 00137 * 00138 * Revision 1.5 2004/01/20 15:08:26 dueffert 00139 * missing =operator added 00140 * 00141 * Revision 1.4 2004/01/19 14:55:23 dueffert 00142 * all frameNumbers (and not only some of them) are unsigned long now 00143 * 00144 * Revision 1.3 2003/11/18 15:19:24 dueffert 00145 * serious bugs fixed 00146 * 00147 * Revision 1.2 2003/11/13 14:51:25 goehring 00148 * frameNumber added 00149 * 00150 * Revision 1.1 2003/10/07 10:07:01 cvsadm 00151 * Created GT2004 (M.J.) 00152 * 00153 * Revision 1.1.1.1 2003/07/02 09:40:22 cvsadm 00154 * created new repository for the competitions in Padova from the 00155 * tamara CVS (Tuesday 2:00 pm) 00156 * 00157 * removed unused solutions 00158 * 00159 * Revision 1.6 2002/11/27 13:54:07 dueffert 00160 * doxygen docu added 00161 * 00162 * Revision 1.5 2002/11/19 17:38:31 dueffert 00163 * doxygen bugs corrected 00164 * 00165 * Revision 1.4 2002/11/06 21:24:22 loetzsch 00166 * no message 00167 * 00168 * Revision 1.3 2002/11/06 18:28:39 juengel 00169 * repaired Ball Locator 00170 * 00171 * Revision 1.2 2002/09/22 18:40:51 risler 00172 * added new math functions, removed GTMath library 00173 * 00174 * Revision 1.1 2002/09/10 15:26:39 cvsadm 00175 * Created new project GT2003 (M.L.) 00176 * - Cleaned up the /Src/DataTypes directory 00177 * - Removed Challenge Code 00178 * - Removed processing of incoming audio data 00179 * - Renamed AcousticMessage to SoundRequest 00180 * 00181 * Revision 1.5 2002/07/23 13:32:57 loetzsch 00182 * new streaming classes 00183 * 00184 * removed many #include statements 00185 * 00186 * Revision 1.4 2002/06/08 16:24:41 Thomas Röfer 00187 * Cast constructor improved 00188 * 00189 * Revision 1.3 2002/06/08 12:58:19 Thomas Röfer 00190 * operator= inserted (to avoid MCOOP exception) 00191 * 00192 * Revision 1.2 2002/06/08 09:26:31 Thomas Röfer 00193 * Team ball position, first draft 00194 * 00195 * Revision 1.1.1.1 2002/05/10 12:40:13 cvsadm 00196 * Moved GT2002 Project from ute to tamara. 00197 * 00198 * Revision 1.9 2002/02/19 14:28:35 brunn 00199 * RobotPose ist jetzt auch eine Pose anstatt nur so zu heissen 00200 * 00201 * Revision 1.8 2002/02/13 22:43:02 roefer 00202 * First working versions of DefaultLandmarksPerceptor and MonteCarloSelfLocator 00203 * 00204 * Revision 1.7 2002/02/11 00:56:12 loetzsch 00205 * added two new setPose() functions 00206 * 00207 * Revision 1.6 2002/02/05 03:36:12 loetzsch 00208 * replaced direct member access by 00209 * inline const VALUE& get...() const and 00210 * inline void set...(const Value&) methods. 00211 * 00212 * Revision 1.5 2002/01/25 15:40:13 roefer 00213 * The Oracle 00214 * 00215 * Revision 1.4 2002/01/13 12:16:16 AndySHB 00216 * no message 00217 * 00218 * Revision 1.3 2001/12/10 17:47:06 risler 00219 * change log added 00220 * 00221 */