10 #ifndef CDetectableObject_H 11 #define CDetectableObject_H 15 #define _USE_MATH_DEFINES // (For VS to define M_PI, etc. in cmath) 39 mrpt::obs::CObservationPtr obs;
41 inline
void setObservation(
mrpt::obs::CObservationPtr newObs ){ obs = newObs; };
56 float m_height, m_width;
59 CDetectable2D( const
int &x = 0, const
int &y = 0, const
int &height = 0, const
int &width = 0 )
60 : m_x(x), m_y(y), m_height(height), m_width(width)
75 double c_x1 = ( m_x + m_width/2 );
77 double c_y1 = ( m_y + m_height/2 ) ;
80 return std::sqrt( std::pow( c_x1 - c_x2, 2 ) + pow( c_y1 - c_y2, 2 ) );
The virtual base class which provides a unified interface for all persistent objects in MRPT...
double distanceTo(const CDetectable2D &d2)
Compute distance between centers of two detectable 2D objects.
float m_z
Z coordinate of detected object.
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
float m_width
Size of detected object.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
CDetectable2D(const CDetectable2D *d)
Copy pointer content constructor.
float m_y
2D Coordinates of detected object
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CDetectable3D(const CDetectable3D *d)
Copy pointer content constructor.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Base class that contains common atributes and functions of detectable objects.