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

Representations/Perception/CollisionPercept.h

Go to the documentation of this file.
00001 /**
00002 * @file CollisionPercept.h
00003 * 
00004 * Declaration of class CollisionPercept
00005 *
00006 * @author <a href="mailto:goehring@informatik.hu-berlin.de">Daniel Goehring</a>
00007 */ 
00008 
00009 #ifndef __CollisionPercept_h_
00010 #define __CollisionPercept_h_
00011 
00012 #include "Tools/Streams/InOut.h"
00013 #include "Representations/Motion/JointData.h"
00014 
00015 
00016 /**
00017 * Contains detected collisions for each joint.
00018 */
00019 class CollisionPercept
00020 {
00021 public:
00022   /** Constructor */ 
00023   CollisionPercept();
00024 
00025   /** Reset all states */ 
00026   void reset();
00027 
00028   /** Destructor */ 
00029   ~CollisionPercept();
00030 
00031   double state[JointData::numOfJoint];
00032     
00033   /** Did collision occur at front left leg */
00034   bool getCollisionFrontLeft() const;
00035 
00036   /** Did collision occur at front right leg */
00037   bool getCollisionFrontRight() const;
00038 
00039   /** Did collision occur at hind left leg */
00040   bool getCollisionHindLeft() const;
00041 
00042   /** Did collision occur at hind left leg */
00043   bool getCollisionHindRight() const;
00044 
00045   /** Did collision occur at head */
00046   bool getCollisionHead() const;
00047 
00048   /** Did collision occur at any body part */
00049   bool getCollisionAggregate() const;
00050 
00051   /** Quantitative Value for occurred collision */
00052   double getOdometryDisturbance() const;
00053 
00054   /** the last perceived frame */
00055   unsigned long frameNumber;
00056 
00057   /** sets frame number */
00058   void setFrameNumber(unsigned long frameNumber) {this->frameNumber = frameNumber;}
00059 
00060 };
00061 /**
00062  * Streaming operator that reads a joint state from a stream.
00063  * @param stream The stream from which is read.
00064  * @param CollisionPercept The CollisionPercept.
00065  * @return The stream.
00066  */ 
00067 In& operator>>(In& stream, CollisionPercept& CollisionPercept);
00068  
00069 /**
00070  * Streaming operator that writes a joint state to a stream.
00071  * @param stream The stream to write on.
00072  * @param CollisionPercept The CollisionPercept object.
00073  * @return The stream.
00074  */ 
00075 Out& operator<<(Out& stream, const CollisionPercept& CollisionPercept);
00076 
00077 #endif //__CollisionPercept_h_

Generated on Mon Mar 20 22:00:02 2006 for GT2005 by doxygen 1.3.6