ROS 2 rclcpp + rcl - jazzy
jazzy
ROS 2 C++ Client Library with ROS Client Library
|
#include <rclcpp/executors/executor_notify_waitable.hpp>
Public Member Functions | |
RCLCPP_PUBLIC | ExecutorNotifyWaitable (std::function< void(void)> on_execute_callback={}) |
RCLCPP_PUBLIC | ExecutorNotifyWaitable (ExecutorNotifyWaitable &other) |
RCLCPP_PUBLIC ExecutorNotifyWaitable & | operator= (ExecutorNotifyWaitable &other) |
RCLCPP_PUBLIC void | add_to_wait_set (rcl_wait_set_t &wait_set) override |
Add conditions to the wait set. More... | |
RCLCPP_PUBLIC bool | is_ready (const rcl_wait_set_t &wait_set) override |
Check conditions against the wait set. More... | |
RCLCPP_PUBLIC void | execute (const std::shared_ptr< void > &data) override |
Perform work associated with the waitable. More... | |
RCLCPP_PUBLIC std::shared_ptr< void > | take_data () override |
Retrieve data to be used in the next execute call. More... | |
RCLCPP_PUBLIC std::shared_ptr< void > | take_data_by_entity_id (size_t id) override |
Take the data from an entity ID so that it can be consumed with execute . More... | |
RCLCPP_PUBLIC void | set_on_ready_callback (std::function< void(size_t, int)> callback) override |
Set a callback to be called whenever the waitable becomes ready. More... | |
RCLCPP_PUBLIC void | add_guard_condition (rclcpp::GuardCondition::WeakPtr guard_condition) |
Add a guard condition to be waited on. More... | |
RCLCPP_PUBLIC void | clear_on_ready_callback () override |
Unset any callback registered via set_on_ready_callback. More... | |
RCLCPP_PUBLIC void | remove_guard_condition (rclcpp::GuardCondition::WeakPtr weak_guard_condition) |
Remove a guard condition from being waited on. More... | |
RCLCPP_PUBLIC size_t | get_number_of_ready_guard_conditions () override |
Get the number of ready guard_conditions. More... | |
![]() | |
virtual RCLCPP_PUBLIC size_t | get_number_of_ready_subscriptions () |
Get the number of ready subscriptions. More... | |
virtual RCLCPP_PUBLIC size_t | get_number_of_ready_timers () |
Get the number of ready timers. More... | |
virtual RCLCPP_PUBLIC size_t | get_number_of_ready_clients () |
Get the number of ready clients. More... | |
virtual RCLCPP_PUBLIC size_t | get_number_of_ready_events () |
Get the number of ready events. More... | |
virtual RCLCPP_PUBLIC size_t | get_number_of_ready_services () |
Get the number of ready services. More... | |
virtual RCLCPP_PUBLIC void | add_to_wait_set (rcl_wait_set_t *wait_set) |
Deprecated. More... | |
virtual RCLCPP_PUBLIC bool | is_ready (rcl_wait_set_t *wait_set) |
Deprecated. More... | |
virtual RCLCPP_PUBLIC void | execute (std::shared_ptr< void > &data) |
Deprecated. More... | |
RCLCPP_PUBLIC bool | exchange_in_use_by_wait_set_state (bool in_use_state) |
Exchange the "in use by wait set" state for this timer. More... | |
Maintain a collection of guard conditions from associated nodes and callback groups to signal to the executor when associated entities have changed.
Definition at line 33 of file executor_notify_waitable.hpp.
|
explicit |
[in] | on_execute_callback | Callback to execute when one of the conditions of this waitable has signaled the wait_set. |
Definition at line 25 of file executor_notify_waitable.cpp.
void rclcpp::executors::ExecutorNotifyWaitable::add_guard_condition | ( | rclcpp::GuardCondition::WeakPtr | guard_condition | ) |
Add a guard condition to be waited on.
[in] | guard_condition | The guard condition to add. |
Definition at line 153 of file executor_notify_waitable.cpp.
|
overridevirtual |
Add conditions to the wait set.
[in,out] | wait_set | structure that conditions will be added to |
Reimplemented from rclcpp::Waitable.
Definition at line 48 of file executor_notify_waitable.cpp.
References RCL_RET_OK, and rcl_wait_set_add_guard_condition().
|
overridevirtual |
Unset any callback registered via set_on_ready_callback.
Reimplemented from rclcpp::Waitable.
Definition at line 138 of file executor_notify_waitable.cpp.
|
overridevirtual |
Perform work associated with the waitable.
This will call the callback provided in the constructor.
[in] | data | Data to be use for the execute, if available, else nullptr. |
Reimplemented from rclcpp::Waitable.
Definition at line 94 of file executor_notify_waitable.cpp.
|
overridevirtual |
Get the number of ready guard_conditions.
Reimplemented from rclcpp::Waitable.
Definition at line 180 of file executor_notify_waitable.cpp.
|
overridevirtual |
Check conditions against the wait set.
[in,out] | wait_set | structure that internal elements will be checked against. |
Reimplemented from rclcpp::Waitable.
Definition at line 71 of file executor_notify_waitable.cpp.
References rcl_wait_set_s::guard_conditions, and rcl_wait_set_s::size_of_guard_conditions.
void rclcpp::executors::ExecutorNotifyWaitable::remove_guard_condition | ( | rclcpp::GuardCondition::WeakPtr | weak_guard_condition | ) |
Remove a guard condition from being waited on.
[in] | weak_guard_condition | The guard condition to remove. |
Definition at line 166 of file executor_notify_waitable.cpp.
|
overridevirtual |
Set a callback to be called whenever the waitable becomes ready.
[in] | callback | callback to set |
Reimplemented from rclcpp::Waitable.
Definition at line 114 of file executor_notify_waitable.cpp.
|
overridevirtual |
Retrieve data to be used in the next execute call.
Implements rclcpp::Waitable.
Definition at line 101 of file executor_notify_waitable.cpp.
|
overridevirtual |
Take the data from an entity ID so that it can be consumed with execute
.
[in] | id | ID of the entity to take data from. |
Reimplemented from rclcpp::Waitable.
Definition at line 107 of file executor_notify_waitable.cpp.