line_panel.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_RVIZ_PLUGIN_LINE_PANEL_HPP
2 #define GRAPH_RVIZ_PLUGIN_LINE_PANEL_HPP
3 
4 #include <atomic>
5 #include <chrono>
6 #include <deque>
13 #include <memory>
14 #include <mutex>
15 #include <QFileDialog>
16 #include <QFileInfo>
17 #include <QLabel>
18 #include <QMessageBox>
19 #include <QPushButton>
20 #include <QTimer>
21 #include <QVBoxLayout>
22 #include <ros/ros.h>
23 #include <ros/service.h>
24 #include <ros/time.h>
25 #include <rviz/panel.h>
26 #include <thread>
27 
28 namespace graph_rviz_plugin
29 {
30 
31 class LinePanel : public rviz::Panel
32 {
33 Q_OBJECT
34 
35 public:
36  LinePanel(QWidget *parent = 0);
37  virtual ~LinePanel();
38 
39 Q_SIGNALS:
40  void enable(const bool);
41  void displayMessageBox(const QString,
42  const QString,
43  const QString,
44  const QMessageBox::Icon);
45 
46 protected Q_SLOTS:
47  void displayMessageBoxHandler(const QString title,
48  const QString text,
49  const QString info = "",
50  const QMessageBox::Icon icon = QMessageBox::Icon::Information);
51  virtual void load(const rviz::Config &config);
52  virtual void save(rviz::Config config) const;
53  void startPauseClicked();
54  void stopClicked();
56  void graphSettingsClicked();
57  void settingsClicked();
58  void resetClicked();
59  void graphUpdate();
60  void graphSettingsUpdate();
61  void enableLegend(bool legend_enable);
62  void graphInit();
63  void exportClicked();
64 
65 private:
66  std::shared_ptr<ros::NodeHandle> nh_;
67  QPushButton *start_pause_button_;
68  QPushButton *topic_button_;
69  QPushButton *stop_button_;
70  QPushButton *graph_settings_button_;
71  QPushButton *export_button_;
75  QString export_directory_ = "";
76  std::deque<std::shared_ptr<TopicData>> displayed_topics_;
77  std::atomic<bool> legend_enable_;
78  std::atomic<bool> yaxis_rescale_auto_;
79  std::atomic<bool> window_time_enable_;
80  std::atomic<bool> graph_stopped_;
81  double y_min_ = 0;
82  double y_max_ = 1;
83  double w_time_ = 1;
84  unsigned refresh_freq_ = 40; // in Hz
85 };
86 
87 }
88 
89 #endif
std::atomic< bool > window_time_enable_
Definition: line_panel.hpp:79
LinePanel(QWidget *parent=0)
Definition: line_panel.cpp:6
QPushButton * start_pause_button_
Definition: line_panel.hpp:67
config
std::shared_ptr< ros::NodeHandle > nh_
Definition: line_panel.hpp:66
std::atomic< bool > graph_stopped_
Definition: line_panel.hpp:80
void displayMessageBoxHandler(const QString title, const QString text, const QString info="", const QMessageBox::Icon icon=QMessageBox::Icon::Information)
Definition: line_panel.cpp:140
void displayMessageBox(const QString, const QString, const QString, const QMessageBox::Icon)
std::atomic< bool > yaxis_rescale_auto_
Definition: line_panel.hpp:78
virtual void save(rviz::Config config) const
Definition: line_panel.cpp:240
The central class of the library. This is the QWidget which displays the plot and interacts with the ...
Definition: qcustomplot.h:3590
QPushButton * graph_settings_button_
Definition: line_panel.hpp:70
std::atomic< bool > legend_enable_
Definition: line_panel.hpp:77
void enableLegend(bool legend_enable)
Definition: line_panel.cpp:450
virtual void load(const rviz::Config &config)
Definition: line_panel.cpp:157
std::deque< std::shared_ptr< TopicData > > displayed_topics_
Definition: line_panel.hpp:76


graph_rviz_plugin
Author(s): Édouard Pronier, Victor Lamoine - Institut Maupertuis
autogenerated on Mon Feb 28 2022 22:27:30