-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Services feature parity #123
Comments
I see Using it in the main thread outside of an executor looks fine. future = client.call(req)
executor.spin_until_future_complete(future)
if future.get() is not None:
print('Doing something with result %r', future.get()) Used in a callback done by a single threaded executor would be ok, except from the perspective of the main thread a # main thread
while rclpy.ok()
# OK, though spin_once may handle more than 1 callback since the callback can spin
singleThreadedExecutor.spin_once()
# Not OK, this will dispatch the callback and call rcl_wait again,
# but the callback will also call spin which will call rcl_wait on the
# same wait set in another thread. rcl_wait() warns it is not thread safe.
# multiThreadedExecutor.spin_once()
# ...
# Subscriber callback
def listener_cb(self, response):
future = self.client.call(req)
# Executor has to be given to this object somehow
self.executor.spin_until_future_complete(future)
if future.get() is not None:
print('Doing something with result %r', future.get()) |
Thoughts/notes regarding Future objects:
|
Feature request
Feature description
Meta ticket to track improvements we want to make to services and service-related features. This is not an exhaustive list, feel free to complete it
wait_for_service
(related to Asyncronous wait_for_service #58)rclcpp::spin_until_future_complete()
at the executor levelconnects to #170
The text was updated successfully, but these errors were encountered: