Function rclcpp::spin_some(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr)
Defined in File executors.hpp
Function Documentation
-
void rclcpp::spin_some(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
Create a default single-threaded executor and execute any immediately available work.
This method is deprecated because it can lead to very bad performance if used in a loop: each call will create a new executor and register the node, which is an expensive operation. It’s recommended to always manually instantiate an executor and call the methods with the same name on it. For example: SingleThreadedExecutor executor; executor.add_node(node_ptr); executor.spin_some(); If you are using a non-default context, this should be passed to the executor’s constructor.
- Parameters:
node_ptr – Shared pointer to the base interface of the node to spin.