Skip to main content

Small Python project to split rosbags by times

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rosbag_splitter-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rosbag_splitter-1.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file rosbag_splitter-1.0.0.tar.gz.

File metadata

  • Download URL: rosbag_splitter-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.10.16 Linux/6.11.0-1018-azure

File hashes

Hashes for rosbag_splitter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 124588be930762458591ae8d3c3fb2b23b6562356eb330a73c3a7d7e59239fd9
MD5 4177a4fa2d24e5a62853c8ce21aaa676
BLAKE2b-256 ffb9b3820b00b490d95691e27b967f72ceaa56c373c10cf74c5eefbb0ef25c15

See more details on using hashes here.

File details

Details for the file rosbag_splitter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rosbag_splitter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.10.16 Linux/6.11.0-1018-azure

File hashes

Hashes for rosbag_splitter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca8fa902c3b58883c05e5412354874a63fd4c0db9905ddee4902af9f998c63fc
MD5 e8a8fdaa572d009972b49d456a2e716f
BLAKE2b-256 3b3ce31a251cd44b9bbed0d65fadf988eb9deda4a1c95d5430f48149d0416968

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page