Skip to content

feat(rosbag2_transport): add progress reporting to ros2 bag convert - #2438

Open
Sourav0607 wants to merge 1 commit into
ros2:rollingfrom
Sourav0607:rolling-bag-convert-progress
Open

feat(rosbag2_transport): add progress reporting to ros2 bag convert#2438
Sourav0607 wants to merge 1 commit into
ros2:rollingfrom
Sourav0607:rolling-bag-convert-progress

Conversation

@Sourav0607

Copy link
Copy Markdown

Description

Add progress reporting to ros2 bag convert so users can gauge how long
large bag conversions will take.

Previously, the convert command gave no feedback during conversion, making
it impossible to estimate remaining time for large bags.

Changes:

  • Sum total message count from input bag metadata before conversion starts
  • Print progress at each 1% increment with message count
  • Handle edge case where total message count is unknown
  • Print final done message with total messages written

Example output:

[INFO] [rosbag2_transport]: Converting bag: 0% (0 / 30 messages)
[INFO] [rosbag2_transport]: Converting bag: 50% (15 / 30 messages)
[INFO] [rosbag2_transport]: Converting bag: 100% (30 / 30 messages)
[INFO] [rosbag2_transport]: Converting bag: done (30 messages written)

Fixes #2435

Is this user-facing behavior change?

Yes. Users will now see progress output when running ros2 bag convert.

Did you use Generative AI?

No.

Additional Information

Tested manually with a recorded bag on Rolling (Lyrical Luth tarball).

Comment thread rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp
@Sourav0607
Sourav0607 force-pushed the rolling-bag-convert-progress branch from c42a276 to f8d6b12 Compare June 1, 2026 12:24
Comment thread rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp Outdated
@Sourav0607
Sourav0607 force-pushed the rolling-bag-convert-progress branch from f8d6b12 to 788d8eb Compare June 1, 2026 12:38
Print conversion progress as percentage and message count during
ros2 bag convert to help users gauge how long large bag conversions
will take. Progress is printed at each 1% increment.

Fixes ros2#2435

Signed-off-by: Sourav Anil Hawaldar <sourav.hawaldar@gmail.com>
@Sourav0607
Sourav0607 force-pushed the rolling-bag-convert-progress branch from 788d8eb to 8966b1c Compare June 5, 2026 16:28
@Sourav0607
Sourav0607 requested a review from cwit-vcas June 5, 2026 18:14

@cwit-vcas cwit-vcas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I do not have any power to merge.

Comment thread rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp
@Sourav0607

Copy link
Copy Markdown
Author

@MichaelOrlov could you please review this PR when you get a chance?
The implementation adds progress reporting to ros2 bag convert as requested
in issue #2435. All CI checks should be passing now.

auto topic_outputs = setup_topic_filtering(input_bags, output_bags);

// Sum total message count across all input bags for progress reporting
// Sum total message count across all input bags for progress reporting

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double comment

@MichaelOrlov MichaelOrlov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sourav0607 Thank you for you interest to contributing and making Rosbag2 better.
I didn't have time to run through a thorough review.
However, for a high level design approach I would expect an implementation of the progress bar in a separate class similar to how it was made in the #1836 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ros2 bag convert should print progress

3 participants