Skip to main content

Rosbag splitter

Pure python script to easily split rosbag from commandline. This script is made to cut rosbags without having to install ros and also to allow cutting bags without knowing the UNIX timestamps of the starting and end times.

Requirements

The requirements are managed by poetry and can be seen in the pyproject.toml file. To install the dependencies, install poetry and then run

git clone https://github.com/UkuKert/rosbag_splitter.git 
cd rosbag_splitter
sudo apt update && sudo apt install liblz4-dev
poetry install 

Usage

The following example takes a bag called "input_bag.bag" as an input and makes a 5 second small bag from 20s - 25s and saves that to "small_bag.bag". Note The input bag is preserved.

poetry run python3  rosbag_splitter.py  -i  input_bag.bag -o small_bag.bag -b 20 -e 25

The following example takes a bag called "input_bag.bag" as an input and saves the first 25 seconds of it to "input_bag_cut.bag". Note When begin time is not specified it is assumed to be 0. When output bag is not specified a new name is created with the suffix "_cut" added to the input bag path root.

poetry run python3  rosbag_splitter.py -i input_bag.bag -e 25

For more help run the script with the argument "-h"

poetry run python3  rosbag_splitter.py  rosbag_splitter.py -h

Development

We are using RUFF for static formatting and linting. Use the Makefile to run the linter and formatter:

make fmt
make lint

Metadata

Release files for rosbag-splitter 1.0.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-splitter 1.0.0
File Size Uploaded
rosbag_splitter-1.0.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rosbag-splitter 1.0.0
File Interpreter ABI Platform
rosbag_splitter-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.9 kB

Release files / rosbag_splitter-1.0.0.tar.gz

Download URL rosbag_splitter-1.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
124588be930762458591ae8d3c3fb2b23b6562356eb330a73c3a7d7e59239fd9
BLAKE2b-256 checksum
How to use checksums
ffb9b3820b00b490d95691e27b967f72ceaa56c373c10cf74c5eefbb0ef25c15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.10.16 Linux/6.11.0-1018-azure

Release files / rosbag_splitter-1.0.0-py3-none-any.whl

Download URL rosbag_splitter-1.0.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8fa902c3b58883c05e5412354874a63fd4c0db9905ddee4902af9f998c63fc
BLAKE2b-256 checksum
How to use checksums
3b3ce31a251cd44b9bbed0d65fadf988eb9deda4a1c95d5430f48149d0416968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.0 CPython/3.10.16 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

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