swri-robotics / mapviz

Modular ROS visualization tool for 2D data.
BSD 3-Clause "New" or "Revised" License
395 stars 152 forks source link

unable to subscribe to topic with MarkerArray messages under ROS 2 Galactic #756

Open crystal-butler opened 2 years ago

crystal-butler commented 2 years ago

I'm trying to use the Marker plugin with a Mapviz install under ROS 2 Galactic to display MarkerArray messages, but am getting the following error:

[mapviz-1] [ERROR] [1648669993.058815599] [mapviz]: Unhandled RCLError in Qt event loop: could not create subscription: failed to create topic, at /tmp/binarydeb/ros-galactic-rmw-cyclonedds-cpp-0.22.4/src/rmw_node.cpp:2552, at /tmp/binarydeb/ros-galactic-rcl-3.1.2/src/rcl/subscription.c:105

I had an earlier installation of Mapviz under ROS 2 Eloquent that was able to subscribe to the same topic and messages I'm attempting to visualize under Galactic. I reran colcon build on the publisher package under Galactic and confirmed that the messages were publishing with the command ros2 topic echo /poi_marker_array visualization_msgs/msg/MarkerArray. Any thoughts on whether this is a problem with Mapviz or with my publisher, or additional troubleshooting tips?

agyoungs commented 2 years ago

Sorry for such a late reply, but this appears to be caused by multiple subscriptions with the same name:

https://github.com/swri-robotics/mapviz/blob/ros2-devel/mapviz_plugins/src/marker_plugin.cpp#L126

I tested this by commenting out the Marker subscription and was able to subscribe to MarkerArray. This will likely need to be handled in a different way than it currently is (potentially just by looking up the type of the topic)