ros2 launch doesn't exit on ctrlc
Im using the following launch file:
def launch(launch_descriptor, argv):
ld = launch_descriptor
ld.add_process(
cmd=[get_executable_path(package_name='canoc', executable_name='transceiver')]
)
ld.add_process(
cmd=[get_executable_path(package_name='radar', executable_name='radar_controller')]
)
This is being launched using:
launch all_launch.launch
Everything works fine but if I try to ctrl+c out the whole thing gets stuck and I have to kill -9 my way out of it. The last thing I get is:
[0] KeyboardInterrupt
(0) signal SIGTERM
(0) rc -15
(1) rc 1
and thats it. Any ideas? Am I supposed to launch this thing differently or is this a bug? I saw something as it relates to windows but not Ubuntu. This is ubuntu 18.04 btw, built from source. Thanks!
when I do ctrlC , ros2 launch exit but is there any other way to do so ? Can we do something like "shutdown" from the launch.py file itself? Thanks.
I converted your response to a comment, please do not use "answer" as a way to ask a new question. Also new questions should be posted as new questions, not comments to related questions.
Have a look at this: https://answers.ros.org/question/3078... I believe it already answers your question.
please pardon my comment. ros2 launch exit is not working only with ctrlC. After ctrlC, ctrZ needs to be given in order to exit/stop.
Please ask a new question and post the link here. This isn't the same issue as described in the question above, nor is it about the same launch. OP is using
launch.legacy
, you're using the new launch.