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

Is it possible to call a service from a callback function of a subcriber

asked 2018-08-13 20:37:07 -0500

yhe34 gravatar image

My idea now is to use subscriber to obtain data ( nav_msgs::Path), and then pass it as a service request to a ros service server. Is this method possible? Do I need to consider the thread.

Thank you!!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-19 23:28:54 -0500

jonlwowski012 gravatar image

Usually you want your call back to be a simple setting of variables. I would recommend that instead you just set the variables in the call back. Then in your main function you could call the service if the data from the subscriber has changed . However in theory what you want to do should work. I would be curious to see you implement both and see the timing differences.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-08-13 20:37:07 -0500

Seen: 266 times

Last updated: Sep 19 '18