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

Thanks for the simple example. The reason you can't find the issue in your code is that what's crashing is not your code but rviz itself. With using the subprocess to launch it you're intermingling the console outputs which makes it hard to know where the exception is coming from.

In general I'd recommend using launch for bringing up multiple processes as it will be a little easier to see what process died and you keep your logic and configuration management separate.

However this looks like a bug in rviz2 or the markers array plugin as publishing any marker should not crash rviz. Please open a ticket at https://github.com/ros2/rviz/issues/new and link to here from there, as well as comment back here with the link to the issues so people can find the other thread both ways.

Note that when I was debugging I redirected the rviz output to file to isolate it using this changed function:

def bring_up_rviz():
    outfile = open('/tmp/mesh_test_out.txt', 'w')
    rviz = subprocess.Popen(
        'ros2 run rviz2 rviz2',
        shell=True, stdout=outfile, stderr=subprocess.STDOUT)
    def rvizkiller():
        return rviz.poll() is not None
    return rvizkiller