dataload_ros2.h
Go to the documentation of this file.
1 #ifndef DATALOAD_ROS2_H
2 #define DATALOAD_ROS2_H
3 
4 #include <QObject>
5 #include <QtPlugin>
6 #include <QSettings>
7 
8 #include <rosbag2_cpp/reader.hpp>
11 #include "parser_configuration.h"
12 
14 {
15  Q_OBJECT
16  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.ROS2DataLoader")
17  Q_INTERFACES(PJ::DataLoader)
18 
19 public:
20  DataLoadROS2();
21 
22  virtual const std::vector<const char*>& compatibleFileExtensions() const override;
23 
24  virtual bool readDataFromFile(PJ::FileLoadInfo* fileload_info,
25  PJ::PlotDataMapRef& destination) override;
26 
27  virtual const char* name() const override
28  {
29  return "DataLoad ROS2 bags";
30  }
31 
32  virtual ~DataLoadROS2() override = default;
33 
34  virtual bool xmlSaveState(QDomDocument& doc, QDomElement& parent_element) const override;
35 
36  virtual bool xmlLoadState(const QDomElement& parent_element) override;
37 
38 private:
39  std::shared_ptr<rosbag2_cpp::Reader> _bag_reader;
40 
41  std::vector<const char*> _extensions;
42 
44 
45  std::vector<std::pair<QString, QString>> getAndRegisterAllTopics();
46 
47  void saveDefaultSettings();
48 
49  void loadDefaultSettings();
50 };
51 
52 #endif // DATALOAD_ROS2_H
dataloader_base.h
DataLoadROS2::readDataFromFile
virtual bool readDataFromFile(PJ::FileLoadInfo *fileload_info, PJ::PlotDataMapRef &destination) override
Definition: dataload_ros2.cpp:43
DataLoadROS2::_config
PJ::RosParserConfig _config
Definition: dataload_ros2.h:43
PJ::FileLoadInfo
DataLoadROS2::xmlLoadState
virtual bool xmlLoadState(const QDomElement &parent_element) override
Definition: dataload_ros2.cpp:247
PJ::RosParserConfig
Definition: parser_configuration.h:14
dialog_select_ros_topics.h
DataLoadROS2::_extensions
std::vector< const char * > _extensions
Definition: dataload_ros2.h:41
parser_configuration.h
DataLoadROS2::~DataLoadROS2
virtual ~DataLoadROS2() override=default
DataLoadROS2::loadDefaultSettings
void loadDefaultSettings()
Definition: dataload_ros2.cpp:259
DataLoadROS2
Definition: dataload_ros2.h:13
DataLoadROS2::getAndRegisterAllTopics
std::vector< std::pair< QString, QString > > getAndRegisterAllTopics()
DataLoadROS2::xmlSaveState
virtual bool xmlSaveState(QDomDocument &doc, QDomElement &parent_element) const override
Definition: dataload_ros2.cpp:241
DataLoadROS2::name
virtual const char * name() const override
Definition: dataload_ros2.h:27
PJ::DataLoader
DataLoadROS2::DataLoadROS2
DataLoadROS2()
Definition: dataload_ros2.cpp:32
DataLoadROS2::_bag_reader
std::shared_ptr< rosbag2_cpp::Reader > _bag_reader
Definition: dataload_ros2.h:39
DataLoadROS2::compatibleFileExtensions
virtual const std::vector< const char * > & compatibleFileExtensions() const override
Definition: dataload_ros2.cpp:38
PJ::PlotDataMapRef
DataLoadROS2::saveDefaultSettings
void saveDefaultSettings()
Definition: dataload_ros2.cpp:253


plotjuggler_ros
Author(s): Davide Faconti
autogenerated on Wed Feb 21 2024 03:22:55