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

How to run services on another thread?

asked 2019-11-22 05:18:49 -0500

drodgu gravatar image

updated 2019-11-22 05:21:01 -0500

Hi everyone,

I have a navigation application and I need a callback to run on another thread rather than the main one. I've search on the internet and I've discovered that you can do such things using ros subscribers as it is shown in this other reference [1]. In this node I need to use ros service communication. My question is how can I setup my ros::AdvertiseServiceOptions::create in order to link that service server advertisment to another thread by using ros::AsyncSpinner?

Thanks in advance for your help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-09-27 17:19:58 -0500

tfoote gravatar image

You can create a separate callback_queue and associate it with the AsyncSpinner

There's an example and documentation here: http://wiki.ros.org/roscpp/Overview/C...

edit flag offensive delete link more

Comments

Thank you for the guide!

drodgu gravatar image drodgu  ( 2021-09-27 23:16:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-11-22 05:18:49 -0500

Seen: 196 times

Last updated: Sep 27 '21