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

Representations/Cognition/LandmarksState.h

Go to the documentation of this file.
00001 /**
00002  * @file LandmarksState.h
00003  * 
00004  * Declaration of class LandmarksState
00005  */ 
00006 
00007 #ifndef __LandmarksState_h_
00008 #define __LandmarksState_h_
00009 
00010 
00011 #include "Tools/Streams/InOut.h"
00012 #include "Representations/Perception/LandmarksPercept.h"
00013 #include "Representations/Cognition/LandmarkState.h"
00014 
00015 
00016 
00017 
00018 /**
00019  * A class describing detected landmarks
00020  */
00021 class LandmarksState
00022 {
00023 
00024 
00025 public:
00026 
00027   LandmarksState();
00028 
00029   static const double BEACON;
00030   static const double GOAL;
00031   static const double LINE;
00032   static const double EDGE;
00033 
00034 
00035   enum {numOfLandmarks = 13};
00036 
00037   LandmarkState landmarks[numOfLandmarks];
00038 
00039   /** the index of the last seen beacon */
00040   int lastSeenBeacon;
00041 
00042   void update (const LandmarksPercept& landmarksPercept);
00043   void reset();
00044 
00045   /** return true, if a beacon was seen */
00046   bool seenAnyBeacon() const;
00047   /** return true, if a beacon or a flag was seen */
00048   bool seenAnyFlag() const;
00049   
00050   /** return the index of the last seen landmark. this is useful for optimizing the next two functions */
00051   int lastSeenBeaconIndex() const;
00052 
00053   /** return the time when the last beacon was seen. the function sets up the var lastSeenBeacon */
00054   long timeOfLastSeenBeacon(int beaconIndex) const;
00055   
00056   /** return the time difference between the two last seen beacon */
00057   long timeBetweenSeen2LastBeacons(int beaconIndex) const;
00058   void initLandmarks();
00059   void setLandmarkVisibleByBeaconType(int type);
00060 };
00061 
00062 /**
00063  * Streaming operator that reads a LandmarksState from a stream.
00064  * @param stream The stream from which is read.
00065  * @param landmarksState The LandmarksState object.
00066  * @return The stream.
00067  */ 
00068 In& operator>>(In& stream,LandmarksState& landmarksState);
00069  
00070 /**
00071  * Streaming operator that writes a LandmarksState to a stream.
00072  * @param stream The stream to write on.
00073  * @param landmarksState The LandmarksState object.
00074  * @return The stream.
00075  */ 
00076 Out& operator<<(Out& stream, const LandmarksState& landmarksState);
00077 
00078 
00079 #endif //__LandmarksState_h_
00080 
00081 /*
00082  * Change log :
00083  * 
00084  * $Log: LandmarksState.h,v $
00085  * Revision 1.4  2004/09/08 14:39:03  wachter
00086  * - Fixed some doxygen-errors
00087  *
00088  */

Generated on Thu Sep 23 19:57:35 2004 for GT2004 by doxygen 1.3.6