-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify recording time for a ros2 bag #1857
Comments
An alternative solution that I found is by storing the ros2 bag record /topic_name
BAG_PID=$!
sleep time_length
kill $BAG_PID |
@paoloelle, @nicolaloi Could you please provide a real-world use cases/examples when this functionality with requested new |
Why one would need to record for some time and then automatically stop at the first hand? Why not send |
@MichaelOrlov I'm running an evolutionary algorithm using ROS 2 and Gazebo. In my setup, I need to run a huge amount of simulations (each of them lasts 1 minute) and be able to stop/resume a simulation, change some parameters, and record the data for each single run (using ros2 bag). I do that in an automated way by using a bash file. I thought that having an option that allows me to specify the duration of my recording instead of having to explicitly kill the process would be a more practical way to stop the recording. Also, my idea is to run these simulations on a computing cluster, and I’m not sure I will have the privileges to kill processes at will.
Does this service already exist? Sorry, but I didn't know about that. |
@MichaelOrlov I’d say that having options (in the CLI, as class parameters, node parameters) to specify a known bag duration, size, etc., is more convenient and user-friendly than having to setup a ros service call at a specific moment to stop the recording (especially when the stopping condition is not based on the simple duration).
Apart from integration testing (eg #1574), other use cases are data collection scenarios (eg for ML training) where you can already know in advance how many messages you need to collect (eg images). More generally, there are cases where you simply want to record for a predefined specific duration or a set number of messages. Currently, once the recording starts it can only be stopped through "external" signals like SIGINT or a ros service. Integrating a built-in stopping based on predefined conditions (providing at least a standard/common condition like max recording duration as in ros1) would simplify its usage. |
Description
I would like to have a flag that allows to specify the time length of a record of a ros2 bag.
Related Issues
I cannot specify the time length when I want to record a bag file. I need it since I will run the record from a bash file and the command
timeout 10 ros2 bag record /topic_name
doesn't work. If I run the same command directly from the terminal works.Completion Criteria
The text was updated successfully, but these errors were encountered: