ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In any Qt application you can only modify UI elements from the Qt event loop.

When integrating with ROS you therefore have to be careful to not touch UI elements from a ROS callback (since it is called from a ROS thread). Whenever possible you should use model / view based UI in Qt because you are free to interact with the model from any thread. Otherwise you commonly do something like the following to perform the UI modification in the Qt event loop:

  • in the ROS callback store the data somewhere and signal a Qt event
  • handle the Qt event and apply the previously received data to the UI

You should find similar patterns in many existing rqt plugins.