ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

[ROS2] Retrieving QOS settings for a topic

asked 2018-10-05 09:37:55 -0600

Myzhar gravatar image

Hi, since a subscriber can receive a topic message only if its QOS profile is compatible with the QOS profile of the publisher, is there a way to retrieve the DURABILITY and the RELIABILITY settings for a topic?

I think that the command

$ ros2 topic info /topic

can be a good place to introduce this important feature.

What do you think?

Walter

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2021-02-02 12:41:36 -0600

Kevin DeMarco gravatar image

updated 2021-02-02 12:45:59 -0600

At least on foxy, you can use the --verbose flag with the command:

$ ros2 topic info /topic_name --verbose

I asked a similar question: https://answers.ros.org/question/3708...

User gvdhoorn pointed out the --verbose or -v flag that can be used to output the QoS parameters and which nodes are publishing / subscribing to the topic. For example...

$ ros2 topic info /robot_description --verbose
Type: std_msgs/msg/String

Publisher count: 1

Node name: robot_state_publisher
Node namespace: /
Topic type: std_msgs/msg/String
Endpoint type: PUBLISHER
GID: 01.0f.71.ef.91.21.00.00.01.00.00.00.00.00.14.03.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_RELIABLE
  Durability: RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds

Subscription count: 2

Node name: rqt_gui_py_node_10355
Node namespace: /
Topic type: std_msgs/msg/String
Endpoint type: SUBSCRIPTION
GID: 01.0f.71.ef.73.28.00.00.01.00.00.00.00.00.11.04.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_RELIABLE
  Durability: RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds

Node name: rviz2
Node namespace: /
Topic type: std_msgs/msg/String
Endpoint type: SUBSCRIPTION
GID: 01.0f.71.ef.8b.21.00.00.01.00.00.00.00.00.16.04.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_RELIABLE
  Durability: RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds
edit flag offensive delete link more
2

answered 2018-10-05 10:20:10 -0600

William gravatar image

Currently there is no way to get this information in the rclcpp or rclpy API.

I'm am pretty sure the information is available in the lower level middleware interface, so it would just need to be exposed through our middleware abstraction layer. Unfortunately this can be a tedious thing to do, but if you're interested I'd recommend opening an issue on the ros2/rmw repository or on the ros2/ros2 repository asking for this feature.

This feature is related to a series of other features which generally have to do with providing more information from the underlying middleware about the entities in the ROS graph, e.g. ability to associate publishers/subscriptions and the nodes that created them or which machine and process a node comes from.

edit flag offensive delete link more

Comments

1

Has this changed in the last two years? It would be very useful to get the qos settings so we can subscribe dynamically.

smorad gravatar image smorad  ( 2020-12-08 14:02:48 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2018-10-05 09:37:55 -0600

Seen: 5,447 times

Last updated: Feb 02 '21