50 if (
this == &o)
return *
this;
114 if (version == 0)
in.ReadBufferFixEndianness(&tempTimeStamp, 1);
123 for (i = 0; i <
n; i++)
146 newObs.reset(dynamic_cast<CObservation*>(newObs->clone()));
187 "Index %u out of range.", static_cast<unsigned>(idx));
205 "Index %u out of range.", static_cast<unsigned>(idx));
235 size_t foundCount = 0;
237 if (!
os::_strcmpi((*it)->sensorLabel.c_str(), label.c_str()))
238 if (foundCount++ == idx)
return *it;
273 if (!
os::_strcmpi((*it)->sensorLabel.c_str(), label.c_str()))
303 throw std::runtime_error(
304 "[CSensoryFrame::buildAuxPointsMap] ERROR: This function needs " 305 "linking against mrpt-maps.\n");
319 anyone |= (*it)->insertObservationInto(theMap, robotPose);
void clear()
Clear all current observations.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
void insert(const CObservation::Ptr &obs)
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the p...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
void push_back(const CObservation::Ptr &obs)
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the p...
CSensoryFrame()
Default constructor.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
scan2pts_functor ptr_internal_build_points_map_from_scan2D
void moveFrom(CSensoryFrame &sf)
Copies all the observation from another object, then erase them from the origin object (this method i...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
CSensoryFrame & operator=(const CSensoryFrame &o)
Copy.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
iterator erase(const iterator &it)
Removes the given observation in the list, and return an iterator to the next element (or this->end()...
const_iterator begin() const
Returns a constant iterator to the first observation: this is an example of usage: ...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
void swap(CSensoryFrame &sf)
Efficiently swaps the contents of two objects.
std::shared_ptr< CMetricMap > Ptr
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
virtual ~CSensoryFrame()
Destructor.
void eraseByIndex(const size_t &idx)
Removes the i'th observation in the list (0=first).
void operator+=(const CSensoryFrame &sf)
You can use "sf1+=sf2;" to add observations in sf2 to sf1.
This namespace contains representation of robot actions and observations.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
std::shared_ptr< CObservation > Ptr
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
CObservation::Ptr 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).
Declares a virtual base class for all metric maps storage classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
#define IS_CLASS(ptrObj, class_name)
Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of t...
std::deque< CObservation::Ptr >::const_iterator const_iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
void(*)(const mrpt::obs::CObservation2DRangeScan &obs, mrpt::maps::CMetricMap::Ptr &out_map, const void *insertOps) scan2pts_functor
std::deque< CObservation::Ptr >::iterator iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
const_iterator end() const
Returns a constant iterator to the end of the list of observations: this is an example of usage: ...
CObservation::Ptr getObservationByIndex(const size_t &idx) const
Returns the i'th observation in the list (0=first).
unsigned __int32 uint32_t
bool insertObservationsInto(mrpt::maps::CMetricMap *theMap, const mrpt::poses::CPose3D *robotPose=nullptr) const
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap).
size_t size() const
Returns the number of observations in the list.
std::deque< CObservation::Ptr > m_observations
The set of observations taken at the same time instant.
void eraseByLabel(const std::string &label)
Removes all the observations that match a given sensorLabel.
int _strcmpi(const char *str1, const char *str2) noexcept
An OS-independent version of strcmpi.
void internal_buildAuxPointsMap(const void *options=nullptr) const
Internal method, used from buildAuxPointsMap()