ros-tooling / rosbag2_storage_mcap

rosbag2 storage implementation for MCAP file format
https://mcap.dev/
Apache License 2.0
32 stars 5 forks source link

ros2 bag convert cannot read the input file if the input MCAP is not indexed #61

Closed james-rms closed 1 year ago

james-rms commented 1 year ago

Description

When attempting to use ros2 bag convert with an un-indexed MCAP as the source file, some log messages are printed:

[WARN] [1666590451.821784700] [rosbag2_storage_mcap]: no message indices found, falling back to reading in file order
[ERROR] [1666590451.838618391] [rosbag2_storage_mcap]: cannot read MCAP in time order with no message indexes

ros2 bag convert should not care about read order - it should write them back out in whatever order they arrive. It's possible there should be a "any" ReadOrder option, indicating that the reader leaves the order up to the plugin to determine.

Expected Behavior

ros2 bag convert would succeed in reading the input MCAP.

Actual Behavior

clear and concise description of what actually happened. include copied logs whenever possible

To Reproduce

Take any source bag, and run:

$ cat << EOF > cfg.yaml
output_configs:
  - storage_id: mcap
     uri: bad
     all: true
     storage_config_uri: mcap.yaml
EOF
$ echo "noChunking: true" > mcap.yaml
$  mcap convert -i <your bag path> -o cfg.yaml

System (please complete the following information)

Additional context

Add any other context about the problem here

james-rms commented 1 year ago

Fixed in https://github.com/ros2/rosbag2/pull/1177