Qt GUI messages not published when launched from launch file

asked 2020-04-27 19:21:54 -0500

mathisgood gravatar image

Hi all,

So I'm quite experienced with ROS but I've never seen anything like this. I'm running a simulation of my mobile robot in gazebo and made a Qt GUI for building and publishing waypoint paths. I have one main launch file that launches everything and only new nodes are added once they have been determined to operate as expected.

So, during testing I would launch my all encompassing launch file and then in another terminal I would rosrun my gui with no messaging issues or publishing issues. Then when I added my GUI to the launch file, messages would not come through the topics. However, if I did rostopic list or rosnode info gui_node all the appropriate topics with the correct types appeared.

The only way I've found a work around for this issue currently is to make a shell script that does rosrun my_pkg gui_node and then do <node type="rosrun.sh" name="gui_node" pkg="my_pkg" />.

I do not really know how launch files work so anyone with deeper knowledge on that would be a great help. Also another factor in this might be that I'm using an async spinner in my gui so that both gui callbacks and subscriber callbacks can both occur without a problem. I'm also happy to provide more details if needed.

Thanks!

edit retag flag offensive close merge delete

Comments

is it possible that you have a timeout for subscribers in your GUI? the launch file does not guarantee which node runs first, so your GUI may be running first, before any topics are available to it.

Procópio gravatar image Procópio  ( 2020-04-28 02:52:31 -0500 )edit