15 #ifndef RCLCPP__EXECUTORS_HPP_
16 #define RCLCPP__EXECUTORS_HPP_
21 #include "rclcpp/executors/multi_threaded_executor.hpp"
22 #include "rclcpp/executors/single_threaded_executor.hpp"
23 #include "rclcpp/executors/static_single_threaded_executor.hpp"
24 #include "rclcpp/experimental/executors/events_executor/events_executor.hpp"
25 #include "rclcpp/node.hpp"
26 #include "rclcpp/utilities.hpp"
27 #include "rclcpp/visibility_control.hpp"
37 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
38 std::chrono::nanoseconds max_duration);
42 spin_all(rclcpp::Node::SharedPtr node_ptr, std::chrono::nanoseconds max_duration);
48 spin_some(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr);
52 spin_some(rclcpp::Node::SharedPtr node_ptr);
58 spin(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr);
62 spin(rclcpp::Node::SharedPtr node_ptr);
82 template<
typename FutureT,
typename TimeRepT =
int64_t,
typename TimeT = std::milli>
84 spin_node_until_future_complete(
86 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
87 const FutureT & future,
88 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
98 template<
typename NodeT =
rclcpp::Node,
typename FutureT,
typename TimeRepT = int64_t,
99 typename TimeT = std::milli>
101 spin_node_until_future_complete(
103 std::shared_ptr<NodeT> node_ptr,
104 const FutureT & future,
105 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
107 return rclcpp::executors::spin_node_until_future_complete(
109 node_ptr->get_node_base_interface(),
116 template<
typename FutureT,
typename TimeRepT =
int64_t,
typename TimeT = std::milli>
118 spin_until_future_complete(
119 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
120 const FutureT & future,
121 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
124 options.context = node_ptr->get_context();
126 return executors::spin_node_until_future_complete<FutureT>(executor, node_ptr, future, timeout);
129 template<
typename NodeT =
rclcpp::Node,
typename FutureT,
typename TimeRepT = int64_t,
130 typename TimeT = std::milli>
132 spin_until_future_complete(
133 std::shared_ptr<NodeT> node_ptr,
134 const FutureT & future,
135 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
137 return rclcpp::spin_until_future_complete(node_ptr->get_node_base_interface(), future, timeout);
Coordinate the order and timing of available communication tasks.
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.
virtual RCLCPP_PUBLIC void remove_node(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true)
Remove a node from the executor.
virtual RCLCPP_PUBLIC void add_node(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, bool notify=true)
Add a node to the executor.
Node is the single point of entry for creating publishers and subscribers.
Single-threaded executor implementation.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
RCLCPP_PUBLIC void spin(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
Create a default single-threaded executor and spin the specified node.
FutureReturnCode
Return codes to be used with spin_until_future_complete.
RCLCPP_PUBLIC void spin_all(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr, std::chrono::nanoseconds max_duration)
Create a default single-threaded executor and execute all available work exhaustively.
RCLCPP_PUBLIC void spin_some(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
Create a default single-threaded executor and execute any immediately available work.
Options to be passed to the executor constructor.