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
UINT16 m_objectId
Definition: Object.hpp:447
void setObjectId(UINT16 v)
Definition: Object.hpp:119
void incrementObjectAge()
Just increment objectAge by one.
Definition: Object.cpp:407
double getCourseAngle() const
Definition: Object.hpp:207
void setObjectBox(const Point2D &v)
Definition: Object.cpp:150
double m_courseAngleSigma
Definition: Object.hpp:461
Point2D m_relativeVelocitySigma
Definition: Object.hpp:463
Point2D m_absoluteVelocitySigma
Definition: Object.hpp:465
const Point2D & getAbsoluteVelocitySigma() const
Definition: Object.hpp:253
double m_objectHeight
The height of this object in [m] (most probably received through WLAN data).
Definition: Object.hpp:479
const Point2D & getAbsoluteVelocity() const
Definition: Object.hpp:247
const Polygon2D & getContourPoints() const
Definition: Object.hpp:333
uint16_t UINT16
double m_totalTrackedPathLength
Definition: Object.hpp:499
A rotated 2-dimensional box in the plane.
Definition: Box2D.hpp:34
void setTotalTrackedPathLength(double v)
Definition: Object.cpp:430
const Point2D & getCenterPointSigma() const
Definition: Object.hpp:194
void setObjectHeight(double v)
Definition: Object.hpp:344
double getTotalTrackedPathLength() const
Definition: Object.hpp:402
void setRelativeVelocity(const Point2D &v)
Definition: Object.hpp:233
double getObjectHeight() const
Definition: Object.hpp:343
Definition: Time.hpp:44
const Point2D & getCenterPoint() const
Definition: Object.hpp:187
void setVehicleWLANid(UINT64 v)
Definition: Object.hpp:339
std::string toString() const
Definition: Object.cpp:201
static const char * objectClassificationToShortString(ObjectClassification v)
Returns the given classification value as a short string.
Definition: Object.cpp:315
bool isHiddenStatus() const
Definition: Object.hpp:146
uint32_t UINT32
void setAbsoluteVelocity(const Point2D &v)
Definition: Object.cpp:132
UINT32 getObjectAge() const
Definition: Object.hpp:136
A polygon of 2D-points.
Definition: Polygon2D.hpp:43
Point2D m_boundingBoxCenter
Center of the bounding box.
Definition: Object.hpp:469
double getClassificationQuality() const
Definition: Object.hpp:166
void setCourseAngleSigma(double v)
Definition: Object.cpp:126
void setObjectAge(UINT32 v)
Definition: Object.hpp:137
const UINT32 getUsedMemory() const
Definition: Object.hpp:531
void setCenterPoint(const Point2D &v)
Definition: Object.hpp:188
double getCourseAngleSigma() const
Definition: Object.hpp:224
Point2D m_closestPoint
The point of this object that is closest to the origin of the vehicle coordinate system.
Definition: Object.hpp:473
Point2D m_boundingBox
A rectangle in parallel to the vehicle coordinate system (a paraxial rectangle) that contains (bounds...
Definition: Object.hpp:470
const Point2D & getObjectBox() const
Definition: Object.hpp:273
bool isValid() const
Definition: Object.hpp:367
void setClassificationAge(UINT32 v)
Definition: Object.hpp:162
UINT16 getFlags() const
Definition: Object.hpp:131
void setBoundingBoxCenter(const Point2D &v)
Definition: Object.cpp:171
static Object::ObjectClassification stringToObjectClassification(const std::string &s)
Definition: Object.cpp:274
UINT16 getObjectId() const
Definition: Object.hpp:113
const Point2D & getRelativeVelocitySigma() const
Definition: Object.hpp:241
void getObjectBoxVarCovar(double &var_x, double &var_y, double &covar_xy) const
Definition: Object.cpp:353
UINT64 getVehicleWLANid() const
Definition: Object.hpp:338
UINT16 m_flags
reserved
Definition: Object.hpp:448
Point2D m_centerPoint
Center point of object rectangle, given in Vehicle coordinate system.
Definition: Object.hpp:458
bool operator==(const Object &other) const
Equality predicate.
Definition: Object.cpp:52
Box2D getBox() const
Definition: Object.cpp:85
ObjectClassification getClassification() const
Definition: Object.hpp:156
void addContourPoint(const Point2D cp)
Definition: Object.cpp:194
UINT32 m_classificationAge
Counts how long the object has been classified in the current classification.
Definition: Object.hpp:455
void setClassificationQuality(double v)
Definition: Object.cpp:91
void setTimestamp(const Time &v)
Definition: Object.hpp:152
const Point2D & getRelativeVelocity() const
Definition: Object.hpp:232
const Point2D & getBoundingBoxCenter() const
Definition: Object.hpp:320
Polygon2D m_contourPoints
A poly-line that describes the outline of the current object measurement.
Definition: Object.hpp:476
double getMeanAbsoluteVelocity() const
Definition: Object.cpp:437
double getMaxAbsoluteVelocity() const
Definition: Object.hpp:385
const UINT32 getUsedMemory() const
Definition: Object.hpp:413
UINT16 getHiddenStatusAge() const
Definition: Object.hpp:142
UINT32 getClassificationAge() const
Definition: Object.hpp:161
void setNormalizedMeanPointDist(double v)
Definition: Object.cpp:418
double m_maxAbsoluteVelocity
Classification feature: The maximum observed absolute velocity [m/s].
Definition: Object.hpp:486
double getObjectMass() const
Definition: Object.hpp:353
Point2D m_absoluteVelocity
Velocity of this object [meter/seconds] as absolute velocity; the orientation is relative to the vehi...
Definition: Object.hpp:464
static std::string objectClassificationToStringWithNum(ObjectClassification v)
Returns the given classification value as a string with the integer number included.
Definition: Object.cpp:309
void setTotalTrackingDuration(double v)
Definition: Object.cpp:424
void setContourPoints(const Polygon2D &v)
Definition: Object.cpp:188
double m_objectMass
The mass of this object in kilogram
Definition: Object.hpp:482
const Point2D & getClosestPoint() const
Definition: Object.hpp:328
ObjectClassification m_classification
The object class that is most likely for this object.
Definition: Object.hpp:454
const Point2D & getBoundingBox() const
Definition: Object.hpp:314
std::streamsize getSerializedSize(UINT32 version) const
Size of the serialized representation of this object.
const Time & getTimestamp() const
Definition: Object.hpp:534
void setClosestPoint(const Point2D &v)
Definition: Object.hpp:329
void setAbsoluteVelocitySigma(const Point2D &v)
Definition: Object.cpp:143
const Point2D & getObjectBoxSigma() const
Definition: Object.hpp:297
static const char * objectClassificationToString(ObjectClassification v)
Returns the given classification value as a string.
Definition: Object.cpp:251
double getNormalizedMeanPointDist() const
Definition: Object.hpp:391
void setRelativeVelocitySigma(const Point2D &v)
Definition: Object.hpp:242
void setClassification(ObjectClassification v)
Definition: Object.hpp:157
UINT32 m_objectAge
number of scans in which this object has been tracked, or instead time?
Definition: Object.hpp:450
void setCenterPointSigma(const Point2D &v)
Definition: Object.cpp:98
UINT16 m_hiddenStatusAge
Counts how long the object has not been observed but only predicted.
Definition: Object.hpp:451
void setHiddenStatusAge(UINT16 v)
Definition: Object.hpp:147
double m_totalTrackingDuration
Definition: Object.hpp:495
double m_normalizedMeanPointDist
Definition: Object.hpp:491
double getTotalTrackingDuration() const
Definition: Object.hpp:397
void setObjectHeightSigma(double v)
Definition: Object.cpp:176
void setMaxAbsoluteVelocity(double v)
Definition: Object.cpp:412
void setValid(bool newValue=true)
Definition: Object.hpp:380
const Time & getTimestamp() const
Definition: Object.hpp:151
void setObjectMass(double v)
Definition: Object.cpp:182
Point2D m_relativeVelocity
Velocity of this object [meter/seconds], relative to the vehicle coordinate system.
Definition: Object.hpp:462
void setBoundingBox(const Point2D &v)
Definition: Object.cpp:164
Point2D m_objectBox
The object&#39;s length and width as a rectangle, relative to the object&#39;s coordinate system...
Definition: Object.hpp:467
void setFlags(UINT16 v)
Definition: Object.hpp:132
double m_objectHeightSigma
The standard deviation of the height of this object in [m] (most probably received through WLAN data)...
Definition: Object.hpp:480
double m_classificationQuality
The quality of the current classification.
Definition: Object.hpp:456
void setCourseAngle(double newCourseAngle)
Definition: Object.cpp:105
uint64_t UINT64
double getObjectHeightSigma() const
Definition: Object.hpp:348
double m_courseAngle
named by ISO 8855; also called Orientation or Heading [rad]
Definition: Object.hpp:460
UINT64 m_vehicleWLANid
An identifier to be used by WLAN fusion algorithms.
Definition: Object.hpp:478
Point2D m_centerPointSigma
Definition: Object.hpp:459
Time m_timestamp
Time of when the center point of this object was observed.
Definition: Object.hpp:452
std::vector< Object > base_class
Definition: Object.hpp:523
void setObjectBoxSigma(const Point2D &v)
Definition: Object.cpp:157
Point2D m_objectBoxSigma
Definition: Object.hpp:468


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Sat Jun 8 2019 17:57:33