ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The example creates two nodes:MinimalTimer
and test_node
, but spins only one of them rclcpp::spin(minimal_timer);
. rclcpp::spin()
adds a node to an executor. The executor calls callbacks, like the parameter service callbacks. test_node
must be added to an executor so the parameter service callbacks can send a response.
See the manual composition demo for an example.
rclcpp::executors::SingleThreadedExecutor exec;
exec.add_node(minimal_timer);
exec.add_node(minimal_timer->node_);
exec.spin();