Closed seraetzer closed 5 years ago
@seraetzer right now, this needs to be done on the calling side. e.g. use a threading.Event
, wait for it after invocation and set it when a callback is called.
But I think it makes a lot of sense to add it as a feature for an upcoming release.
Thanks for your reply,
@gonzalocasas I will do so and it will be fine for now. I'm looking forward for updates on roslibpy.
@seraetzer starting with roslibpy v0.5
, you can use services with blocking calls! :)
To do that, simply do not pass a callback/errback
to the call()
function and instead of being non-blocking, the call will block and return the result as return value of the call. See some examples on the documentation.
Additionally, the .run()
will now wait for the connection to be established, so the need to add on_ready
handlers is minimized.
Hi guys, I'm using a roslib Service to send a control command to my robot. After his move he responds a travelled distance. I need to wait blocking until the Service call returns. Is there a way to do this with roslibpy?
Thanks in advance.