Hi,
in the ROS2 Motion Planning using C++ | ROS2 Developers Open Class [#148], the main looks as follows:
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
rclcpp::NodeOptions node_options;
node_options.automatically_declare_parameters_from_overrides(true);
auto move_group_node =
rclcpp::Node::make_shared("move_group_demo", node_options);
rclcpp::executors::SingleThreadedExecutor planner_executor;
std::shared_ptr<TestTrajectory> planner_node =
std::make_shared<TestTrajectory>(move_group_node);
planner_executor.add_node(planner_node);
planner_executor.spin();
rclcpp::shutdown();
return 0;
}
I’m mainly confused about what exactly happens in the node creation. Why are we first creating the move_group_node
and then the planner_node
? Are they two separate nodes or what is their relation since we’re only adding the latter to the executor?
Thanks in advance!