ROS 2 rclcpp + rcl - rolling
rolling-a919a6e5
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={}, const rclcpp::Context::SharedPtr &context=rclcpp::contexts::get_global_default_context()) |
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 | set_execute_callback (std::function< void(void)> on_execute_callback) |
Set a new callback to be called whenever this waitable is executed. 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... | |
RCLCPP_PUBLIC std::vector< std::shared_ptr< rclcpp::TimerBase > > | get_timers () const override |
Returns the number of used Timers. 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... | |
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 34 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 23 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 186 of file executor_notify_waitable.cpp.
|
overridevirtual |
Add conditions to the wait set.
[in,out] | wait_set | structure that conditions will be added to |
Implements rclcpp::Waitable.
Definition at line 55 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.
Implements rclcpp::Waitable.
Definition at line 167 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. |
Implements rclcpp::Waitable.
Definition at line 125 of file executor_notify_waitable.cpp.
|
overridevirtual |
Get the number of ready guard_conditions.
Reimplemented from rclcpp::Waitable.
Definition at line 219 of file executor_notify_waitable.cpp.
|
overridevirtual |
Returns the number of used Timers.
Will always return an empty vector.
Implements rclcpp::Waitable.
Definition at line 226 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. |
Implements rclcpp::Waitable.
Definition at line 99 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 199 of file executor_notify_waitable.cpp.
RCLCPP_PUBLIC void rclcpp::executors::ExecutorNotifyWaitable::set_execute_callback | ( | std::function< void(void)> | on_execute_callback | ) |
Set a new callback to be called whenever this waitable is executed.
[in] | on_execute_callback | The new callback |
Definition at line 179 of file executor_notify_waitable.cpp.
|
overridevirtual |
Set a callback to be called whenever the waitable becomes ready.
[in] | callback | callback to set |
Implements rclcpp::Waitable.
Definition at line 147 of file executor_notify_waitable.cpp.
|
overridevirtual |
Retrieve data to be used in the next execute call.
Implements rclcpp::Waitable.
Definition at line 135 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. |
Implements rclcpp::Waitable.
Definition at line 141 of file executor_notify_waitable.cpp.