1
$\begingroup$

Rosanswers logo

When you do rostopic info /some/topic in ROS1 it lists all the nodes that publish or subscribe to this topic.

ROS2 does the same, except it only output how many publisher or subscribers are on this topic. Is it somehow possible to get the full list of all publishers and subscribers?

$ ros2 topic info /odom
Type: nav_msgs/msg/Odometry
Publisher count: 0
Subscription count: 1

I mean it is possible to use ros2 node info on all nodes an see if they are subscribed, but this is tedious if you have a large number of nodes.


Originally posted by Darkproduct on ROS Answers with karma: 100 on 2021-10-02

Post score: 1

$\endgroup$

1 Answer 1

2
$\begingroup$

Rosanswers logo

Just found the solution.

Use --verbose like this:

$ ros2 topic info --verbose /odom
Type: nav_msgs/msg/Odometry

Publisher count: 0

Subscription count: 1

Node name: controller_server
Node namespace: /
Topic type: nav_msgs/msg/Odometry
Endpoint type: SUBSCRIPTION
GID: 01.0f.17.62.fa.9e.00.00.01.00.00.00.00.00.8d.04.00.00.00.00.00.00.00.00
QoS profile:
  Reliability: RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT
  Durability: RMW_QOS_POLICY_DURABILITY_VOLATILE
  Lifespan: 2147483651294967295 nanoseconds
  Deadline: 2147483651294967295 nanoseconds
  Liveliness: RMW_QOS_POLICY_LIVELINESS_AUTOMATIC
  Liveliness lease duration: 2147483651294967295 nanoseconds

Originally posted by Darkproduct with karma: 100 on 2021-10-02

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$
1
  • $\begingroup$ To make it less verbose: ros2 topic info /cmd_vel --verbose | grep -e "Node name:" -e "Endpoint" $\endgroup$ Commented Apr 13 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.