Skip to content

Commit 657f2ce

Browse files
Synchronously call ros::spinOnce in rviz itself
1 parent 43b2260 commit 657f2ce

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
@@ -221,6 +221,13 @@ bool VisualizerApp::init( int argc, char** argv )
221221
ros::NodeHandle private_nh("~");
222222
reload_shaders_service_ = private_nh.advertiseService("reload_shaders", reloadShaders);
223223

224+
//process any callbacks that don't use the designated callback queues of VisualizationManager
225+
// but don't interfere with library users
226+
QTimer* synchronous_global_timer = new QTimer(this);
227+
synchronous_global_timer->setInterval(10);
228+
synchronous_global_timer->setTimerType(Qt::VeryCoarseTimer);
229+
connect(synchronous_global_timer, &QTimer::timeout, this, [](){ros::spinOnce();});
230+
224231
#if CATCH_EXCEPTIONS
225232
}
226233
catch (std::exception& e)

0 commit comments

Comments
 (0)