Object.hpp
Go to the documentation of this file.
00001 //
00002 // Object.hpp
00003 //
00004 // Container for objects.
00005 //
00006 
00007 
00008 #ifndef OBJECT_HPP
00009 #define OBJECT_HPP
00010 
00011 
00012 #include <vector>
00013 #include "../BasicDatatypes.hpp"
00014 #include "Point2D.hpp"
00015 #include "Polygon2D.hpp"
00016 #include "Box2D.hpp"
00017 #include "../tools/Time.hpp"
00018 
00019 namespace datatypes
00020 {
00021 
00022 // Represents a tracked object in our environmental model.
00078 class Object
00079 {
00080 public:
00081         enum ObjectClassification
00082         {
00083                 Unclassified = 0,
00084                 UnknownSmall = 1,
00085                 UnknownBig = 2,
00086                 Pedestrian = 3,
00087                 Bike = 4,
00088                 Car = 5,
00089                 Truck = 6,
00090                 Structure_Pylon = 7,
00091                 Structure_Beacon = 8,
00092                 Structure_GuardRail = 9,
00093                 Structure_ConcreteBarrier = 10,
00094                 NumClasses,
00095                 Unknown = 15
00096         };
00097 
00098 public:
00099         Object();
00100         ~Object();
00101 
00103         bool operator==(const Object& other) const;
00104 
00113         UINT16 getObjectId() const { return m_objectId; }
00114 
00119         void setObjectId(UINT16 v) { m_objectId = v; }
00120 
00121 
00131         UINT16 getFlags() const { return m_flags; }
00132         void setFlags(UINT16 v) { m_flags = v; }
00133 
00136         UINT32 getObjectAge() const { return m_objectAge; }
00137         void setObjectAge(UINT32 v) { m_objectAge = v; }
00138 
00142         UINT16 getHiddenStatusAge() const { return m_hiddenStatusAge; }
00146         bool isHiddenStatus() const { return m_hiddenStatusAge > 0; }
00147         void setHiddenStatusAge(UINT16 v) { m_hiddenStatusAge = v; }
00148 
00151         const Time& getTimestamp() const { return m_timestamp; }
00152         void setTimestamp(const Time& v) { m_timestamp = v; }
00153 
00156         ObjectClassification getClassification() const { return m_classification; }
00157         void setClassification(ObjectClassification v) { m_classification = v; }
00158 
00161         UINT32  getClassificationAge() const { return m_classificationAge; }
00162         void setClassificationAge(UINT32 v) { m_classificationAge = v; }
00163 
00166         double  getClassificationQuality() const { return m_classificationQuality; }
00167         void setClassificationQuality(double v);
00168 
00169 
00187         const Point2D&  getCenterPoint() const { return m_centerPoint; }
00188         void setCenterPoint(const Point2D& v) { m_centerPoint = v; }
00189 
00194         const Point2D&  getCenterPointSigma() const { return m_centerPointSigma; }
00195         void setCenterPointSigma(const Point2D& v);
00196 
00207         double  getCourseAngle() const { return m_courseAngle; }
00208 
00218         void setCourseAngle(double newCourseAngle);
00219 
00224         double getCourseAngleSigma() const { return m_courseAngleSigma; }
00225         void setCourseAngleSigma(double v);
00226 
00232         const Point2D&  getRelativeVelocity() const { return m_relativeVelocity; }
00233         void setRelativeVelocity(const Point2D&  v) { m_relativeVelocity = v; }
00234 
00241         const Point2D&  getRelativeVelocitySigma() const { return m_relativeVelocitySigma; }
00242         void setRelativeVelocitySigma(const Point2D& v) { m_relativeVelocitySigma = v; }
00243 
00247         const Point2D&  getAbsoluteVelocity() const { return m_absoluteVelocity; }
00249         void setAbsoluteVelocity(const Point2D&  v);
00250 
00253         const Point2D&  getAbsoluteVelocitySigma() const { return m_absoluteVelocitySigma; }
00254         void setAbsoluteVelocitySigma(const Point2D& v);
00255 
00256 
00273         const Point2D& getObjectBox() const { return m_objectBox; }
00274 
00277         void setObjectBox(const Point2D& v);
00278 
00290         Box2D getBox() const;
00291 
00297         const Point2D& getObjectBoxSigma() const { return m_objectBoxSigma; }
00298         void setObjectBoxSigma(const Point2D& v);
00299 
00308         void getObjectBoxVarCovar(double &var_x, double &var_y, double &covar_xy) const;
00309 
00314         const Point2D& getBoundingBox() const { return m_boundingBox; }
00315         void setBoundingBox(const Point2D& v);
00316 
00320         const Point2D& getBoundingBoxCenter() const { return m_boundingBoxCenter; }
00321         void setBoundingBoxCenter(const Point2D& v);
00322 
00328         const Point2D& getClosestPoint() const { return m_closestPoint; }
00329         void setClosestPoint(const Point2D& v) { m_closestPoint = v; }
00330 
00333         const Polygon2D& getContourPoints() const { return m_contourPoints; }
00334         void setContourPoints(const Polygon2D& v);
00335         void addContourPoint(const Point2D cp);
00336 
00338         UINT64 getVehicleWLANid() const { return m_vehicleWLANid; }
00339         void setVehicleWLANid(UINT64 v) { m_vehicleWLANid = v; }
00340 
00343         double getObjectHeight() const { return m_objectHeight; }
00344         void setObjectHeight(double v) { m_objectHeight = v; }
00345 
00348         double getObjectHeightSigma() const { return m_objectHeightSigma; }
00349         void setObjectHeightSigma(double v);
00350 
00353         double getObjectMass() const { return m_objectMass; }
00354         void setObjectMass(double v);
00355 
00367         bool isValid() const { return m_isValid; }
00368 
00380         void setValid(bool newValue = true) { m_isValid = newValue; }
00381 
00385         double getMaxAbsoluteVelocity() const { return m_maxAbsoluteVelocity; }
00386         void setMaxAbsoluteVelocity(double v);
00387 
00391         double getNormalizedMeanPointDist() const { return m_normalizedMeanPointDist; }
00392         void setNormalizedMeanPointDist(double v);
00393 
00397         double getTotalTrackingDuration() const { return m_totalTrackingDuration; }
00398         void setTotalTrackingDuration(double v);
00399 
00402         double getTotalTrackedPathLength() const { return m_totalTrackedPathLength; }
00403         void setTotalTrackedPathLength(double v);
00404 
00409         double getMeanAbsoluteVelocity() const;
00410 
00411 
00412         // Size of the object in memory
00413         const UINT32 getUsedMemory() const { return sizeof(Object); };
00414 
00416 
00419         std::streamsize getSerializedSize(UINT32 version) const;
00420 
00425         std::string toString() const;
00426         //\}
00427 
00429         static const char* objectClassificationToString(ObjectClassification v);
00430 
00432         static std::string objectClassificationToStringWithNum(ObjectClassification v);
00433 
00435         static const char* objectClassificationToShortString(ObjectClassification v);
00436 
00441         static Object::ObjectClassification stringToObjectClassification(const std::string& s);
00442 
00444         void incrementObjectAge();
00445 
00446 private:
00447         UINT16  m_objectId;
00448         UINT16  m_flags; 
00449         // Data from the tracking/classification:
00450         UINT32  m_objectAge;            
00451         UINT16  m_hiddenStatusAge;      
00452         Time    m_timestamp;            
00453 
00454         ObjectClassification m_classification; 
00455         UINT32  m_classificationAge;           
00456         double   m_classificationQuality;       
00457 
00458         Point2D m_centerPoint;      
00459         Point2D m_centerPointSigma;
00460         double   m_courseAngle;      
00461         double   m_courseAngleSigma; // in [rad]
00462         Point2D m_relativeVelocity; 
00463         Point2D m_relativeVelocitySigma;
00464         Point2D m_absoluteVelocity; 
00465         Point2D m_absoluteVelocitySigma;
00466 
00467         Point2D m_objectBox;         
00468         Point2D m_objectBoxSigma;
00469         Point2D m_boundingBoxCenter; 
00470         Point2D m_boundingBox;       
00471 
00472         // These components are also proposed
00473         Point2D m_closestPoint; 
00474 
00475         // This can also be calculated
00476         Polygon2D m_contourPoints; 
00477 
00478         UINT64 m_vehicleWLANid;    
00479         double m_objectHeight;      
00480         double m_objectHeightSigma; 
00481 
00482         double m_objectMass; 
00483 
00484 
00486         double m_maxAbsoluteVelocity;
00487 
00491         double m_normalizedMeanPointDist;
00492 
00495         double m_totalTrackingDuration;
00496 
00499         double m_totalTrackedPathLength;
00500 
00505 //      const Segment *m_segment;
00506 
00507         // True, if this object is valid.
00508         bool m_isValid;
00509 };
00510 
00511 
00512 // ////////////////////////////////////////////////////////////
00513 
00514 //
00515 // List of Objects
00516 //
00517 //
00518 class ObjectList : public std::vector<Object>,
00519                                         public BasicData
00520 {
00521 public:
00522 
00523         typedef std::vector<Object> base_class;
00524 
00525         ObjectList();
00526 
00528         bool operator==(const ObjectList& other) const;
00529 
00530         // Size of the object in memory
00531         const UINT32 getUsedMemory() const { return sizeof(*this) + size()*sizeof(Object); };
00532 
00533         // Get the timestamp of the object list. Typically it should be the midTimestamp of the corresponding scan.
00534         const Time& getTimestamp() const { return m_timestamp; }
00535 
00536         // Set the timestamp of the object list. Typically it should be the midTimestamp of the corresponding scan.
00537         void setTimestamp(const Time& timestamp);
00538 
00540         void incrementObjectAge();
00541 
00542 protected:
00543 
00544         // The timestamp of the ObjectList
00545         Time m_timestamp;
00546 };
00547 
00548 }       // namespace datatypes
00549 
00550 
00551 #endif // OBJECT_HPP


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Jun 14 2017 04:04:50