Re: [ros-users] Can service answers be asynchronous?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: ros-users
Subject: Re: [ros-users] Can service answers be asynchronous?
On 05/10/10 18:24, Eric Berger wrote:
> ROS communication protocols allow for it, so blocking is basically a
> design choice in the client libraries. You could either try modifying
> the client library that you're using, or build something on top of it
> (at the cost of 1 thread per in-flight service request) that provides
> the behavior that you want.


Thank you for your (and others') answer. As ASEBA is mostly event based
and IPC-style interaction is more for occasional use, I will go the
multi-threaded way instead of using actionlib.

However, I did not manage to find in the documentation or in the autodoc
how to run each service request in its own thread. In [1], there is
documentation on how to run each node or each service in their own
threads, but not each request. From [2], I can imagine to check a
callback queue for available callbacks, and then to start a thread that
would call callOne(), but I did not find any information on whether this
function is thread safe. Could you highlight me on this point?

Thank you, all the best,

Stéphane

[1] http://www.ros.org/wiki/roscpp/Overview/Callbacks%20and%20Spinning
[2] http://www.ros.org/doc/api/roscpp/html/classros_1_1CallbackQueue.html

--
Dr Stéphane Magnenat
http://stephane.magnenat.net