Class Rosbag2Dataset

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

  • public RawDataSourceBase

  • public OfflineDatasetSource

  • public Dataset_UI

Class Documentation

class Rosbag2Dataset : public RawDataSourceBase, public OfflineDatasetSource, public Dataset_UI

RawDataSource for datasets in rosbag2 format.

It reads a rosbag2 file, and exposes it as a dataset with N entries, N being the number of messages in the bag. Reading them via the offline API (OfflineDatasetSource) returns empty shared_ptr observations for those messages that do not have a direct mapping to mrpt::obs classes. The dataset can be also played in an online (real-time, or with a custom time wrapping) fashion via the RawDataSourceBase API.

See example configuration files to see how to define what topics to publish, and how to optionally override the sensor poses in the local robot frame.

Public Functions

Rosbag2Dataset()
~Rosbag2Dataset() override = default
void spinOnce() override
size_t datasetSize() const override
mrpt::obs::CSensoryFrame::Ptr datasetGetObservations(size_t timestep) const override
inline size_t datasetUI_size() const override
inline size_t datasetUI_lastQueriedTimestep() const override
inline double datasetUI_playback_speed() const override
inline void datasetUI_playback_speed(double speed) override
inline bool datasetUI_paused() const override
inline void datasetUI_paused(bool paused) override
inline void datasetUI_teleport(size_t timestep) override

Protected Functions

void initialize_rds(const Yaml &cfg) override