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

rclpy.Subscription getting the number of connections

asked 2021-03-10 12:03:54 -0500

Is it possible to get the number of connections from a rclpy.Subscription object? (In ROS1 we had "subscriber.get_num_connections()")

If it is not possible, what is the alternative?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-03-24 14:43:37 -0500

clyde gravatar image

self._my_pub.get_subscription_count()

See https://docs.ros2.org/foxy/api/rclpy/...

edit flag offensive delete link more

Comments

This is providing the number of subscriptions for a rclpy.publisher.Publisher and not the number of publishers for a rclpy.subscription.Subscription.

Christian Rauch gravatar image Christian Rauch  ( 2023-08-03 02:53:35 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-03-10 12:03:54 -0500

Seen: 725 times

Last updated: Mar 24 '21