ROS2: load a composable node through launch
Hi,
The current syntax to launch (as in launch files) composable nodes is to actually run a ComposableNodeContainer that is pre-loaded with nodes.
These nodes can then be unloaded from command line, and other nodes can be loaded similarly from command line.
I am looking for a way to write a launch file that would load nodes in an existing container. For now, using the ComposableNodeContainer syntax leads to a rather strange behavior:
- launch e.g.
ros2 launch composition composition_demo.launch.py
launch a possibly modified version of it (just rename the nodes to avoid conflicts, to not rename the container)
- the container is now appearing twice in
ros2 node list
ros2 component list
only shows information on the second launch
- the container is now appearing twice in
kill the second launch
ros2 component list
now shows that the nodes from the second launch are still in the container
The expected behavior would be to have the final situation, without having to kill the second launch. I would expect that if a container already exists when being launched from a launch file, then the listed ComposableNode's are loaded in the existing one instead of having some kind of shadowing.