ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 202 times

Last updated: Sep 19 '18