ros2 / rmw_fastrtps

Implementation of the ROS Middleware (rmw) Interface using eProsima's Fast RTPS.
Apache License 2.0
157 stars 117 forks source link

get_publishers_info_by_topic does not return qos depth for publishers with fastDDS #684

Open eschembor-irobot opened 1 year ago

eschembor-irobot commented 1 year ago

Bug report

Required Info:

Steps to reproduce issue

Noticed this when using foxglove_bridge. They compute the qos depth to use for a subscriber by summing the qos depths of all publishers on that topic. This is not working with fastDDS as get_publishers_info_by_topic reports a qos depth of 0 for any publisher.

Tracing this through the code, I see the comment here which I think indicates the source of the issue https://github.com/ros2/rmw_fastrtps/blob/901339f274fc07fad757fb32bd16f00815217302/rmw_fastrtps_shared_cpp/include/rmw_fastrtps_shared_cpp/qos.hpp#L129

Expected behavior

I would expect get_publishers_info_by_topic to report the actual qos depth of publishers

Actual behavior

get_publishers_info_by_topic reports all publishers as having a qos depth of 0

Additional information

fujitatomoya commented 1 year ago

technically, with rmw_fastrtps history depth is unknown, we can see this using ros2 topic info -v. rmw_fastrtps does not store the history depth from discovery information, that leads to unknown (zero). (rmw_cyclonedds can get the actual history depth, but rmw_connextdds, which tries to store the data but it is unknown.)

see details https://github.com/ros2/rclpy/pull/849

to address this issue, we need Fast-DDS to get the history depth information via discovery process to store the graph.