Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 475

Does "rosbag record -j" do its compression in the background after ROS shutdown?

$
0
0
I have a Python node that invokes ``rosbag record -j`` to record some topics. * On shutdown, ``rosbag`` returns. * At that point I want to run a script that uploads the bag from the robot to a server. That will take a while, and I don't want to delay shutdown so long. * The node, which is now shutting down, runs the script in the background under a different process group using the Linux ``setsid`` command ([link to code](https://github.com/utexas-bwi/bwi_common/blob/joq/autolog/bwi_logging/src/bwi_logging/logger_node.py#L97)). * Even when I run the script that way, it sometimes stops immediately without copying the expected bag file, which is expected to match ``$prefix_*.bag``. Running the same command afterwards by hand works fine. * Delaying the script from starting seems to make it work more often. The length of delay needed appears to increase with the size of the bag. So, I wonder if ``rosbag record -j`` is running its compression step in the background after ROS shutdown causes it to return. That would explain what I see: the ``$prefix_*.bag`` file does not exist until compression finishes.

Viewing all articles
Browse latest Browse all 475

Trending Articles