Skip to content

Commit acd7516

Browse files
simonschmeisserSimon Schmeisser
authored andcommitted
Synchronously call ros::spinOnce in rviz itself
1 parent eb4fe6a commit acd7516

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rviz/visualizer_app.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ bool VisualizerApp::init(int argc, char** argv)
226226
save_config_service_ =
227227
private_nh.advertiseService("save_config", &VisualizerApp::saveConfigCallback, this);
228228

229+
//process any callbacks that don't use the designated callback queues of VisualizationManager
230+
// but don't interfere with library users
231+
QTimer* synchronous_global_timer = new QTimer(this);
232+
synchronous_global_timer->setInterval(10);
233+
synchronous_global_timer->setTimerType(Qt::VeryCoarseTimer);
234+
connect(synchronous_global_timer, &QTimer::timeout, this, [](){ros::spinOnce();});
235+
229236
#if CATCH_EXCEPTIONS
230237
}
231238
catch (std::exception& e)

0 commit comments

Comments
 (0)