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/experimental/executors/events_executor/events_executor.hpp"
24 #include "rclcpp/executors/events_cbg_executor/events_cbg_executor.hpp"
25 #include "rclcpp/node.hpp"
26 #include "rclcpp/utilities.hpp"
27 #include "rclcpp/visibility_control.hpp"
47 [[deprecated(
"use SingleThreadedExecutor::spin_all instead")]]
51 const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr & node_ptr,
52 std::chrono::nanoseconds max_duration);
69 [[deprecated(
"use SingleThreadedExecutor::spin_all instead")]]
72 spin_all(
const rclcpp::Node::SharedPtr & node_ptr, std::chrono::nanoseconds max_duration);
88 [[deprecated(
"use SingleThreadedExecutor::spin_some instead")]]
91 spin_some(
const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr & node_ptr);
107 [[deprecated(
"use SingleThreadedExecutor::spin_some instead")]]
110 spin_some(
const rclcpp::Node::SharedPtr & node_ptr);
116 spin(
const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr & node_ptr);
120 spin(
const rclcpp::Node::SharedPtr & node_ptr);
141 template<
typename FutureT,
typename TimeRepT =
int64_t,
typename TimeT = std::milli>
143 spin_node_until_future_complete(
145 const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr & node_ptr,
146 const FutureT & future,
147 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
157 template<
typename NodeT =
rclcpp::Node,
typename FutureT,
typename TimeRepT = int64_t,
158 typename TimeT = std::milli>
160 spin_node_until_future_complete(
162 const std::shared_ptr<NodeT> & node_ptr,
163 const FutureT & future,
164 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
166 return rclcpp::executors::spin_node_until_future_complete(
168 node_ptr->get_node_base_interface(),
175 template<
typename FutureT,
typename TimeRepT =
int64_t,
typename TimeT = std::milli>
177 spin_until_future_complete(
178 const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr & node_ptr,
179 const FutureT & future,
180 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
183 options.context = node_ptr->get_context();
185 return executors::spin_node_until_future_complete<FutureT>(executor, node_ptr, future, timeout);
188 template<
typename NodeT =
rclcpp::Node,
typename FutureT,
typename TimeRepT = int64_t,
189 typename TimeT = std::milli>
191 spin_until_future_complete(
192 const std::shared_ptr<NodeT> & node_ptr,
193 const FutureT & future,
194 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1))
196 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(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr, bool notify=true)
Remove a node from the executor.
virtual RCLCPP_PUBLIC void add_node(const 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_some(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr)
Create a default single-threaded executor and execute any immediately available work.
FutureReturnCode
Return codes to be used with spin_until_future_complete.
RCLCPP_PUBLIC void spin(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr)
Create a default single-threaded executor and spin the specified node.
RCLCPP_PUBLIC void spin_all(const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr &node_ptr, std::chrono::nanoseconds max_duration)
Create a default single-threaded executor and execute all available work exhaustively.
Options to be passed to the executor constructor.