-
Notifications
You must be signed in to change notification settings - Fork 417
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
Add thing which adds things to wait set #588
Comments
This makes sense to me, I had imagined a "Waitable" concept from early days, but didn't have time to implement it. Thanks for writing it down so clearly :) |
👍 Correct me if I'm wrong. Specifically, |
This issue has been mentioned on ROS Discourse. There might be relevant details there: |
* Changed rosidl_generator_c/cpp to rosidl_runtime_c/cpp Signed-off-by: ahcorde <ahcorde@gmail.com> * Fixed rcl rcl_runtime_c dependency Signed-off-by: ahcorde <ahcorde@gmail.com> * Fixed rcl_action rcl_runtime_c dependency Signed-off-by: ahcorde <ahcorde@gmail.com> * Fixed rcl_lifecycle rcl_runtime_c dependency Signed-off-by: ahcorde <ahcorde@gmail.com> * keep the originally used dependency type Signed-off-by: ahcorde <ahcorde@gmail.com>
Feature request
This is a request for a feature to allow waiting on action servers and action clients. Action servers and Action clients are to be implemented in libraries on top of the core
rcl
andrclcpp
features inrcl_action
andrclcpp_action
. Adding them to the wait set inrcl
is covered by ros2/rcl#335.Feature description
This feature would allow an executor to wait on action servers and action clients which have servers/timers/clients/subscribers created in C. Since the individual entities don't have
rclcpp::<Entity>Base
types they can't be used by the existing callback group and executor APIs.With #519 in mind it could make sense to change callback groups to be the class that adds things to the wait set, but I don't think there is time before the Crystal release. Instead this feature is proposing to add a new class to be used along with callback groups.
Implementation considerations
Assuming class called
Waitable
with virtual APIsvirtual get_number_of_entities(size_t * num_subscriptions, ...)
virtual void add_to_wait_set(rcl_wait_set_t *)
get_number_of_entities()
andadd_to_wait_set()
are separate calls, it must be assumed that the number of entities in aWaitable
are constant between the two calls. For actions this assumption holds because the number of waitable entities is constant for the life of the server and client.virtual bool can_execute(rcl_wait_set_t *)
virtual void execute();
can_execute()
so that it does the right thing here.Using
Waitable
requires:Waitable::SharedPtr
field toAnyExecutable
Executor::execute_any_executable()
needs to callWaitable::execute()
add_waitable(Waitable::SharedPtr)
toNode
, possibly viaNodeWaitableInterface
(and an API to remove them)MemoryStrategy
needs apinumber_of_ready_waitables()
AllocatorMemoryStrategy::add_handles_to_wait_set()
needs to giveWaitable
a chance to add thingsMemoryStrategy
needs apiget_next_waitable()
to be used byExecutor::get_next_executable
Requires ros2/rcl#335 so
Executor
andWaitable
can know which entities belong to which.The text was updated successfully, but these errors were encountered: