6 #include "../tools/errorhandler.hpp" 7 #include "../tools/MathToolbox.hpp" 17 , m_hiddenStatusAge(0)
19 , m_classification(
Object::Unclassified)
20 , m_classificationAge(0)
21 , m_classificationQuality(0.0f)
23 , m_centerPointSigma(
Point2D(0, 0))
25 , m_courseAngleSigma(0.0f)
26 , m_relativeVelocity(
Point2D(0, 0))
27 , m_relativeVelocitySigma(
Point2D(0, 0))
28 , m_absoluteVelocity(
Point2D(0, 0))
29 , m_absoluteVelocitySigma(
Point2D(0, 0))
31 , m_objectBoxSigma(
Point2D(0, 0))
32 , m_boundingBoxCenter(
Point2D(0, 0))
38 , m_objectHeightSigma(0)
41 , m_normalizedMeanPointDist(0)
42 , m_totalTrackingDuration(0)
43 , m_totalTrackedPathLength(0)
111 " which is outside of its [-pi,pi] definition range (but the calling function should have ensured to normalize into that interval) - normalizing it back into that range now (" +
113 new_angle = normd_angle;
135 double absolute = v.
dist();
190 assert(v.size() <= 0xff);
203 std::string text =
"Object: ";
249 #define TYPE_TO_STR(tstr) tstr : return #tstr 269 throw std::invalid_argument(
"Unknown object classification " + ::
toString(
int(v)));
276 if (s ==
"Unclassified" || s ==
"Unclass")
278 else if (s ==
"UnknownSmall" || s ==
"us")
280 else if (s ==
"UnknownBig" || s ==
"UB")
282 else if (s ==
"Pedestrian" || s ==
"Ped")
284 else if (s ==
"Bike")
288 else if (s ==
"Truck")
290 else if (s ==
"Structure_Pylon" || s ==
"Pylon")
292 else if (s ==
"Structure_Beacon" || s ==
"Bcn")
294 else if (s ==
"Structure_GuardRail" || s ==
"GrdRl")
296 else if (s ==
"Structure_ConcreteBarrier" || s ==
"CBar")
298 else if (s ==
"NumClasses" || s ==
"#Classes")
300 else if (s ==
"Unknown")
304 throw std::invalid_argument(
"Unknown object classification string \"" + s +
"\"");
346 throw std::invalid_argument(
"Unknown object classification " + ::
toString(
int(v)));
362 double cos_sq =
sqr(dCos);
363 double sin_sq =
sqr(dSin);
364 double cos_sin = dCos * dSin;
368 var_x = cos_sq * var_x_obj + sin_sq * var_y_obj;
369 covar_xy = -cos_sin * var_x_obj + cos_sin * var_y_obj;
370 var_y = sin_sq * var_x_obj + cos_sq * var_y_obj;
488 for (obj = begin(); obj != end(); obj++)
490 obj->incrementObjectAge();
void incrementObjectAge()
Just increment objectAge by one.
double getCourseAngle() const
void setObjectBox(const Point2D &v)
std::string toString(UINT16 digits=2) const
Text output for debugging.
double m_courseAngleSigma
Point2D m_relativeVelocitySigma
Point2D m_absoluteVelocitySigma
double m_objectHeight
The height of this object in [m] (most probably received through WLAN data).
std::string toString() const
Text output for debugging.
double m_totalTrackedPathLength
A rotated 2-dimensional box in the plane.
void setTotalTrackedPathLength(double v)
const Point2D & getCenterPoint() const
std::string toString() const
static const char * objectClassificationToShortString(ObjectClassification v)
Returns the given classification value as a short string.
void setAbsoluteVelocity(const Point2D &v)
Point2D m_boundingBoxCenter
Center of the bounding box.
void setCourseAngleSigma(double v)
Point2D m_closestPoint
The point of this object that is closest to the origin of the vehicle coordinate system.
Point2D m_boundingBox
A rectangle in parallel to the vehicle coordinate system (a paraxial rectangle) that contains (bounds...
const Point2D & getObjectBox() const
void setBoundingBoxCenter(const Point2D &v)
static Object::ObjectClassification stringToObjectClassification(const std::string &s)
void getObjectBoxVarCovar(double &var_x, double &var_y, double &covar_xy) const
Point2D m_centerPoint
Center point of object rectangle, given in Vehicle coordinate system.
bool operator==(const Object &other) const
Equality predicate.
void addContourPoint(const Point2D cp)
UINT32 m_classificationAge
Counts how long the object has been classified in the current classification.
void setClassificationQuality(double v)
bool operator==(const ObjectList &other) const
Equality predicate.
void incrementObjectAge()
Just increment objectAge of all objects by one.
Polygon2D m_contourPoints
A poly-line that describes the outline of the current object measurement.
double getMeanAbsoluteVelocity() const
double getMaxAbsoluteVelocity() const
#define TYPE_TO_STR(tstr)
void setNormalizedMeanPointDist(double v)
double m_maxAbsoluteVelocity
Classification feature: The maximum observed absolute velocity [m/s].
Point2D m_absoluteVelocity
Velocity of this object [meter/seconds] as absolute velocity; the orientation is relative to the vehi...
static std::string objectClassificationToStringWithNum(ObjectClassification v)
Returns the given classification value as a string with the integer number included.
void setTotalTrackingDuration(double v)
void setContourPoints(const Polygon2D &v)
double m_objectMass
The mass of this object in kilogram
ObjectClassification m_classification
The object class that is most likely for this object.
void setAbsoluteVelocitySigma(const Point2D &v)
const Point2D & getObjectBoxSigma() const
static const char * objectClassificationToString(ObjectClassification v)
Returns the given classification value as a string.
UINT32 m_objectAge
number of scans in which this object has been tracked, or instead time?
void setTimestamp(const Time ×tamp)
void setCenterPointSigma(const Point2D &v)
UINT16 m_hiddenStatusAge
Counts how long the object has not been observed but only predicted.
double m_totalTrackingDuration
double m_normalizedMeanPointDist
void setObjectHeightSigma(double v)
void setMaxAbsoluteVelocity(double v)
void setObjectMass(double v)
Point2D m_relativeVelocity
Velocity of this object [meter/seconds], relative to the vehicle coordinate system.
void setBoundingBox(const Point2D &v)
Point2D m_objectBox
The object's length and width as a rectangle, relative to the object's coordinate system...
double m_objectHeightSigma
The standard deviation of the height of this object in [m] (most probably received through WLAN data)...
double m_classificationQuality
The quality of the current classification.
void setCourseAngle(double newCourseAngle)
void printWarning(std::string message)
std::string toString() const
double m_courseAngle
named by ISO 8855; also called Orientation or Heading [rad]
UINT64 m_vehicleWLANid
An identifier to be used by WLAN fusion algorithms.
Point2D m_centerPointSigma
Time m_timestamp
Time of when the center point of this object was observed.
std::vector< Object > base_class
void setObjectBoxSigma(const Point2D &v)