35 if (
this == &o)
return *
this;
44 m_observations.clear();
52 for (
const auto& o : m_observations)
79 if (version == 0)
in.ReadBufferFixEndianness(&tempTimeStamp, 1);
82 m_observations.resize(
n);
84 m_observations.begin(), m_observations.end(),
89 for (i = 0; i <
n; i++)
90 m_observations[i]->timestamp = tempTimeStamp;
112 newObs.reset(dynamic_cast<CObservation*>(newObs->clone()));
113 m_observations.push_back(
124 m_observations.push_back(obs);
133 m_observations.push_back(obs);
142 m_observations.push_back(obs);
153 "Index %u out of range.", static_cast<unsigned>(idx));
159 m_observations.erase(it);
171 "Index %u out of range.", static_cast<unsigned>(idx));
188 return m_observations.erase(it);
200 size_t foundCount = 0;
202 if (!
os::_strcmpi((*it)->sensorLabel.c_str(), label.c_str()))
203 if (foundCount++ == idx)
return *it;
217 back_inserter(m_observations));
238 if (!
os::_strcmpi((*it)->sensorLabel.c_str(), label.c_str()))
265 throw std::runtime_error(
266 "[CSensoryFrame::buildAuxPointsMap] ERROR: This function needs " 267 "linking against mrpt-maps.\n");
281 anyone |= (*it)->insertObservationInto(theMap, robotPose);
void clear()
Clear all current observations.
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...
std::deque< CObservation::Ptr >::iterator iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
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...
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.
EIGEN_STRONG_INLINE iterator begin()
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
void WriteAs(const TYPE_FROM_ACTUAL &value)
iterator erase(const iterator &it)
Removes the given observation in the list, and return an iterator to the next element (or this->end()...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define ASSERT_(f)
Defines an assertion mechanism.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
void swap(CSensoryFrame &sf)
Efficiently swaps the contents of two objects.
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.
std::deque< CObservation::Ptr >::const_iterator const_iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
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...
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).
Virtual base class for "archives": classes abstracting I/O streams.
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::rtti::CObject) is of the give...
void(*)(const mrpt::obs::CObservation2DRangeScan &obs, mrpt::maps::CMetricMap::Ptr &out_map, const void *insertOps) scan2pts_functor
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
CObservation::Ptr getObservationByIndex(const size_t &idx) const
Returns the i'th observation in the list (0=first).
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
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).
void clear()
Clear the contents of this container.
std::deque< CObservation::Ptr > m_observations
The set of observations taken at the same time instant.
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
void eraseByLabel(const std::string &label)
Removes all the observations that match a given sensorLabel.
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
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()