33 #include <QPushButton> 34 #include <QHBoxLayout> 35 #include <QButtonGroup> 57 experimental_cb_->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
69 "Allows you to synchronize the ROS time and Tf transforms to a given source.");
77 QHBoxLayout* experimental_layout =
new QHBoxLayout(
this);
79 experimental_layout->addWidget(
new QLabel(
"Synchronization:"));
81 experimental_layout->addWidget(
new QLabel(
"Source:"));
83 experimental_layout->addSpacing(20);
84 experimental_layout->setContentsMargins(0, 0, 20, 0);
88 QHBoxLayout* old_layout =
new QHBoxLayout(
this);
89 old_layout->addWidget(
new QLabel(
"ROS Elapsed:"));
91 old_layout->addWidget(
new QLabel(
"Wall Time:"));
93 old_layout->addWidget(
new QLabel(
"Wall Elapsed:"));
95 old_layout->setContentsMargins(0, 0, 20, 0);
98 QHBoxLayout* layout =
new QHBoxLayout(
this);
101 layout->addWidget(
new QLabel(
"ROS Time:"));
104 layout->addStretch(100);
107 layout->addStretch();
108 layout->setContentsMargins(11, 5, 11, 5);
131 if (config.
mapGetInt(
"SyncMode", &sync_mode))
137 bool experimental =
false;
138 config.
mapGetBool(
"Experimental", &experimental);
156 connect(display_group, SIGNAL(displayAdded(
rviz::Display*)),
this,
158 connect(display_group, SIGNAL(displayRemoved(
rviz::Display*)),
this,
161 for (
int i = 0; i < display_group->
numDisplays(); i++)
175 QString name = display->
getName();
189 QString name = display->
getName();
218 QLineEdit* label =
new QLineEdit;
219 label->setReadOnly(
true);
225 label->setText(QString::number(time,
'f', 2));
QLineEdit * wall_elapsed_label_
QPushButton * pause_button_
QWidget * experimental_widget_
QString config_sync_source_
VisualizationManager * vis_manager_
void save(Config config) const override
FrameManager * getFrameManager() const override
Return the FrameManager instance.
QComboBox * sync_source_selector_
void fillTimeLabel(QLineEdit *label, double time)
void pauseToggled(bool checked)
virtual int numDisplays() const
Return the number of child Displays.
QCheckBox * experimental_cb_
QComboBox * sync_mode_selector_
virtual void save(Config config) const
Override to save configuration data. This version saves the name and class ID of the panel...
bool mapGetString(const QString &key, QString *value_out) const
Convenience function for looking up a named string.
TimePanel(QWidget *parent=nullptr)
void mapSetValue(const QString &key, QVariant value)
Set a named child to the given value.
void onInitialize() override
Configuration data storage class.
double getWallClock()
Return the wall clock time, in seconds since 1970.
QLineEdit * ros_elapsed_label_
QLineEdit * ros_time_label_
double getROSTimeElapsed()
Return the ROS time in seconds since the last reset.
void experimentalToggled(bool checked)
A Display object which stores other Displays as children.
DisplayGroup * getRootDisplayGroup() const override
virtual Display * getDisplayAt(int index) const
Return the index-th Display in this group, or NULL if the index is invalid.
virtual QString getName() const
Return the name of this Property as a QString.
void onTimeSignal(ros::Time time)
void syncSourceSelected(int index)
double getROSTime()
Return the ROS time, in seconds.
void setPause(bool pause)
Enable/disable pause mode.
void onDisplayAdded(rviz::Display *display)
void syncModeSelected(int index)
bool mapGetBool(const QString &key, bool *value_out) const
Convenience function for looking up a named boolean.
QLineEdit * makeTimeLabel()
void syncTime(ros::Time time)
Synchronize with given time.
void load(const Config &config) override
double getWallClockElapsed()
Return the wall clock time in seconds since the last reset.
void setSyncMode(SyncMode mode)
Set synchronization mode (off/exact/approximate)
void notifyConfigChanged()
Notify this VisualizationManager that something about its display configuration has changed...
QLineEdit * wall_time_label_
virtual void load(const Config &config)
Override to load configuration data. This version loads the name of the panel.
bool mapGetInt(const QString &key, int *value_out) const
Convenience function for looking up a named integer.
void onDisplayRemoved(rviz::Display *display)