Robotics StackExchange | Archived questions

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

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!!

Asked by yhe34 on 2018-08-13 20:37:07 UTC

Comments

Answers

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.

Asked by jonlwowski012 on 2018-09-19 23:28:54 UTC

Comments