Skip to main content

Pure Python library to read, modify, convert, and write rosbag files.

Project description

pipeline status coverage report

Rosbags

Rosbags is the pure python library for everything rosbag. It contains:

  • rosbag2 reader and writer,

  • rosbag1 reader for raw messages,

  • extensible type system with serializers and deserializers,

  • efficient converter between rosbag1 and rosbag2,

  • and more.

Rosbags does not have any dependencies on the ROS software stacks and can be used on its own or alongside ROS1 or ROS2.

Rosbags was developed for MARV, which requires a fast, correct, and flexible library to read, manipulate, and write the various rosbag file formats.

Getting started

Rosbags is published on PyPI and does not have any special dependencies. Simply install with pip:

pip install rosbags

Read and deserialize rosbag2 messages:

from rosbags.rosbag2 import Reader
from rosbags.serde import deserialize_cdr

# create reader instance and open for reading
with Reader('/home/ros/rosbag_2020_03_24') as reader:
    for topic, msgtype, timestamp, rawdata in reader.messages(['/imu_raw/Imu']):
         msg = deserialize_cdr(rawdata, msgtype)
         print(msg.header.frame_id)

Convert rosbag1 to rosbag2:

# Convert "foo.bag", result will be "foo/"
rosbags-convert foo.bag

# Convert "foo.bag", save the result as "bar"
rosbags-convert foo.bag --dst /path/to/bar

Documentation

Read the documentation for further information.

Contributing

Thank you for considering to contribute to rosbags.

To submit issues or create merge requests please follow the instructions provided in the contribution guide.

By contributing to rosbags you accept and agree to the terms and conditions laid out in there.

Development

Clone the repository and setup your local checkout:

git clone https://gitlab.com/ternaris/rosbags.git

cd rosbags
python -m venv venv
. venv/bin/activate

pip install -r requirements-dev.txt
pip install -e .

This creates a new virtual environment with the necessary python dependencies and installs rosbags in editable mode. The rosbags code base uses pytest as its test runner, run the test suite by simply invoking:

pytest

To build the documentation from its source run sphinx-build:

sphinx-build -a docs public

The entry point to the local documentation build should be available under public/index.html.

Support

Professional support is available from Ternaris.

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

rosbags-0.9.2.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

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

rosbags-0.9.2-py3-none-any.whl (48.0 kB view details)

Uploaded Python 3

File details

Details for the file rosbags-0.9.2.tar.gz.

File metadata

  • Download URL: rosbags-0.9.2.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for rosbags-0.9.2.tar.gz
Algorithm Hash digest
SHA256 159a487c53902e8c5aab2878411b47d1a0ee8c6037f79d21ac1b564258829c4f
MD5 3c1b227b4d79737e01b99475862d91d6
BLAKE2b-256 57a5f4cb069d3368cbef16932632b42d477e3026f5f51180cd20402a3925037a

See more details on using hashes here.

File details

Details for the file rosbags-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: rosbags-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 48.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for rosbags-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5d217a9481d6baed987da81632827be7f8954c91fe800c88ca3bd6cc86cf335e
MD5 4f9588a410d70a3f2e21f746a63fadd1
BLAKE2b-256 ed75b6eba6d17500d05277526f6b4c530ef9c2086d04c49144d3288c8523ef65

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