|
| StaticSingleThreadedExecutor (const rclcpp::ExecutorOptions &options=rclcpp::ExecutorOptions()) |
| Default constructor. See the default constructor for Executor. More...
|
|
virtual | ~StaticSingleThreadedExecutor () |
| Default destrcutor. More...
|
|
void | spin () override |
| Static executor implementation of spin. More...
|
|
void | spin_some (std::chrono::nanoseconds max_duration=std::chrono::nanoseconds(0)) override |
| Static executor implementation of spin some. More...
|
|
void | spin_all (std::chrono::nanoseconds max_duration) override |
| Static executor implementation of spin all. More...
|
|
void | add_callback_group (rclcpp::CallbackGroup::SharedPtr group_ptr, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true) override |
| Add a callback group to an executor. More...
|
|
void | remove_callback_group (rclcpp::CallbackGroup::SharedPtr group_ptr, bool notify=true) override |
| Remove callback group from the executor. More...
|
|
void | add_node (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true) override |
| Add a node to the executor. More...
|
|
void | add_node (std::shared_ptr< rclcpp::Node > node_ptr, bool notify=true) override |
| Convenience function which takes Node and forwards NodeBaseInterface. More...
|
|
void | remove_node (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true) override |
| Remove a node from the executor. More...
|
|
void | remove_node (std::shared_ptr< rclcpp::Node > node_ptr, bool notify=true) override |
| Convenience function which takes Node and forwards NodeBaseInterface. More...
|
|
std::vector< rclcpp::CallbackGroup::WeakPtr > | get_all_callback_groups () override |
| Get callback groups that belong to executor. More...
|
|
std::vector< rclcpp::CallbackGroup::WeakPtr > | get_manually_added_callback_groups () override |
| Get callback groups that belong to executor. More...
|
|
std::vector< rclcpp::CallbackGroup::WeakPtr > | get_automatically_added_callback_groups_from_nodes () override |
| Get callback groups that belong to executor. More...
|
|
| Executor (const rclcpp::ExecutorOptions &options=rclcpp::ExecutorOptions()) |
| Default constructor. More...
|
|
virtual | ~Executor () |
| Default destructor. More...
|
|
template<typename RepT = int64_t, typename T = std::milli> |
void | spin_node_once (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node, std::chrono::duration< RepT, T > timeout=std::chrono::duration< RepT, T >(-1)) |
| Add a node to executor, execute the next available unit of work, and remove the node. More...
|
|
template<typename NodeT = rclcpp::Node, typename RepT = int64_t, typename T = std::milli> |
void | spin_node_once (std::shared_ptr< NodeT > node, std::chrono::duration< RepT, T > timeout=std::chrono::duration< RepT, T >(-1)) |
| Convenience function which takes Node and forwards NodeBaseInterface. More...
|
|
void | spin_node_some (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node) |
| Add a node, complete all immediately available work, and remove the node. More...
|
|
void | spin_node_some (std::shared_ptr< rclcpp::Node > node) |
| Convenience function which takes Node and forwards NodeBaseInterface. More...
|
|
virtual void | spin_once (std::chrono::nanoseconds timeout=std::chrono::nanoseconds(-1)) |
|
template<typename FutureT , typename TimeRepT = int64_t, typename TimeT = std::milli> |
FutureReturnCode | spin_until_future_complete (const FutureT &future, std::chrono::duration< TimeRepT, TimeT > timeout=std::chrono::duration< TimeRepT, TimeT >(-1)) |
| Spin (blocking) until the future is complete, it times out waiting, or rclcpp is interrupted. More...
|
|
void | cancel () |
| Cancel any running spin* function, causing it to return. More...
|
|
void | set_memory_strategy (memory_strategy::MemoryStrategy::SharedPtr memory_strategy) |
| Support dynamic switching of the memory strategy. More...
|
|
|
bool | execute_ready_executables (bool spin_once=false) |
| Executes ready executables from wait set. More...
|
|
void | spin_some_impl (std::chrono::nanoseconds max_duration, bool exhaustive) |
|
void | spin_once_impl (std::chrono::nanoseconds timeout) override |
|
void | spin_node_once_nanoseconds (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node, std::chrono::nanoseconds timeout) |
|
void | spin_some_impl (std::chrono::nanoseconds max_duration, bool exhaustive) |
|
void | execute_any_executable (AnyExecutable &any_exec) |
| Find the next available executable and do the work associated with it. More...
|
|
void | wait_for_work (std::chrono::nanoseconds timeout=std::chrono::nanoseconds(-1)) |
|
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | get_node_by_group (const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes, rclcpp::CallbackGroup::SharedPtr group) |
|
bool | has_node (const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) const |
| Return true if the node has been added to this executor. More...
|
|
rclcpp::CallbackGroup::SharedPtr | get_group_by_timer (rclcpp::TimerBase::SharedPtr timer) |
|
virtual void | add_callback_group_to_map (rclcpp::CallbackGroup::SharedPtr group_ptr, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, WeakCallbackGroupsToNodesMap &weak_groups_to_nodes, bool notify=true) RCPPUTILS_TSA_REQUIRES(mutex_) |
| Add a callback group to an executor. More...
|
|
virtual void | remove_callback_group_from_map (rclcpp::CallbackGroup::SharedPtr group_ptr, WeakCallbackGroupsToNodesMap &weak_groups_to_nodes, bool notify=true) RCPPUTILS_TSA_REQUIRES(mutex_) |
| Remove a callback group from the executor. More...
|
|
bool | get_next_ready_executable (AnyExecutable &any_executable) |
|
bool | get_next_ready_executable_from_map (AnyExecutable &any_executable, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) |
|
bool | get_next_executable (AnyExecutable &any_executable, std::chrono::nanoseconds timeout=std::chrono::nanoseconds(-1)) |
|
virtual void | add_callback_groups_from_nodes_associated_to_executor () RCPPUTILS_TSA_REQUIRES(mutex_) |
| Add all callback groups that can be automatically added from associated nodes. More...
|
|
memory_strategy::MemoryStrategy::SharedPtr memory_strategy_ | RCPPUTILS_TSA_PT_GUARDED_BY (mutex_) |
| The memory strategy: an interface for handling user-defined memory allocation strategies. More...
|
|
WeakNodesToGuardConditionsMap weak_nodes_to_guard_conditions_ | RCPPUTILS_TSA_GUARDED_BY (mutex_) |
| maps nodes to guard conditions More...
|
|
WeakCallbackGroupsToNodesMap weak_groups_associated_with_executor_to_nodes_ | RCPPUTILS_TSA_GUARDED_BY (mutex_) |
| maps callback groups associated to nodes More...
|
|
WeakCallbackGroupsToNodesMap weak_groups_to_nodes_associated_with_executor_ | RCPPUTILS_TSA_GUARDED_BY (mutex_) |
| maps callback groups to nodes associated with executor More...
|
|
WeakCallbackGroupsToNodesMap weak_groups_to_nodes_ | RCPPUTILS_TSA_GUARDED_BY (mutex_) |
| maps all callback groups to nodes More...
|
|
std::list< rclcpp::node_interfaces::NodeBaseInterface::WeakPtr > weak_nodes_ | RCPPUTILS_TSA_GUARDED_BY (mutex_) |
| nodes that are associated with the executor More...
|
|
Static executor implementation.
This executor is a static version of the original single threaded executor. It's static because it doesn't reconstruct the executable list for every iteration. All nodes, callbackgroups, timers, subscriptions etc. are created before spin() is called, and modified only when an entity is added/removed to/from a node.
To run this executor instead of SingleThreadedExecutor replace: rclcpp::executors::SingleThreadedExecutor exec; by rclcpp::executors::StaticSingleThreadedExecutor exec; in your source code and spin node(s) in the following way: exec.add_node(node); exec.spin(); exec.remove_node(node);