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

Calling a ros service from several nodes at the same time?

asked 2011-10-13 15:00:06 -0600

gavinmachine gravatar image

updated 2012-02-27 07:35:52 -0600

kwc gravatar image

Hello,

I have a service that simply performs a task and then returns (i.e. it is not storing any data in global variables or retaining any type of state)....

The question is: Can I call the service from several nodes at the same time without having to worry about mutual exclusion issues? I.e. each time the service is called does it create a separate "instance" for each caller?

Thanks for the help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
10

answered 2011-10-14 09:32:29 -0600

DimitriProsser gravatar image

When calling a service, the server node will handle one call at a time and queue up the rest. Therefore, it will act on them in the same order that they were received. This is the same as if you were to publish to the same topic from multiple sources simultaneously. The messages would be placed in the queue in order that they are received.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-10-13 15:00:06 -0600

Seen: 1,982 times

Last updated: Oct 14 '11