-
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
Allow adding time-stamp to the custom output name #1910
Comments
I think this can be fairly easy done by user as shown below, and root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 bag record -a -o mybag_"$(date +"%Y-%m-%d_%H-%M-%S")"
[INFO] [1739303395.217173344] [rosbag2_recorder]: Press SPACE for pausing/resuming
[INFO] [1739303395.220827308] [rosbag2_recorder]: Listening for topics...
[INFO] [1739303395.220835096] [rosbag2_recorder]: Event publisher thread: Starting
[INFO] [1739303395.225336938] [rosbag2_recorder]: Subscribed to topic '/rosout'
[INFO] [1739303395.227837953] [rosbag2_recorder]: Subscribed to topic '/parameter_events'
[INFO] [1739303395.229192994] [rosbag2_recorder]: Subscribed to topic '/events/write_split'
[INFO] [1739303395.230813408] [rosbag2_recorder]: Subscribed to topic '/chatter'
[INFO] [1739303395.230864181] [rosbag2_recorder]: Recording...
[INFO] [1739303399.499334564] [rosbag2_recorder]: Pausing recording.
[INFO] [1739303399.499565413] [rosbag2_cpp]: Writing remaining messages from cache to the bag. It may take a while
[INFO] [1739303399.512315354] [rosbag2_recorder]: Event publisher thread: Exiting
[INFO] [1739303399.512499011] [rosbag2_recorder]: Recording stopped
[INFO] [1739303399.611646502] [rclcpp]: signal_handler(signum=2)
root@tomoyafujita:~/ros2_ws/colcon_ws# ls mybag_2025-02-11_11-49-54/
metadata.yaml mybag_2025-02-11_11-49-54_0.mcap |
You're right, that's a neat solution. I think rosbag in ROS 1 had the ability to have time-stamp and custom name (unless I'm misremembering), that's why I thought it was missing from the ROS 2 version. |
cc @emersonknapp @Kaju-Bubanja. If considering options on how to implement it, I am more inclined to go with option 1.
This way, we can easily backport this feature to Jazzy and Humble, but without |
Option 1 and the proposed backports sound like a nice solution |
I think two different features are being conflated in this discussion:
The way I'm reading it, it's pretty clear that the original ticket is talking exclusively about case 1. 1. Directory naming with timestamp@PfeifferMicha wants to have timestamped directory names, while having control over replacing The feature the are requesting looks concretely like this:
Like @fujitatomoya this can be accomplished simply enough with
And this gives the user complete flexibility without requiring any new features on 2. Bagfile naming with timestampOn the other hand, there is a separate need which is to timestamp each individual file within the recording directory. I believe this is what @MichaelOrlov and @Kaju-Bubanja are discussing. Here is what that looks like:
This feature is part of the story for #1915 ConclusionI feel inclined to close this issue as being exclusively case 1 and |
Okay yeah for cleanliness of history I'm going to close this in favor of #1917 because I like well-scoped atomic tickets and on-topic discussion 😄 If anybody sees a reason for this ticket to remain open that I'm missing, please feel free to reopen it. |
Description
When giving a bag name via -o or --output the time-stamp is no longer added to the output folder name. I'd like to be able to write bags that have both a custom name and a time-stamp.
I frequently record multiple bags where I want the custom name to be the same except for the added timestamp. Example:
Completion Criteria
Implementation Notes / Suggestions
I see three options:
The text was updated successfully, but these errors were encountered: