Object.hpp
Go to the documentation of this file.
1 //
2 // Object.hpp
3 //
4 // Container for objects.
5 //
6 
7 
8 #ifndef OBJECT_HPP
9 #define OBJECT_HPP
10 
11 
12 #include <vector>
13 #include "../BasicDatatypes.hpp"
14 #include "Point2D.hpp"
15 #include "Polygon2D.hpp"
16 #include "Box2D.hpp"
17 #include "../tools/Time.hpp"
18 
19 namespace datatypes
20 {
21 
22 // Represents a tracked object in our environmental model.
78 class Object
79 {
80 public:
82  {
87  Bike = 4,
88  Car = 5,
89  Truck = 6,
95  Unknown = 15
96  };
97 
98 public:
99  Object();
100  ~Object();
101 
103  bool operator==(const Object& other) const;
104 
113  UINT16 getObjectId() const { return m_objectId; }
114 
119  void setObjectId(UINT16 v) { m_objectId = v; }
120 
121 
131  UINT16 getFlags() const { return m_flags; }
132  void setFlags(UINT16 v) { m_flags = v; }
133 
136  UINT32 getObjectAge() const { return m_objectAge; }
137  void setObjectAge(UINT32 v) { m_objectAge = v; }
138 
146  bool isHiddenStatus() const { return m_hiddenStatusAge > 0; }
148 
151  const Time& getTimestamp() const { return m_timestamp; }
152  void setTimestamp(const Time& v) { m_timestamp = v; }
153 
158 
163 
167  void setClassificationQuality(double v);
168 
169 
187  const Point2D& getCenterPoint() const { return m_centerPoint; }
188  void setCenterPoint(const Point2D& v) { m_centerPoint = v; }
189 
194  const Point2D& getCenterPointSigma() const { return m_centerPointSigma; }
195  void setCenterPointSigma(const Point2D& v);
196 
207  double getCourseAngle() const { return m_courseAngle; }
208 
218  void setCourseAngle(double newCourseAngle);
219 
224  double getCourseAngleSigma() const { return m_courseAngleSigma; }
225  void setCourseAngleSigma(double v);
226 
232  const Point2D& getRelativeVelocity() const { return m_relativeVelocity; }
234 
243 
247  const Point2D& getAbsoluteVelocity() const { return m_absoluteVelocity; }
249  void setAbsoluteVelocity(const Point2D& v);
250 
254  void setAbsoluteVelocitySigma(const Point2D& v);
255 
256 
273  const Point2D& getObjectBox() const { return m_objectBox; }
274 
277  void setObjectBox(const Point2D& v);
278 
290  Box2D getBox() const;
291 
297  const Point2D& getObjectBoxSigma() const { return m_objectBoxSigma; }
298  void setObjectBoxSigma(const Point2D& v);
299 
308  void getObjectBoxVarCovar(double &var_x, double &var_y, double &covar_xy) const;
309 
314  const Point2D& getBoundingBox() const { return m_boundingBox; }
315  void setBoundingBox(const Point2D& v);
316 
321  void setBoundingBoxCenter(const Point2D& v);
322 
328  const Point2D& getClosestPoint() const { return m_closestPoint; }
329  void setClosestPoint(const Point2D& v) { m_closestPoint = v; }
330 
333  const Polygon2D& getContourPoints() const { return m_contourPoints; }
334  void setContourPoints(const Polygon2D& v);
335  void addContourPoint(const Point2D cp);
336 
340 
343  double getObjectHeight() const { return m_objectHeight; }
344  void setObjectHeight(double v) { m_objectHeight = v; }
345 
348  double getObjectHeightSigma() const { return m_objectHeightSigma; }
349  void setObjectHeightSigma(double v);
350 
353  double getObjectMass() const { return m_objectMass; }
354  void setObjectMass(double v);
355 
367  bool isValid() const { return m_isValid; }
368 
380  void setValid(bool newValue = true) { m_isValid = newValue; }
381 
386  void setMaxAbsoluteVelocity(double v);
387 
392  void setNormalizedMeanPointDist(double v);
393 
398  void setTotalTrackingDuration(double v);
399 
403  void setTotalTrackedPathLength(double v);
404 
409  double getMeanAbsoluteVelocity() const;
410 
411 
412  // Size of the object in memory
413  const UINT32 getUsedMemory() const { return sizeof(Object); };
414 
416 
419  std::streamsize getSerializedSize(UINT32 version) const;
420 
425  std::string toString() const;
426  //\}
427 
430 
433 
436 
441  static Object::ObjectClassification stringToObjectClassification(const std::string& s);
442 
444  void incrementObjectAge();
445 
446 private:
449  // Data from the tracking/classification:
453 
457 
460  double m_courseAngle;
461  double m_courseAngleSigma; // in [rad]
466 
471 
472  // These components are also proposed
474 
475  // This can also be calculated
477 
479  double m_objectHeight;
481 
482  double m_objectMass;
483 
484 
487 
492 
496 
500 
505 // const Segment *m_segment;
506 
507  // True, if this object is valid.
508  bool m_isValid;
509 };
510 
511 
512 // ////////////////////////////////////////////////////////////
513 
514 //
515 // List of Objects
516 //
517 //
518 class ObjectList : public std::vector<Object>,
519  public BasicData
520 {
521 public:
522 
523  typedef std::vector<Object> base_class;
524 
525  ObjectList();
526 
528  bool operator==(const ObjectList& other) const;
529 
530  // Size of the object in memory
531  const UINT32 getUsedMemory() const { return sizeof(*this) + size()*sizeof(Object); };
532 
533  // Get the timestamp of the object list. Typically it should be the midTimestamp of the corresponding scan.
534  const Time& getTimestamp() const { return m_timestamp; }
535 
536  // Set the timestamp of the object list. Typically it should be the midTimestamp of the corresponding scan.
537  void setTimestamp(const Time& timestamp);
538 
540  void incrementObjectAge();
541 
542 protected:
543 
544  // The timestamp of the ObjectList
546 };
547 
548 } // namespace datatypes
549 
550 
551 #endif // OBJECT_HPP
Polygon2D.hpp
UINT16
uint16_t UINT16
Definition: BasicDatatypes.hpp:27
datatypes::Object::addContourPoint
void addContourPoint(const Point2D cp)
Definition: Object.cpp:194
datatypes::Object::setCourseAngle
void setCourseAngle(double newCourseAngle)
Definition: Object.cpp:105
datatypes::Object::objectClassificationToString
static const char * objectClassificationToString(ObjectClassification v)
Returns the given classification value as a string.
Definition: Object.cpp:251
datatypes::Object::setTotalTrackedPathLength
void setTotalTrackedPathLength(double v)
Definition: Object.cpp:430
datatypes::Object::setAbsoluteVelocitySigma
void setAbsoluteVelocitySigma(const Point2D &v)
Definition: Object.cpp:143
datatypes::Point2D
Definition: Point2D.hpp:27
datatypes::ObjectList::m_timestamp
Time m_timestamp
Definition: Object.hpp:545
datatypes::Object::getVehicleWLANid
UINT64 getVehicleWLANid() const
Definition: Object.hpp:338
datatypes::Object::setObjectAge
void setObjectAge(UINT32 v)
Definition: Object.hpp:137
datatypes::Object::m_maxAbsoluteVelocity
double m_maxAbsoluteVelocity
Classification feature: The maximum observed absolute velocity [m/s].
Definition: Object.hpp:486
datatypes::Object::setRelativeVelocitySigma
void setRelativeVelocitySigma(const Point2D &v)
Definition: Object.hpp:242
datatypes::Object::setObjectBoxSigma
void setObjectBoxSigma(const Point2D &v)
Definition: Object.cpp:157
datatypes::Object::getTotalTrackingDuration
double getTotalTrackingDuration() const
Definition: Object.hpp:397
datatypes::Object::m_closestPoint
Point2D m_closestPoint
The point of this object that is closest to the origin of the vehicle coordinate system.
Definition: Object.hpp:473
Point2D.hpp
datatypes::Object::getBox
Box2D getBox() const
Definition: Object.cpp:85
datatypes::Object::getCourseAngle
double getCourseAngle() const
Definition: Object.hpp:207
datatypes::Object::getObjectBoxVarCovar
void getObjectBoxVarCovar(double &var_x, double &var_y, double &covar_xy) const
Definition: Object.cpp:353
datatypes::Object::setCenterPoint
void setCenterPoint(const Point2D &v)
Definition: Object.hpp:188
datatypes::Object::getObjectMass
double getObjectMass() const
Definition: Object.hpp:353
datatypes::Object::UnknownBig
@ UnknownBig
Definition: Object.hpp:85
datatypes::Object::setMaxAbsoluteVelocity
void setMaxAbsoluteVelocity(double v)
Definition: Object.cpp:412
datatypes::Object::m_relativeVelocity
Point2D m_relativeVelocity
Velocity of this object [meter/seconds], relative to the vehicle coordinate system.
Definition: Object.hpp:462
datatypes::Object::objectClassificationToShortString
static const char * objectClassificationToShortString(ObjectClassification v)
Returns the given classification value as a short string.
Definition: Object.cpp:315
datatypes::Object::ObjectClassification
ObjectClassification
Definition: Object.hpp:81
datatypes::Object::NumClasses
@ NumClasses
Definition: Object.hpp:94
datatypes::Object::Car
@ Car
Definition: Object.hpp:88
datatypes::Object::getObjectId
UINT16 getObjectId() const
Definition: Object.hpp:113
datatypes::Object::setTimestamp
void setTimestamp(const Time &v)
Definition: Object.hpp:152
datatypes::Box2D
A rotated 2-dimensional box in the plane.
Definition: Box2D.hpp:34
datatypes::Object::m_courseAngle
double m_courseAngle
named by ISO 8855; also called Orientation or Heading [rad]
Definition: Object.hpp:460
datatypes::Object::m_vehicleWLANid
UINT64 m_vehicleWLANid
An identifier to be used by WLAN fusion algorithms.
Definition: Object.hpp:478
datatypes::Object::setAbsoluteVelocity
void setAbsoluteVelocity(const Point2D &v)
Definition: Object.cpp:132
datatypes::Object::setObjectHeight
void setObjectHeight(double v)
Definition: Object.hpp:344
datatypes::Object::m_objectBox
Point2D m_objectBox
The object's length and width as a rectangle, relative to the object's coordinate system.
Definition: Object.hpp:467
datatypes::Object::m_objectAge
UINT32 m_objectAge
number of scans in which this object has been tracked, or instead time?
Definition: Object.hpp:450
datatypes::Object::Structure_ConcreteBarrier
@ Structure_ConcreteBarrier
Definition: Object.hpp:93
datatypes::Object::getBoundingBoxCenter
const Point2D & getBoundingBoxCenter() const
Definition: Object.hpp:320
datatypes::Object::setCenterPointSigma
void setCenterPointSigma(const Point2D &v)
Definition: Object.cpp:98
datatypes::ObjectList::ObjectList
ObjectList()
Definition: Object.cpp:451
datatypes::Object::Truck
@ Truck
Definition: Object.hpp:89
datatypes::Object::Unknown
@ Unknown
Definition: Object.hpp:95
datatypes::Object
Definition: Object.hpp:78
datatypes::BasicData
Definition: BasicDatatypes.hpp:95
datatypes::Object::m_classificationAge
UINT32 m_classificationAge
Counts how long the object has been classified in the current classification.
Definition: Object.hpp:455
datatypes::Object::setObjectBox
void setObjectBox(const Point2D &v)
Definition: Object.cpp:150
Box2D.hpp
datatypes::Object::getClassificationQuality
double getClassificationQuality() const
Definition: Object.hpp:166
datatypes::Object::getObjectHeight
double getObjectHeight() const
Definition: Object.hpp:343
datatypes::Object::objectClassificationToStringWithNum
static std::string objectClassificationToStringWithNum(ObjectClassification v)
Returns the given classification value as a string with the integer number included.
Definition: Object.cpp:309
datatypes::Object::getFlags
UINT16 getFlags() const
Definition: Object.hpp:131
datatypes::Object::m_totalTrackingDuration
double m_totalTrackingDuration
Definition: Object.hpp:495
datatypes::Object::getUsedMemory
const UINT32 getUsedMemory() const
Definition: Object.hpp:413
datatypes::Object::setTotalTrackingDuration
void setTotalTrackingDuration(double v)
Definition: Object.cpp:424
datatypes::Object::setRelativeVelocity
void setRelativeVelocity(const Point2D &v)
Definition: Object.hpp:233
datatypes::Object::getCenterPoint
const Point2D & getCenterPoint() const
Definition: Object.hpp:187
datatypes::Object::setClassificationQuality
void setClassificationQuality(double v)
Definition: Object.cpp:91
datatypes::Object::getObjectBoxSigma
const Point2D & getObjectBoxSigma() const
Definition: Object.hpp:297
datatypes::Object::setClosestPoint
void setClosestPoint(const Point2D &v)
Definition: Object.hpp:329
datatypes::Object::Bike
@ Bike
Definition: Object.hpp:87
datatypes::Object::setObjectHeightSigma
void setObjectHeightSigma(double v)
Definition: Object.cpp:176
datatypes::ObjectList::getTimestamp
const Time & getTimestamp() const
Definition: Object.hpp:534
datatypes::Object::m_absoluteVelocity
Point2D m_absoluteVelocity
Velocity of this object [meter/seconds] as absolute velocity; the orientation is relative to the vehi...
Definition: Object.hpp:464
datatypes::Object::m_objectBoxSigma
Point2D m_objectBoxSigma
Definition: Object.hpp:468
datatypes::Object::setObjectMass
void setObjectMass(double v)
Definition: Object.cpp:182
datatypes::Object::setObjectId
void setObjectId(UINT16 v)
Definition: Object.hpp:119
datatypes::Object::m_boundingBox
Point2D m_boundingBox
A rectangle in parallel to the vehicle coordinate system (a paraxial rectangle) that contains (bounds...
Definition: Object.hpp:470
datatypes::Object::m_courseAngleSigma
double m_courseAngleSigma
Definition: Object.hpp:461
datatypes::Object::setClassification
void setClassification(ObjectClassification v)
Definition: Object.hpp:157
datatypes::Object::incrementObjectAge
void incrementObjectAge()
Just increment objectAge by one.
Definition: Object.cpp:407
UINT64
uint64_t UINT64
Definition: BasicDatatypes.hpp:24
datatypes::Object::setHiddenStatusAge
void setHiddenStatusAge(UINT16 v)
Definition: Object.hpp:147
datatypes::Object::getClassification
ObjectClassification getClassification() const
Definition: Object.hpp:156
datatypes::Object::getSerializedSize
std::streamsize getSerializedSize(UINT32 version) const
Size of the serialized representation of this object.
datatypes::ObjectList::incrementObjectAge
void incrementObjectAge()
Just increment objectAge of all objects by one.
Definition: Object.cpp:485
datatypes::Object::getNormalizedMeanPointDist
double getNormalizedMeanPointDist() const
Definition: Object.hpp:391
datatypes::Object::setContourPoints
void setContourPoints(const Polygon2D &v)
Definition: Object.cpp:188
datatypes::Object::~Object
~Object()
Definition: Object.cpp:48
datatypes::Object::getTotalTrackedPathLength
double getTotalTrackedPathLength() const
Definition: Object.hpp:402
datatypes::Object::setClassificationAge
void setClassificationAge(UINT32 v)
Definition: Object.hpp:162
datatypes::Object::getObjectBox
const Point2D & getObjectBox() const
Definition: Object.hpp:273
datatypes::Object::m_flags
UINT16 m_flags
reserved
Definition: Object.hpp:448
datatypes::Object::m_normalizedMeanPointDist
double m_normalizedMeanPointDist
Definition: Object.hpp:491
datatypes::Object::setBoundingBoxCenter
void setBoundingBoxCenter(const Point2D &v)
Definition: Object.cpp:171
datatypes::Object::m_contourPoints
Polygon2D m_contourPoints
A poly-line that describes the outline of the current object measurement.
Definition: Object.hpp:476
datatypes::Object::Structure_GuardRail
@ Structure_GuardRail
Definition: Object.hpp:92
datatypes::Object::m_totalTrackedPathLength
double m_totalTrackedPathLength
Definition: Object.hpp:499
datatypes::Object::toString
std::string toString() const
Definition: Object.cpp:201
datatypes::Object::m_centerPoint
Point2D m_centerPoint
Center point of object rectangle, given in Vehicle coordinate system.
Definition: Object.hpp:458
datatypes::Object::Pedestrian
@ Pedestrian
Definition: Object.hpp:86
datatypes::ObjectList
Definition: Object.hpp:518
datatypes::Object::m_isValid
bool m_isValid
Definition: Object.hpp:508
datatypes::Object::m_boundingBoxCenter
Point2D m_boundingBoxCenter
Center of the bounding box.
Definition: Object.hpp:469
datatypes::ObjectList::operator==
bool operator==(const ObjectList &other) const
Equality predicate.
Definition: Object.cpp:458
datatypes::Object::setFlags
void setFlags(UINT16 v)
Definition: Object.hpp:132
datatypes::Object::m_absoluteVelocitySigma
Point2D m_absoluteVelocitySigma
Definition: Object.hpp:465
datatypes::Object::getHiddenStatusAge
UINT16 getHiddenStatusAge() const
Definition: Object.hpp:142
datatypes::Object::Object
Object()
Definition: Object.cpp:13
datatypes::Object::getClosestPoint
const Point2D & getClosestPoint() const
Definition: Object.hpp:328
datatypes::Object::m_objectHeight
double m_objectHeight
The height of this object in [m] (most probably received through WLAN data).
Definition: Object.hpp:479
datatypes::Object::stringToObjectClassification
static Object::ObjectClassification stringToObjectClassification(const std::string &s)
Definition: Object.cpp:274
datatypes::Object::Structure_Pylon
@ Structure_Pylon
Definition: Object.hpp:90
datatypes::Object::m_classification
ObjectClassification m_classification
The object class that is most likely for this object.
Definition: Object.hpp:454
datatypes::Object::setBoundingBox
void setBoundingBox(const Point2D &v)
Definition: Object.cpp:164
datatypes::Object::isValid
bool isValid() const
Definition: Object.hpp:367
datatypes::Object::operator==
bool operator==(const Object &other) const
Equality predicate.
Definition: Object.cpp:52
datatypes::ObjectList::getUsedMemory
const UINT32 getUsedMemory() const
Definition: Object.hpp:531
datatypes::Object::getObjectAge
UINT32 getObjectAge() const
Definition: Object.hpp:136
Time
Definition: Time.hpp:44
datatypes::Object::getObjectHeightSigma
double getObjectHeightSigma() const
Definition: Object.hpp:348
datatypes::Object::m_hiddenStatusAge
UINT16 m_hiddenStatusAge
Counts how long the object has not been observed but only predicted.
Definition: Object.hpp:451
datatypes::Object::getBoundingBox
const Point2D & getBoundingBox() const
Definition: Object.hpp:314
datatypes::Object::m_timestamp
Time m_timestamp
Time of when the center point of this object was observed.
Definition: Object.hpp:452
datatypes::Object::m_classificationQuality
double m_classificationQuality
The quality of the current classification.
Definition: Object.hpp:456
datatypes::Object::getRelativeVelocitySigma
const Point2D & getRelativeVelocitySigma() const
Definition: Object.hpp:241
datatypes::Object::getTimestamp
const Time & getTimestamp() const
Definition: Object.hpp:151
datatypes::Polygon2D
A polygon of 2D-points.
Definition: Polygon2D.hpp:43
datatypes::ObjectList::setTimestamp
void setTimestamp(const Time &timestamp)
Definition: Object.cpp:466
datatypes::Object::getMeanAbsoluteVelocity
double getMeanAbsoluteVelocity() const
Definition: Object.cpp:437
datatypes::Object::getClassificationAge
UINT32 getClassificationAge() const
Definition: Object.hpp:161
datatypes::Object::setCourseAngleSigma
void setCourseAngleSigma(double v)
Definition: Object.cpp:126
datatypes::Object::isHiddenStatus
bool isHiddenStatus() const
Definition: Object.hpp:146
datatypes::Object::setNormalizedMeanPointDist
void setNormalizedMeanPointDist(double v)
Definition: Object.cpp:418
datatypes::Object::getContourPoints
const Polygon2D & getContourPoints() const
Definition: Object.hpp:333
UINT32
uint32_t UINT32
Definition: BasicDatatypes.hpp:26
datatypes::Object::setValid
void setValid(bool newValue=true)
Definition: Object.hpp:380
datatypes::Object::Unclassified
@ Unclassified
Definition: Object.hpp:83
datatypes::Object::m_relativeVelocitySigma
Point2D m_relativeVelocitySigma
Definition: Object.hpp:463
datatypes::Object::getAbsoluteVelocity
const Point2D & getAbsoluteVelocity() const
Definition: Object.hpp:247
datatypes::Object::getAbsoluteVelocitySigma
const Point2D & getAbsoluteVelocitySigma() const
Definition: Object.hpp:253
datatypes::Object::Structure_Beacon
@ Structure_Beacon
Definition: Object.hpp:91
datatypes::Object::m_objectMass
double m_objectMass
The mass of this object in kilogram
Definition: Object.hpp:482
datatypes::Object::UnknownSmall
@ UnknownSmall
Definition: Object.hpp:84
datatypes::Object::m_centerPointSigma
Point2D m_centerPointSigma
Definition: Object.hpp:459
datatypes::Object::setVehicleWLANid
void setVehicleWLANid(UINT64 v)
Definition: Object.hpp:339
datatypes::ObjectList::base_class
std::vector< Object > base_class
Definition: Object.hpp:523
datatypes::Object::getCenterPointSigma
const Point2D & getCenterPointSigma() const
Definition: Object.hpp:194
datatypes::Object::getRelativeVelocity
const Point2D & getRelativeVelocity() const
Definition: Object.hpp:232
datatypes
Definition: BasicDatatypes.hpp:91
datatypes::Object::getCourseAngleSigma
double getCourseAngleSigma() const
Definition: Object.hpp:224
datatypes::Object::getMaxAbsoluteVelocity
double getMaxAbsoluteVelocity() const
Definition: Object.hpp:385
datatypes::Object::m_objectId
UINT16 m_objectId
Definition: Object.hpp:447
datatypes::Object::m_objectHeightSigma
double m_objectHeightSigma
The standard deviation of the height of this object in [m] (most probably received through WLAN data)...
Definition: Object.hpp:480


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Oct 26 2022 02:11:57