ROS Bag Filter
Unified ROS1 and ROS2 bag filtering with one Python package, one CLI, and one Tk GUI.
Features
- ROS1
.bagand ROS2rosbag2directory support from the same codebase - Topic whitelist filtering
- Absolute ROS-time or relative-time windows
- Optional PointCloud2 spatial filter with independent
x/y/zmin/max bounds - Background GUI execution with progress logging and cancellation
- PyPI-ready packaging with
rosbag-filterandrosbag-filter-appentry 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:
- Create the
rosbag-filterproject on TestPyPI. - Create the
rosbag-filterproject on PyPI. - Configure the
testpypiandpypiGitHub environments. - Add trusted publishing for this GitHub repository in both indexes.
Suggested release flow:
- Run the TestPyPI workflow manually.
- Validate installation from TestPyPI in a clean environment.
- Push a version tag like
v0.2.0to 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)
| File | Size | Uploaded | |
|---|---|---|---|
| rosbag_filter-0.2.0.tar.gz | 22.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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