naturerobots / mesh_tools

Tools and Messages for Annotated 3D Triangle Meshes in ROS
https://wiki.ros.org/mesh_tools
BSD 3-Clause "New" or "Revised" License
229 stars 42 forks source link

Change QoS for meshes in RViz display #35

Closed amock closed 5 months ago

amock commented 5 months ago

This is a follow-up of PR #34 . It was not able to visualize a mesh geometry from topic because my publisher had not the same QoS configuration than the RViz plugin's subscriber. To fix this, I added an option to change the QoS in Rviz. The configuration of PR #34 remains the default.

I tested it with the code of this repo: https://github.com/aock/mesh_msgs_examples

Cakem1x commented 5 months ago

Hm, good find. Sadly, transient_local durability subscribers cannot subscribe to publishers that have a volatile durability. The QoS profiles do not need to match exactly, but some combinations work and others don't (there is a table in the ROS docs). (Though you probably already knew this)

I wish there would be a way to auto detect the publisher's QoS, I think a function for that exists since Iron, somewhere... But I doubt it's ergonomic to use it in this case.

So I like your solution, I guess that's also what other plugins do, right?

amock commented 5 months ago

Hm, good find. Sadly, transient_local durability subscribers cannot subscribe to publishers that have a volatile durability. The QoS profiles do not need to match exactly, but some combinations work and others don't (there is a table in the ROS docs). (Though you probably already knew this)

I wish there would be a way to auto detect the publisher's QoS, I think a function for that exists since Iron, somewhere... But I doubt it's ergonomic to use it in this case.

So I like your solution, I guess that's also what other plugins do, right?

So ros2 topic info /topic -v can figure out what QoS settings the publisher has. I agree, it would be nice to let the subscriber autodetect the QoS. About the default QoS settings: I thought the settings were important for your simulation to work. If I can decide, I would always set the default QoS profile to "sensor data".

The selection of a QoS via RViz is a standard RViz plugin.

Cakem1x commented 5 months ago

If I can decide, I would always set the default QoS profile to "sensor data".

Why sensor data and not e.g. system default QoS? (just curios, I don't have strong preferences here)

I think it's good to choose a QoS as a default that works with most publishers. My simulation needs the option to change the QoS profile (to transient local durability, so I get a map when rviz starts after the mesh navigation), but I don't need it to be the default. I provide and use an rviz config anyways.

amock commented 5 months ago

From my understanding I would treat mesh data by default similar to PCL data. And after adding a PCL to RViz I always have to change the QoS to sensor data profile.

But since I'm not really sure I could also change it to system default first. Should be fine too. Then we can test it first and decide later if we change it to something more special.

I will make all the changes soon.