is it possible to have simultaneous calls to a service server from a rospy ServiceProxy in multiple threads?
Hi all,
I have a use-case where, depending on an external signal that I cannot control, I have to call a service in another node.
The node calling the service cannot wait for the result, so I put the service calls (using the same rospy.ServiceProxy
) in seperate threads.
It can thus occur, that multiple threads try to call the same service simultaneously (the ServiceServer
, however, is C++).
According to the this and this question, both, the C++ ServiceServer
and ServiceClient
are threadsafe.
However, using the rospy.ServiceProxy
, i get the following exception:
transport error completing service call: unable to receive data from sender, check sender's logs for details
sometimes followed by a
service [/my_service] returned no response
I have fixed it by including respective threading.Lock
s. But is this the expected behaviour or should I be able to call it multiple times?
Thanks.
Asked by mgruhler on 2015-07-21 08:29:15 UTC
Comments