explaingit

adiao1973/librobotbagfix

31C++

TLDR

LibRobotBagFix is a C++ library and command-line tool for reading and repairing the black-box log files that ROS 2 robots record.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

LibRobotBagFix is a C++ library and command-line tool for reading and repairing the black-box log files that ROS 2 robots record. The focus is commercial robots such as autonomous delivery vehicles, lawn-mowing robots, and inspection robots, which continuously record cameras, IMU readings, odometry, control commands, and diagnostics into the rosbag2 format. The problem the project targets is that when one of these robots crashes, falls, hits an emergency stop, or loses power, the underlying recording files do not get closed cleanly. ROS 2 stores its bags in either MCAP or SQLite3 .db3 files, and a half-written tail or missing index means the official rosbag2 tools refuse to open the file. The data closest to the incident, which is the part an investigation team most wants, becomes inaccessible. The project is laid out in three layers. The bottom layer is a binary repair engine that scans MCAP records, rebuilds the required summary and footer at the end of the file, and for SQLite3 first tries SQLite's own recovery and then falls back to page-level salvage. The middle layer is a lightweight C++ SDK with a stable C ABI that exposes a reader, a topic enumerator, a message iterator, and small helpers for common ROS 2 message types like Pose, Odometry, Imu, and Image. It does not depend on the ROS 2 runtime, so you can ship it inside non-ROS applications. The top layer is an optional Qt desktop demo for opening, inspecting, repairing, and previewing bags in the field. The command-line tool has two main subcommands. robotbagfix inspect reports topics, message counts, time ranges, and warnings about damaged tails or sidecar files. robotbagfix repair writes a fixed copy to a new file, never modifying the input in place. JSON output is available for both, so other tools can consume the results. The README is clear about what the project does not do. It does not provide DDS publish or subscribe, it does not implement a rosbag player, and it does not promise to recover the contents of large messages whose payloads, such as full image frames or point clouds, were only partially written before the failure.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.