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
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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.
Asked: 2013-01-10 21:44:23 -0500
Seen: 561 times
Last updated: Jan 11 '13
Having confusion over nodes’ communication methods: by topics and by service.
waitForMessage functionality for TimeSyncronizer
joint_states_aggregator and joint_state_publisher
Using custom fields in a ROS service
Concurrent service clients in ROS 2
service does not exist - app_manager rapp, hydro, python, turtlebot
How to use a service to make a snapshot?