Class AgnocastOnlyExecutor
Defined in File agnocast_only_executor.hpp
Inheritance Relationships
Derived Types
public agnocast::AgnocastOnlyCallbackIsolatedExecutor(Class AgnocastOnlyCallbackIsolatedExecutor)public agnocast::AgnocastOnlyMultiThreadedExecutor(Class AgnocastOnlyMultiThreadedExecutor)public agnocast::AgnocastOnlySingleThreadedExecutor(Class AgnocastOnlySingleThreadedExecutor)
Class Documentation
-
class AgnocastOnlyExecutor
Base class for Stage 2 executors that handle only Agnocast callbacks (no RMW). Used with agnocast::Node.
Subclassed by agnocast::AgnocastOnlyCallbackIsolatedExecutor, agnocast::AgnocastOnlyMultiThreadedExecutor, agnocast::AgnocastOnlySingleThreadedExecutor
Public Functions
-
explicit AGNOCAST_PUBLIC AgnocastOnlyExecutor()
Construct the executor.
-
virtual ~AgnocastOnlyExecutor()
- virtual AGNOCAST_PUBLIC void spin ()=0
Block the calling thread and process Agnocast callbacks in a loop until cancel() is called.
- virtual AGNOCAST_PUBLIC void cancel ()
Request the executor to stop spinning. Causes the current or next spin() call to return.
- AGNOCAST_PUBLIC void add_callback_group (rclcpp::CallbackGroup::SharedPtr group_ptr, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true)
Add a callback group to this executor.
- Parameters:
group_ptr – Callback group to add.
node_ptr – Node the group belongs to.
notify – If true, wake the executor so it picks up the change immediately.
- AGNOCAST_PUBLIC void remove_callback_group (rclcpp::CallbackGroup::SharedPtr group_ptr, bool notify=true)
Remove a callback group from this executor.
- Parameters:
group_ptr – Callback group to remove.
notify – If true, wake the executor so it picks up the change immediately.
- AGNOCAST_PUBLIC std::vector< rclcpp::CallbackGroup::WeakPtr > get_all_callback_groups ()
Return all callback groups known to this executor.
- Returns:
Vector of weak pointers to callback groups.
- AGNOCAST_PUBLIC std::vector< rclcpp::CallbackGroup::WeakPtr > get_manually_added_callback_groups ()
Return callback groups that were manually added.
- Returns:
Vector of weak pointers to callback groups.
- AGNOCAST_PUBLIC std::vector< rclcpp::CallbackGroup::WeakPtr > get_automatically_added_callback_groups_from_nodes ()
Return callback groups automatically discovered from added nodes.
- Returns:
Vector of weak pointers to callback groups.
- AGNOCAST_PUBLIC void add_node (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true)
Add a node to this executor.
- Parameters:
node_ptr – Node to add.
notify – If true, wake the executor so it picks up the change immediately.
- AGNOCAST_PUBLIC void add_node (const std::shared_ptr< agnocast::Node > &node, bool notify=true)
Add a node to this executor.
- Parameters:
node – Node to add.
notify – If true, wake the executor so it picks up the change immediately.
- AGNOCAST_PUBLIC void remove_node (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true)
Remove a node from this executor.
- Parameters:
node_ptr – Node to remove.
notify – If true, wake the executor so it picks up the change immediately.
- AGNOCAST_PUBLIC void remove_node (const std::shared_ptr< agnocast::Node > &node, bool notify=true)
Remove a node from this executor.
- Parameters:
node – Node to remove.
notify – If true, wake the executor so it picks up the change immediately.
Protected Functions
- WeakCallbackGroupsToNodesMap weak_groups_associated_with_executor_to_nodes_ RCPPUTILS_TSA_GUARDED_BY (mutex_)
- WeakCallbackGroupsToNodesMap weak_groups_to_nodes_associated_with_executor_ RCPPUTILS_TSA_GUARDED_BY (mutex_)
- std::list< rclcpp::node_interfaces::NodeBaseInterface::WeakPtr > weak_nodes_ RCPPUTILS_TSA_GUARDED_BY (mutex_)
-
bool get_next_agnocast_executable(AgnocastExecutable &agnocast_executable, const int timeout_ms, bool &shutdown_detected)
-
bool get_next_ready_agnocast_executable(AgnocastExecutable &agnocast_executable)
-
void execute_agnocast_executable(AgnocastExecutable &agnocast_executable)
-
void add_callback_groups_from_nodes_associated_to_executor()
-
explicit AGNOCAST_PUBLIC AgnocastOnlyExecutor()