Skip to main content

ROS Bag Filter

Unified ROS1 and ROS2 bag filtering with one Python package, one CLI, and one Tk GUI.

Features

  • ROS1 .bag and ROS2 rosbag2 directory support from the same codebase
  • Topic whitelist filtering
  • Absolute ROS-time or relative-time windows
  • Optional PointCloud2 spatial filter with independent x/y/z min/max bounds
  • Background GUI execution with progress logging and cancellation
  • PyPI-ready packaging with rosbag-filter and rosbag-filter-app entry points

Install

Python 3.8+ is supported.

pip install "rosbag-filter[gui]"

tkinter is a system dependency on Linux. On Ubuntu:

sudo apt-get install python3-tk

CLI

Show help:

rosbag-filter --help

Filter a ROS1 bag:

rosbag-filter \
  --input /data/run.bag \
  --output /data/run_filtered.bag \
  --topics /imu,/tf \
  --time-mode relative \
  --start 5.0 \
  --end 25.0

Filter a ROS2 bag and apply PointCloud2 bounds:

rosbag-filter \
  --input /data/run_ros2 \
  --output /data/run_ros2_filtered \
  --topics /cloud_registered,/tf \
  --time-mode ros \
  --start 1710000000.0 \
  --end 1710000030.0 \
  --workers 8 \
  --pc2-topic /cloud_registered \
  --pc2-x-min -1.0 \
  --pc2-x-max 2.0 \
  --pc2-z-max 1.5

GUI

Launch the GUI:

rosbag-filter-app

The PointCloud2 controls are hidden in the Advanced PointCloud2 Filter panel by default. Expand the panel only when you want to enable spatial filtering and set x/y/z bounds.

rosbag-filter-gui is also installed as a compatibility alias.

For direct source usage, the legacy wrappers still work:

python3 rosbag_filter_app.py
python3 rosbag2_filter_gui.py

Development

Install dev dependencies:

pip install -e ".[dev,gui]"

Run tests:

pytest

Build distributions:

python -m build
python -m twine check dist/*

Release

The repository includes GitHub Actions workflows for CI, TestPyPI, and PyPI trusted publishing.

Before the first release:

  1. Create the rosbag-filter project on TestPyPI.
  2. Create the rosbag-filter project on PyPI.
  3. Configure the testpypi and pypi GitHub environments.
  4. Add trusted publishing for this GitHub repository in both indexes.

Suggested release flow:

  1. Run the TestPyPI workflow manually.
  2. Validate installation from TestPyPI in a clean environment.
  3. Push a version tag like v0.2.0 to publish to PyPI.

Metadata

Release files for rosbag-filter 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rosbag-filter 0.2.0
File Size Uploaded
rosbag_filter-0.2.0.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rosbag-filter 0.2.0
File Interpreter ABI Platform
rosbag_filter-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / rosbag_filter-0.2.0.tar.gz

Download URL rosbag_filter-0.2.0.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1a158439897141742a373538875b7fefc30cad9a7651b664298c981b848a3796
BLAKE2b-256 checksum
How to use checksums
b54a095e7d2dd135fd47a195c0e0345cbfc588d5d6f0589114db68e9d7180668
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2026.

Transparency log

Release files / rosbag_filter-0.2.0-py3-none-any.whl

Download URL rosbag_filter-0.2.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a9622bc879ab47368f1fb947b32755392e53a02df96b41fe18376ab0f854428
BLAKE2b-256 checksum
How to use checksums
9671f76ee3cf52c6e1d1a289aa327963583068ff069ae7ec09497a282fbc104d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page