Skip to content

[BUG] convert to-mcap/to-bag commands don't actually convert formats #33

@zhexuany

Description

@zhexuany

Resolution

After evaluating the complexity and use case, we decided not to implement cross-format conversion between BAG and MCAP.

Rationale

  1. Limited Use Case: Format conversion is rarely needed in practice
  2. Existing Tools: rosbag, ros2 bag, and Foxglove's mcap CLI already handle conversions
  3. Core Value: robocodec's strength is reading both formats well, not converting between them
  4. Complexity: ROS1 and ROS2 have fundamental serialization differences (alignment, headers, etc.)
  5. Semantic Loss: ROS1 std_msgs/Header has seq field that ROS2 doesn't - conversion loses information

Changes Made

  • Modified convert to-mcap and convert to-bag commands to:
    • Return a clear error when cross-format conversion is attempted
    • Still work for same-format normalization (rewriting a file in the same format)
    • Provide helpful error message suggesting alternative tools

Example Error Message

Error: Cross-format conversion (BAG → MCAP) is not supported.

robocodec can read and write both BAG and MCAP formats, but cannot convert between them.
The serialization formats are fundamentally different (ROS1 vs ROS2).

For format conversion, consider using:
- Foxglove's mcap CLI: https://github.com/foxglove/mcap
- rosbag tool for ROS1 bags
- ros2 bag tool for ROS2

Use 'robocodec convert normalize' to rewrite a file in the same format.

Focus Instead

The project will focus on:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions