Go to the documentation of this file.
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; };
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 ) );
CDetectable3D(const CDetectable3D *d)
Copy pointer content constructor.
double distanceTo(const CDetectable2D &d2)
Compute distance between centers of two detectable 2D objects.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string m_id
Must be an unique id for each detectable object.
float m_width
Size of detected object.
CDetectable2D(const int &x=0, const int &y=0, const int &height=0, const int &width=0)
Extra constructor.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
void setObservation(mrpt::obs::CObservationPtr newObs)
#define DEFINE_VIRTUAL_SERIALIZABLE(class_name)
This declaration must be inserted in virtual CSerializable classes definition:
The virtual base class which provides a unified interface for all persistent objects in MRPT.
mrpt::obs::CObservationPtr obs
Observation wich contain the deteted 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
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Base class that contains common atributes and functions of detectable objects.
Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 23:11:08 UTC 2019 | | |