how to gracefully kill rosbag record using launchfile
Hi guys,
I am trying to find a way to gracefully kill rosbag record using a launchfile.
I am type:
When i launch it, they can't find the node. Is there a better way to do this? As i want to use a system service to run this launch file when shutting down
Asked by winwinftw90 on 2019-02-20 05:42:32 UTC
Comments
Just to clarify you want to kill rosbag record when your system is shutting down yes? If so this should be fairly straightforward with a bash script without using a launch file at all.
Asked by PeteBlackerThe3rd on 2019-02-20 07:35:39 UTC
Hi Peter, yes you are right. may you enlighten me on the ways to do it. I have tried bash scripts but none work. I thinking that using rosnode kill and using it via a launch script is the only way that I can think of as for now
Asked by winwinftw90 on 2019-02-20 08:40:01 UTC
You should be able to use the command
pkill rosbag
the tricky part is that you will need to ensure that the user running that command has the permissions to kill that process. Also rosbag can take a while to finish writing the file, during system shutdown this could be problematic.Asked by PeteBlackerThe3rd on 2019-02-20 10:04:06 UTC
I see, will give it a shot. Thanks for the advice
Asked by winwinftw90 on 2019-02-20 10:09:46 UTC