|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <rclcpp.hpp>
Public Member Functions | |
| void | add_node (const ::rclcpp::Node::SharedPtr &node, bool notify=true) |
| template<typename NodePtr, typename T = void> | |
| void | remove_node (const NodePtr &node, bool notify=true) |
| SingleThreadedExecutor () | |
| void | spin () |
| Block until rclcpp::ok() goes false — rclcpp::spin_in(). | |
| void | spin_all (uint32_t max_duration_ms) |
| void | spin_node_once (const ::rclcpp::Node::SharedPtr &node, int32_t timeout_ms) |
| void | spin_node_some (const ::rclcpp::Node::SharedPtr &node) |
| void | spin_some (uint32_t max_ms=0) |
| template<typename Future> | |
| FutureReturnCode | spin_until_future_complete (Future &&future, int32_t timeout_ms=-1) |
rclcpp::executors::SingleThreadedExecutor — phase-488. ADOPT-BOUNDED.
A FACADE over the process executor, which is what every rclcpp::Node already lives on: there is one session per image (issue 0465) and a node's entities are created in that executor's arena when the node is constructed (RFC-0002). So the three lines a stock main writes keep their meaning —
rclcpp::executors::SingleThreadedExecutor executor; executor.add_node(node); executor.spin();
— with add_node CHECKING the attachment that construction already made rather than making one. The bound, stated: there is no second executor to build, so two of these are the same executor; add_node aborts, naming the node, when the node failed to create or was created on an explicit rclcpp::Executor instead (spinning this would never reach it); there is no remove_node, because arena registration is one-way (the cpp:Executor::add_node row). spin / spin_some are rclcpp::spin_in() / the process executor's spin_some.
|
inline |
|
inline |
Check that node is on the process executor. notify is accepted and ignored, as there is no waiting executor to wake.
|
inline |
REFUSED — remove_node; see rclcpp::Executor::remove_node. phase-515 P2.
|
inline |
Block until rclcpp::ok() goes false — rclcpp::spin_in().
|
inline |
spin_all(max_duration) — phase-515 P2; see rclcpp::Executor::spin_all. A zero bound is refused, as upstream throws for it.
|
inline |
spin_node_once(node, timeout) — phase-515 P2: add_node's check, then one spin_once of the process executor (every node's ready work). The budget is required, as for rclcpp::spin_once.
|
inline |
|
inline |
Drain what is ready, without waiting — Executor::spin_some on the process executor. max_ms is MILLISECONDS (0 = no limit).
|
inline |
spin_until_future_complete(future, timeout) on the process executor — phase-515 P1, the envelope of rclcpp::spin_until_future_complete (int32_t milliseconds, -1 = unbounded, 10 ms slices).