python3 GUI tool to read ROS2 bag files, plot topic data, and export CSV/plots.
- Detects bag folders automatically (
metadata.yaml,.db3,.mcap) - Normalizes time to start at
0seconds (t_sec) - Plots known ROS message types directly
- Supports custom message recovery using pasted
.msgdefinition - Supports custom multi-field mapping (including array channels)
- Per-topic derivative checkbox (
Plot d1/d2) to include first/second derivatives in the same plot figure/HTML - Per-topic smoothing checkbox (
Smooth d1/d2) for derivative traces, with GUI-selectable moving-average sample window - Exports:
- CSV files to
csv/ - HTML plots to
plots/ - PNG/SVG plots to
plots/(Plotly or Matplotlib fallback)
- CSV files to
git clone https://github.com/L2S-lab/ros2bag_plotter.git
cd ros2bag_plotter
python3 -m venv .venv
source .venv/bin/activate
pip install -e .python3 -m pip install --user "git+https://github.com/L2S-lab/ros2bag_plotter.git@main"For development tools:
git clone https://github.com/L2S-lab/ros2bag_plotter.git
cd ros2bag_plotter
python3 -m venv .venv
pip install -e .[dev]ros2bag-plotterIn the app:
- Select root folder containing one or more bag folders.
- Pick bag and topics.
- Plot, export CSV, or batch export all bags.
This project includes an interactive launcher that:
- asks you to select ROS2 distro from the CI-supported list
(humble,jazzy,kilted,lyrical,rolling) - builds a docker image with that distro argument
- mounts your host root folder (default:
$HOME) into the container - runs the GUI with X11 display forwarding
- Docker installed
- X11 session running (
DISPLAYset) xhostavailable
./scripts/run_gui_docker.shWhen prompted, enter:
- distro choice
Inside the container, your host root is mounted at /host_root and used as working directory. You can then pick any subfolder from the GUI root-folder picker. If /media or /mnt exist on host, they are mounted too.
Optional: choose a different host root mount:
HOST_MOUNT_ROOT=/path/on/host ./scripts/run_gui_docker.shcurl -fsSL https://raw.githubusercontent.com/L2S-lab/ros2bag_plotter/main/scripts/run_gui_docker.sh | bashYou can combine with custom host mount root:
curl -fsSL https://raw.githubusercontent.com/L2S-lab/ros2bag_plotter/main/scripts/run_gui_docker.sh | HOST_MOUNT_ROOT=/path/on/host bashRun the one-liner again:
curl -fsSL https://raw.githubusercontent.com/L2S-lab/ros2bag_plotter/main/scripts/run_gui_docker.sh | bashOr save a local launcher once (recommended):
mkdir -p ~/.local/bin
curl -fsSL https://raw.githubusercontent.com/L2S-lab/ros2bag_plotter/main/scripts/run_gui_docker.sh -o ~/.local/bin/ros2bag-plotter-docker
chmod +x ~/.local/bin/ros2bag-plotter-docker
~/.local/bin/ros2bag-plotter-dockerAfter that, future runs are:
~/.local/bin/ros2bag-plotter-dockerTo avoid Python/ROS version clashes, the container is built from a ROS base image (ros:<distro>-ros-base) instead of python:slim.
humble->ros:humble-ros-basejazzy->ros:jazzy-ros-baserolling->ros:rolling-ros-basekilted->ros:rolling-ros-base(fallback)lyrical->ros:rolling-ros-base(fallback)
The selected ROS distro is still passed as ROS_DISTRO in the container for runtime typestore selection.
Check installed version:
python3 -m pip show ros2bag-plotterUpdate to latest main:
python3 -m pip install --user --upgrade "git+https://github.com/L2S-lab/ros2bag_plotter.git@main"Install/update to specific tag or commit:
python3 -m pip install --user --upgrade "git+https://github.com/L2S-lab/ros2bag_plotter.git@v1.2.0"
python3 -m pip install --user --upgrade "git+https://github.com/L2S-lab/ros2bag_plotter.git@<commit_sha>"Force reinstall from GitHub even if version string is unchanged:
python3 -m pip install --user --upgrade --force-reinstall "git+https://github.com/L2S-lab/ros2bag_plotter.git@main"ruff check src tests --select F,E9
pytest -q