Skip to content

Commit

Permalink
SyncFrame as last enum entry
Browse files Browse the repository at this point in the history
... to keep existing config files valid
  • Loading branch information
rhaschke committed May 27, 2022
1 parent 686ae16 commit 37a28c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/rviz/frame_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class FrameManager : public QObject
public:
enum SyncMode
{
SyncOff = 0,
SyncOff = 0, // use latest TF updates
SyncExact, // sync to incoming messages of a display (emitting timeSignal())
SyncApprox,
SyncFrame, // synchronize frame lookups to start of update() loop
SyncExact,
SyncApprox
};

/// Constructor, will create a TransformListener (and Buffer) automatically if not provided
Expand Down
13 changes: 9 additions & 4 deletions src/rviz/time_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ TimePanel::TimePanel(QWidget* parent) : Panel(parent)

sync_mode_selector_ = new QComboBox(this);
sync_mode_selector_->addItem("Off");
sync_mode_selector_->addItem("Frame");
sync_mode_selector_->setItemData(1, "Synchronize TF lookups within a frame", Qt::ToolTipRole);
sync_mode_selector_->setItemData(FrameManager::SyncOff, "Display data using latest TF data",
Qt::ToolTipRole);
sync_mode_selector_->addItem("Exact");
sync_mode_selector_->setItemData(1, "Synchronize TF lookups to an external (Display) source",
sync_mode_selector_->setItemData(FrameManager::SyncExact, "Synchronize TF lookups to a source display",
Qt::ToolTipRole);
sync_mode_selector_->addItem("Approximate");
sync_mode_selector_->setItemData(
FrameManager::SyncApprox, "Synchronize to a source display in a smooth fashion", Qt::ToolTipRole);
sync_mode_selector_->addItem("Frame");
sync_mode_selector_->setItemData(FrameManager::SyncFrame, "Synchronize TF lookups within a frame",
Qt::ToolTipRole);
sync_mode_selector_->setSizeAdjustPolicy(QComboBox::AdjustToContents);
sync_mode_selector_->setToolTip(
"Allows you to synchronize the ROS time and Tf transforms to a given source.");
Expand Down Expand Up @@ -227,7 +232,7 @@ void TimePanel::syncSourceSelected(int /*index*/)
void TimePanel::syncModeSelected(int mode)
{
vis_manager_->getFrameManager()->setSyncMode((FrameManager::SyncMode)mode);
sync_source_selector_->setVisible(mode > FrameManager::SyncFrame);
sync_source_selector_->setVisible(mode >= FrameManager::SyncExact && mode <= FrameManager::SyncApprox);
vis_manager_->notifyConfigChanged();
}

Expand Down

0 comments on commit 37a28c3

Please sign in to comment.