Class CObservation

Inheritance Relationships

Base Types

  • public mrpt::serialization::CSerializable

  • public mrpt::Stringifyable

Derived Types

Class Documentation

class CObservation : public mrpt::serialization::CSerializable, public mrpt::Stringifyable

Subclassed by mrpt::obs::CObservation2DRangeScan, mrpt::obs::CObservation3DRangeScan, mrpt::obs::CObservation3DScene, mrpt::obs::CObservation6DFeatures, mrpt::obs::CObservationBatteryState, mrpt::obs::CObservationBeaconRanges, mrpt::obs::CObservationBearingRange, mrpt::obs::CObservationCANBusJ1939, mrpt::obs::CObservationComment, mrpt::obs::CObservationGPS, mrpt::obs::CObservationGasSensors, mrpt::obs::CObservationIMU, mrpt::obs::CObservationImage, mrpt::obs::CObservationOdometry, mrpt::obs::CObservationRFID, mrpt::obs::CObservationRGBD360, mrpt::obs::CObservationRange, mrpt::obs::CObservationRawDAQ, mrpt::obs::CObservationReflectivity, mrpt::obs::CObservationRobotPose, mrpt::obs::CObservationRotatingScan, mrpt::obs::CObservationSkeleton, mrpt::obs::CObservationStereoImages, mrpt::obs::CObservationStereoImagesFeatures, mrpt::obs::CObservationVelodyneScan, mrpt::obs::CObservationWindSensor, mrpt::obs::CObservationWirelessPower

Data common to any observation

mrpt::system::TTimeStamp timestamp = {mrpt::Clock::now()}

The associated UTC time-stamp. Where available, this should contain the accurate satellite-based timestamp of the sensor reading.

std::string sensorLabel

An arbitrary label that can be used to identify the sensor.

inline mrpt::system::TTimeStamp getTimeStamp() const

Returns CObservation::timestamp for all kind of observations

inline virtual mrpt::system::TTimeStamp getOriginalReceivedTimeStamp() const

By default, returns CObservation::timestamp but in sensors capable of satellite (or otherwise) accurate UTC timing of readings, this contains the computer-based timestamp of reception, which may be slightly different than timestamp

See also

getTimeStamp()

Delayed-load manual control methods.

inline virtual void load_impl() const
inline void load() const

Makes sure all images and other fields which may be externally stored are loaded in memory. Note that for all CImages, calling load() is not required since the images will be automatically loaded upon first access, so load() shouldn’t be needed to be called in normal cases by the user. If all the data were alredy loaded or this object has no externally stored data fields, calling this method has no effects.

See also

unload

inline virtual void unload() const

Unload all images, for the case they being delayed-load images stored in external files (otherwise, has no effect).

See also

load

Export to TXT/CSV API (see the rawlog-edit app)

inline virtual bool exportTxtSupported() const

Must return true if the class is exportable to TXT/CSV files, in which case the other virtual methods in this group must be redefined too.

inline virtual std::string exportTxtHeader() const

Returns the description of the data columns. Timestamp is automatically included as the first column, do not list it. See example implementations if interested in enabling this in custom CObservation classes. Do not include newlines.

inline virtual std::string exportTxtDataRow() const

Returns one row of data with the data stored in this particular object. Do not include newlines.

Public Functions

CObservation() = default

Constructor: It sets the initial timestamp to current time

template<class METRICMAP>
inline bool insertObservationInto(METRICMAP &theMap, const std::optional<const mrpt::poses::CPose3D> &robotPose = std::nullopt) const

This method is equivalent to:

map->insertObservation(this, robotPose)
See: maps_observations

See also

CMetricMap, CMetricMap::insertObservation

Parameters:
  • 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 nullptr (default) to use (0,0,0deg)

Returns:

Returns true if the map has been updated, or false if this observations has nothing to do with a metric map (for example, a sound observation).

virtual void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const = 0

A general method to retrieve the sensor pose on the robot. Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.

See also

setSensorPose

void getSensorPose(mrpt::math::TPose3D &out_sensorPose) const

A general method to retrieve the sensor pose on the robot. Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.

See also

setSensorPose

inline mrpt::math::TPose3D sensorPose() const

synonym with getSensorPose()

See also

getSensorPose

Note

(New in MRPT 2.3.1)

virtual void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) = 0

A general method to change the sensor pose on the robot. Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.

See also

getSensorPose

void setSensorPose(const mrpt::math::TPose3D &newSensorPose)

A general method to change the sensor pose on the robot. Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.

See also

getSensorPose

virtual void getDescriptionAsText(std::ostream &o) const

Build a detailed, multi-line textual description of the observation contents and dump it to the output stream.

Note

If overried by derived classes, call base CObservation::getDescriptionAsText() first to show common information.

Note

This is the text that appears in RawLogViewer when selecting an object in the dataset

virtual std::string asString() const override

Return by value version of getDescriptionAsText(std::ostream&).

Protected Functions

void swap(CObservation &o)

Swap with another observation, ONLY the data defined here in the base class CObservation. It’s protected since it’ll be only called from child classes that should know what else to swap appart from these common data.