Stopping the process launched by a launch file
If I have a launch file like
<launch>
<node type= "processor.py" name="processor" pkg="whatever" output="screen" cwd="node">
</launch>
and I run it, and at some point processor.py
finishes its processing, is there a way for the program to finish automatically?
Right now, it just finishes and announces that "process has finished cleanly" but I still have to Ctrl-C to finish all
Take into account that I plan to add some rosbag record in that launch file in the future as well
Please see #q124721 and #q12751 (and others).
Reopened because I don't think those answers will help if the ros node has shutdown, but the python process has not exited.
Please clarify which process is not exiting: processor.py or roslaunch? Use
ps -ef
at command prompt to determine this. After your node says "finished", is the node still shown byrosnode list
?If it is process.py that lives on, is your code explicitly starting additional threads?
The OP writes:
that implies
processor.py
exits, butroslaunch
waits around, which it does, unless you makeprocessor
required. Which is what the linked Q&As explain.There is only one process in
roslaunch
terminology, which would beprocessor.py
.Unless I'm completely misinterpreting OP's description, (s)he describes
roslaunch
sitting there, waiting forSIGINT
.