Subscribe from service example
Hi,
lets say that I have a service that needs some additional resources which is available via topic. Is there some example how this can be implemented?
Thanks
Hi,
lets say that I have a service that needs some additional resources which is available via topic. Is there some example how this can be implemented?
Thanks
The recommended way to do this is to have a subscription to the topic which stores the latest value in a persistent location. Then you can use that value in your service callback.
I'm not sure what the best practice is, but I've always used ros::topic::waitForMessage. It gets one message on the topic you specify.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2013-01-10 21:44:23 -0500
Seen: 524 times
Last updated: Jan 11 '13
How to make a realtime controller get information
Having confusion over nodes’ communication methods: by topics and by service.
Why ROS Topic should get XMLRPC address:port but ROS Service doesn't?
calling a service from an other file on the same machine
topic transmits messages of same type ?
Is it possible to receive a msg on a certain topic by calling a service?
ROS2 nodes stay alive and keep publishing after shutting down