ros2 launchfiles: how to launch nodes that are in the same executable?
Hello all,
I am trying to launch three nodes that are in the same executable to enable intra process communication. In the launchfile I need to create start actions for each of them using:
visualizer_node = launch_ros.actions.LifecycleNode(
node_name='visualizer',
package='modulo_core', node_executable="modulo_core_test_cartesian", output='screen')
robot_interface_node = launch_ros.actions.LifecycleNode(
node_name='robot_interface',
package='modulo_core', node_executable="modulo_core_test_cartesian", output='screen')
motion_generator_node = launch_ros.actions.LifecycleNode(
node_name='motion_generator',
package='modulo_core', node_executable="modulo_core_test_cartesian", output='screen')
As those are lifecycle nodes the rest is just to configure and activate them. The problem with that approach is that it will start the executable modulo_core_test_cartesian
3 times, resulting in 3 versions of the node conflicting. See the output of ros2 node list
:
/launch_ros
/motion_generator
/motion_generator
/motion_generator
/robot_interface
/robot_interface
/robot_interface
/transform_listener_impl_561d275bf460
/transform_listener_impl_561d279b2de0
/transform_listener_impl_561d27d1d390
/transform_listener_impl_563539d7e980
/transform_listener_impl_56353a0e9080
/transform_listener_impl_56353a60d5a0
/transform_listener_impl_5648cc1556a0
/transform_listener_impl_5648cc54f770
/transform_listener_impl_5648cc8b9f00
/visualizer
/visualizer
/visualizer
I don't know how to properly handle this. I have read about compositions on the wiki but I am not sure this will allow me intra process communication. Any ideas on the proper method?
Thanks in advance.
Please note: ROS Answers does not support markdown, so three backticks do not start (or end) a code block.
Oh sorry for that. Good to know thanks