Ctrl+C can't kill the ros2 run
Hi Guys,
I have one ROS2 subscriber and one ROS2 publisher. To ease the execution I have written a bash script which calls both nodes and executes them simultaneously.
Content of the bash script is as below:
ros2 run perception_publisher publisher &
ros2 run behavior_planning_hmi hmi
Execution works fine, however when I try to kill the execution by pressing Ctrl+C
script is not being terminated. It ends up running continuously that I have to kill using the process ID.
Is there a way I can kill the process gracefully?
Thank you,
KK
Can you stop the execution with strg+c when you start only one node directly? If not you have maybe some blocking code or you do not spin.
To start multiple nodes i recommend to use a launchfile. see https://index.ros.org/doc/ros2/Tutori...
Thanks for your reply. Yes, I can stop using
Ctrl+C
when running single node.