A fast CLI for analyzing, processing, and extracting data from ROS 2 rosbags entirely offline — without spinning up a ROS graph. rosbag2 inputs are read through a unified backend that spans three independent dimensions:
- Storage format — MCAP (
*.mcap) or SQLite3 (*.db3) - Layout — a rosbag2 directory or a bare single file
- Compression — uncompressed, rosbag2
compression_mode: MESSAGE, MCAP per-chunk compression, or whole-databasecompression_mode: FILEzstd envelopes (*.db3.zstd)
Any combination of these is accepted transparently.
bagwiz is built and run through pixi — no system ROS 2 install needed.
bagwiz provides first-class support for the long-term-support (LTS) ROS 2
distributions — Humble, Jazzy, and Lyrical; pixi.toml exposes one environment
per distro.
-
Install pixi once, then reopen your shell so
pixiis onPATH:curl -fsSL https://pixi.sh/install.sh | bash -
Build bagwiz against a distro. The first build downloads that distro's packages and compiles bagwiz; later builds are incremental:
pixi run -e humble build # or: jazzy | lyricalpixi run build(no-e) targets Humble, the default environment. Each distro builds into its ownbuild/<distro>andinstall/<distro>, so builds for several distros can coexist. -
Install a
bagwizlauncher on yourPATH— plus tab completion — so you can run it from anywhere without typingpixi run:pixi run -e humble install # builds, then installs ~/.local/bin/bagwiz + completionThis installs the launcher and shell completion for your current shell in one step, always overwriting any existing copies. Use the same
-e <distro>you built with (a barepixi run installtargets Humble, the default environment). SetBAGWIZ_INSTALL_DIRto change the destination, orBAGWIZ_DISTROto target a different built distro. At run time,BAGWIZ_DISTRO=<distro>still switches which built distro the launcher uses. -
Verify the install —
bagwizshould now be on yourPATH:bagwiz --help
If the command is not found, make sure the install directory (default
~/.local/bin) is on yourPATH.
Bags whose topics use message types beyond the standard stack need the matching
ROS 2 message packages available at run time. Build those packages in your own
colcon workspace, then point BAGWIZ_OVERLAY at it (colon-separated for several
workspaces) before running bagwiz:
BAGWIZ_OVERLAY=/path/to/my_msgs_ws pixi run -e humble run -- walk my.mcap /topicThe overlay's install/setup.bash is layered on top of the distro, so bagwiz
finds your custom message definitions and typesupport at run time without a
rebuild. Build overlays against the same distro so their libraries stay ABI
compatible with bagwiz.
bagwiz is a single executable that dispatches to one subcommand per
invocation. Click through for full usage, options, and examples:
| Command | What it does |
|---|---|
bagwiz ls |
List topics in a ROS 2 rosbag with counts and average frequencies. |
bagwiz walk |
Interactively walk a ROS 2 topic's messages as decoded YAML. |
bagwiz convert |
Repack a ROS 2 rosbag between storage backends/layouts, or convert topic message types (NavSatFix → pose). |
bagwiz topic |
Keep (keep), drop (drop), or rename (rename) topics in a ROS 2 rosbag. |
bagwiz generate |
Generate non-rosbag media from a rosbag — e.g. render an image topic to a video (video). |
bagwiz traj |
Dump a topic's pose trajectory to TUM, or join a trajectory file back into a bag. |
bagwiz tf |
Inspect the TF frame tree in a ROS 2 rosbag. |
bagwiz slam |
In-process LiDAR (or LiDAR-IMU) SLAM over a PointCloud2 topic — trajectory + map (run). Optional build. |
bagwiz check |
Find rosbags whose storage is corrupt / unreadable, and optionally delete them. |
bagwiz complete |
Generate a shell completion script (bash, zsh, fish). |
bagwiz <subcommand> --help is always available and reflects the same
options documented in the per-command pages.
pixi run install already installs completion for your current shell (see step 3
of Installation). To install it manually, or for a different
shell, bagwiz complete <shell> generates a completion script for bash, zsh,
or fish. Pass --install to write it to the shell's standard location
automatically (parent directories are created):
bagwiz complete bash --install
bagwiz complete zsh --install # remember to put ~/.zsh/completions on $fpath
bagwiz complete fish --installWithout --install the script is printed to stdout, so you can pipe it
anywhere:
bagwiz complete bash > ~/.local/share/bash-completion/completions/bagwizOpen a new shell, or source the generated file in the current shell:
source ~/.local/share/bash-completion/completions/bagwizApache-2.0. See LICENSE.