Skip to content

tier4/bagwiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

316 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bagwiz

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-database compression_mode: FILE zstd envelopes (*.db3.zstd)

Any combination of these is accepted transparently.

Installation

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.

  1. Install pixi once, then reopen your shell so pixi is on PATH:

    curl -fsSL https://pixi.sh/install.sh | bash
  2. 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 | lyrical

    pixi run build (no -e) targets Humble, the default environment. Each distro builds into its own build/<distro> and install/<distro>, so builds for several distros can coexist.

  3. Install a bagwiz launcher on your PATH — plus tab completion — so you can run it from anywhere without typing pixi run:

    pixi run -e humble install   # builds, then installs ~/.local/bin/bagwiz + completion

    This 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 bare pixi run install targets Humble, the default environment). Set BAGWIZ_INSTALL_DIR to change the destination, or BAGWIZ_DISTRO to target a different built distro. At run time, BAGWIZ_DISTRO=<distro> still switches which built distro the launcher uses.

  4. Verify the install — bagwiz should now be on your PATH:

    bagwiz --help

    If the command is not found, make sure the install directory (default ~/.local/bin) is on your PATH.

Using your own message packages (overlays)

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 /topic

The 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.

Subcommands

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.

Shell completion

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 --install

Without --install the script is printed to stdout, so you can pipe it anywhere:

bagwiz complete bash > ~/.local/share/bash-completion/completions/bagwiz

Open a new shell, or source the generated file in the current shell:

source ~/.local/share/bash-completion/completions/bagwiz

License

Apache-2.0. See LICENSE.

About

bagwiz — a terminal wizard, swift as a spark, for the recorded worlds of ROS 2 rosbags.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors