Robotics StackExchange | Archived questions

ROS2 publisher callback on subscription match

Hi,

Is there a mechanism (existing or planned) in ROS2 that allows a publisher to register a callback that gets called on successful match with a subscription?

Such a mechanism exists in FastRTPS called PublisherListener.

Asked by ananya.muddu on 2020-05-08 10:10:31 UTC

Comments

Not a good answer, but you can use the get number of subscribers call to check the number of subscribers and do something when it increments. Polling is a poor answer to this question but its a potential workaround for now.

Asked by stevemacenski on 2020-05-08 16:52:08 UTC

I also would be highly interested in this question

Asked by AndreasR30 on 2022-10-06 09:00:31 UTC

Answers