[ROS2] node names relation between launch file and executable
Hi there,
this might be a basic question but thus far I haven't found specifics in the docs or tutorials.
What is the actual relation between node names specified within the launch file and the executable?
For example in my Python launch file, I include the node:
move_group_node = Node(
package='motion_planner', # name of my package
executable='mgi_planner', # name of my executable as given in CMake file
name='move_group_interface_planner', # name my node will have
output='screen',
parameters=[robot_description, robot_description_semantic, kinematics_yaml]
)
In my executable i use:
auto move_group_node = rclcpp::Node::make_shared("move_group_interface_planner", node_options);
Do the names have to match or will the name given in the launch file simply overwrite the one given in the .cpp? Meaning is the name given within the .cpp only for use within the file?
And what would happen if my executable contains multiple nodes? How do I distinguish them in the launch file?
I'm using ROS2 foxy on Ubuntu 20.04.4 LTS