Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximately at the same time as one "snapshot" of the environment.
It can contain "observations" of many different kinds.
New observations can be added using:
The following methods are equivalent for adding new observations to a "sensory frame":
To examine the objects within a sensory frame, the following methods exist:
Notice that contained observations objects are automatically deleted on this object's destruction or clear.
Definition at line 52 of file obs/CSensoryFrame.h.
#include <mrpt/obs/CSensoryFrame.h>
Public Types | |
typedef std::deque< CObservationPtr >::iterator | iterator |
You can use CSensoryFrame::begin to get a iterator to the first element. | |
typedef std::deque< CObservationPtr >::const_iterator | const_iterator |
You can use CSensoryFrame::begin to get a iterator to the first element. | |
Public Member Functions | |
CSensoryFrame () | |
Default constructor. | |
CSensoryFrame (const CSensoryFrame &) | |
Copy constructor. | |
CSensoryFrame & | operator= (const CSensoryFrame &o) |
Copy. | |
virtual | ~CSensoryFrame () |
Destructor. | |
void | clear () |
Clear all current observations. | |
bool | insertObservationsInto (mrpt::maps::CMetricMap *theMap, const mrpt::poses::CPose3D *robotPose=NULL) const |
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap). | |
bool | insertObservationsInto (mrpt::maps::CMetricMapPtr &theMap, const mrpt::poses::CPose3D *robotPose=NULL) const |
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap). | |
void | operator+= (const CSensoryFrame &sf) |
You can use "sf1+=sf2;" to add observations in sf2 to sf1. | |
void | operator+= (const CObservationPtr &obs) |
You can use "sf+=obs;" to add the observation "obs" to the "sf1". | |
void | moveFrom (CSensoryFrame &sf) |
Copies all the observation from another object, then erase them from the origin object (this method is fast since only pointers are copied); Previous objects in this objects are not deleted. | |
void | push_back (const CObservationPtr &obs) |
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the passed object, this class will do at destructor or when appropriate. | |
void | insert (const CObservationPtr &obs) |
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the passed object, this class will do at destructor or when appropriate. | |
template<typename T > | |
T::SmartPtr | getObservationByClass (const size_t &ith=0) const |
Returns the i'th observation of a given class (or of a descendant class), or NULL if there is no such observation in the array. | |
const_iterator | begin () const |
Returns a iterator to the first observation: this is an example of usage: | |
const_iterator | end () const |
Returns a iterator to the end of the list of observations: this is an example of usage: | |
iterator | begin () |
Returns a iterator to the first observation: this is an example of usage: | |
iterator | end () |
Returns a iterator to the end of the list of observations: this is an example of usage: | |
size_t | size () const |
Returns the number of observations in the list. | |
bool | empty () const |
Returns true if there are no observations in the list. | |
void | eraseByIndex (const size_t &idx) |
Removes the i'th observation in the list (0=first). | |
iterator | erase (const iterator &it) |
Removes the given observation in the list, and return an iterator to the next element (or this->end() if it was the last one). | |
void | eraseByLabel (const std::string &label) |
Removes all the observations that match a given sensorLabel. | |
CObservationPtr | getObservationByIndex (const size_t &idx) const |
Returns the i'th observation in the list (0=first). | |
template<typename T > | |
T | getObservationByIndexAs (const size_t &idx) const |
Returns the i'th observation in the list (0=first), and as a different smart pointer type: | |
CObservationPtr | getObservationBySensorLabel (const std::string &label, const size_t &idx=0) const |
Returns the i'th observation in the list with the given "sensorLabel" (0=first). | |
template<typename T > | |
T | getObservationBySensorLabelAs (const std::string &label, const size_t &idx=0) const |
Returns the i'th observation in the list with the given "sensorLabel" (0=first), and as a different smart pointer type: | |
void | swap (CSensoryFrame &sf) |
Efficiently swaps the contents of two objects. | |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE |
void | readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE |
Protected Attributes | |
std::deque< CObservationPtr > | m_observations |
The set of observations taken at the same time instant. | |
RTTI stuff <br> | |
typedef CSensoryFramePtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CSensoryFrame |
static mrpt::utils::TRuntimeClassId | classCSensoryFrame |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const MRPT_OVERRIDE |
virtual mrpt::utils::CObject * | duplicate () const MRPT_OVERRIDE |
static mrpt::utils::CObject * | CreateObject () |
static CSensoryFramePtr | Create () |
Cached points map | |
| |
mrpt::maps::CMetricMapPtr | m_cachedMap |
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap(). | |
template<class POINTSMAP > | |
const POINTSMAP * | getAuxPointsMap () const |
Returns the cached points map representation of the scan, if already build with buildAuxPointsMap(), or NULL otherwise. | |
template<class POINTSMAP > | |
const POINTSMAP * | buildAuxPointsMap (const void *options=NULL) const |
Returns a cached points map representing this laser scan, building it upon the first call. | |
void | internal_buildAuxPointsMap (const void *options=NULL) const |
Internal method, used from buildAuxPointsMap() | |
typedef std::deque<CObservationPtr>::const_iterator mrpt::obs::CSensoryFrame::const_iterator |
You can use CSensoryFrame::begin to get a iterator to the first element.
Definition at line 197 of file obs/CSensoryFrame.h.
typedef std::deque<CObservationPtr>::iterator mrpt::obs::CSensoryFrame::iterator |
You can use CSensoryFrame::begin to get a iterator to the first element.
Definition at line 193 of file obs/CSensoryFrame.h.
A typedef for the associated smart pointer
Definition at line 55 of file obs/CSensoryFrame.h.
mrpt::obs::CSensoryFrame::CSensoryFrame | ( | ) |
Default constructor.
mrpt::obs::CSensoryFrame::CSensoryFrame | ( | const CSensoryFrame & | ) |
Copy constructor.
|
virtual |
Destructor.
|
staticprotected |
|
inline |
Returns a iterator to the first observation: this is an example of usage:
Definition at line 236 of file obs/CSensoryFrame.h.
|
inline |
Returns a iterator to the first observation: this is an example of usage:
Definition at line 210 of file obs/CSensoryFrame.h.
|
inline |
Returns a cached points map representing this laser scan, building it upon the first call.
options | Can be NULL to use default point maps' insertion options, or a pointer to a "CPointsMap::TInsertionOptions" structure to override some params. Usage: mrpt::maps::CPointsMap *map = sf->buildAuxPointsMap<mrpt::maps::CPointsMap>(&options or NULL);
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors. Definition: maps/CPointsMap.h:61 |
Definition at line 99 of file obs/CSensoryFrame.h.
void mrpt::obs::CSensoryFrame::clear | ( | ) |
Clear all current observations.
|
static |
|
static |
|
virtual |
|
inline |
Returns true if there are no observations in the list.
Definition at line 256 of file obs/CSensoryFrame.h.
|
inline |
Returns a iterator to the end of the list of observations: this is an example of usage:
Definition at line 249 of file obs/CSensoryFrame.h.
|
inline |
Returns a iterator to the end of the list of observations: this is an example of usage:
Definition at line 223 of file obs/CSensoryFrame.h.
Removes the given observation in the list, and return an iterator to the next element (or this->end() if it was the last one).
void mrpt::obs::CSensoryFrame::eraseByIndex | ( | const size_t & | idx | ) |
Removes the i'th observation in the list (0=first).
void mrpt::obs::CSensoryFrame::eraseByLabel | ( | const std::string & | label | ) |
Removes all the observations that match a given sensorLabel.
|
inline |
Returns the cached points map representation of the scan, if already build with buildAuxPointsMap(), or NULL otherwise.
Usage:
Definition at line 86 of file obs/CSensoryFrame.h.
|
inline |
Returns the i'th observation of a given class (or of a descendant class), or NULL if there is no such observation in the array.
Example:
By default (ith=0), the first observation is returned.
Definition at line 178 of file obs/CSensoryFrame.h.
References begin(), end(), MRPT_END, and MRPT_START.
CObservationPtr mrpt::obs::CSensoryFrame::getObservationByIndex | ( | const size_t & | idx | ) | const |
|
inline |
Returns the i'th observation in the list (0=first), and as a different smart pointer type:
Definition at line 281 of file obs/CSensoryFrame.h.
CObservationPtr mrpt::obs::CSensoryFrame::getObservationBySensorLabel | ( | const std::string & | label, |
const size_t & | idx = 0 |
||
) | const |
|
inline |
Returns the i'th observation in the list with the given "sensorLabel" (0=first), and as a different smart pointer type:
Definition at line 299 of file obs/CSensoryFrame.h.
|
virtual |
void mrpt::obs::CSensoryFrame::insert | ( | const CObservationPtr & | obs | ) |
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the passed object, this class will do at destructor or when appropriate.
bool mrpt::obs::CSensoryFrame::insertObservationsInto | ( | mrpt::maps::CMetricMap * | theMap, |
const mrpt::poses::CPose3D * | robotPose = NULL |
||
) | const |
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap).
It calls CObservation::insertObservationInto for all stored observation.
theMap | The map where this observation is to be inserted: the map will be updated. |
robotPose | The pose of the robot base for this observation, relative to the target metric map. Set to NULL (default) to use (0,0,0deg) |
|
inline |
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap).
It calls CObservation::insertObservationInto for all stored observation.
theMap | The map where this observation is to be inserted: the map will be updated. |
robotPose | The pose of the robot base for this observation, relative to the target metric map. Set to NULL (default) to use (0,0,0deg) |
Definition at line 141 of file obs/CSensoryFrame.h.
|
protected |
Internal method, used from buildAuxPointsMap()
void mrpt::obs::CSensoryFrame::moveFrom | ( | CSensoryFrame & | sf | ) |
Copies all the observation from another object, then erase them from the origin object (this method is fast since only pointers are copied); Previous objects in this objects are not deleted.
void mrpt::obs::CSensoryFrame::operator+= | ( | const CObservationPtr & | obs | ) |
You can use "sf+=obs;" to add the observation "obs" to the "sf1".
Objects are copied, using the smart pointer, thus the original pointer can be safely deleted next.
void mrpt::obs::CSensoryFrame::operator+= | ( | const CSensoryFrame & | sf | ) |
You can use "sf1+=sf2;" to add observations in sf2 to sf1.
Objects are copied, not referenced, thus the source can be safely deleted next.
CSensoryFrame & mrpt::obs::CSensoryFrame::operator= | ( | const CSensoryFrame & | o | ) |
Copy.
void mrpt::obs::CSensoryFrame::push_back | ( | const CObservationPtr & | obs | ) |
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the passed object, this class will do at destructor or when appropriate.
|
protected |
|
inline |
Returns the number of observations in the list.
Definition at line 253 of file obs/CSensoryFrame.h.
void mrpt::obs::CSensoryFrame::swap | ( | CSensoryFrame & | sf | ) |
Efficiently swaps the contents of two objects.
|
protected |
|
staticprotected |
Definition at line 55 of file obs/CSensoryFrame.h.
|
static |
Definition at line 55 of file obs/CSensoryFrame.h.
|
static |
Definition at line 55 of file obs/CSensoryFrame.h.
|
mutableprotected |
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
It's a generic smart pointer to avoid depending here in the library mrpt-obs on classes on other libraries.
Definition at line 72 of file obs/CSensoryFrame.h.
|
protected |
The set of observations taken at the same time instant.
See the top of this page for instructions on accessing this.
Definition at line 312 of file obs/CSensoryFrame.h.
Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 04:35:51 UTC 2023 |