.. image:: https://gitlab.com/ternaris/rosbags/badges/master/pipeline.svg
:target: https://gitlab.com/ternaris/rosbags/-/commits/master
:alt: pipeline status
.. image:: https://gitlab.com/ternaris/rosbags/badges/master/coverage.svg
:target: https://gitlab.com/ternaris/rosbags/-/commits/master
:alt: coverage report
.. image:: https://img.shields.io/pypi/pyversions/rosbags
:alt: python versions
.. image:: https://img.shields.io/pypi/dm/rosbags
:alt: PyPI - Downloads
=======
Rosbags
=======
Rosbags is the **pure python** library for everything rosbag. It contains:
- **highlevel** easy-to-use interfaces,
- **rosbag2** reader and writer,
- **rosbag1** reader and writer,
- **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 <https://gitlab.com/ternaris/marv-robotics>`_, 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 messages from rosbag1 or rosbag2 files:
.. code-block:: python
from pathlib import Path
from rosbags.highlevel import AnyReader
from rosbags.typesys import Stores, get_typestore
bagpath = Path('/home/ros/rosbag_2020_03_24')
# Create a type store to use if the bag has no message definitions.
typestore = get_typestore(Stores.ROS2_FOXY)
# Create reader instance and open for reading.
with AnyReader([bagpath], default_typestore=typestore) as reader:
connections = [x for x in reader.connections if x.topic == '/imu_raw/Imu']
for connection, timestamp, rawdata in reader.messages(connections=connections):
msg = reader.deserialize(rawdata, connection.msgtype)
print(msg.header.frame_id)
Convert between rosbag versions::
# Convert "foo.bag", result will be "foo/"
rosbags-convert foo.bag
# Convert "bar", result will be "bar.bag"
rosbags-convert bar
# Convert "foo.bag", save the result as "bar"
rosbags-convert foo.bag --dst /path/to/bar
# Convert "bar", save the result as "foo.bag"
rosbags-convert bar --dst /path/to/foo.bag
Documentation
=============
Read the `documentation <https://ternaris.gitlab.io/rosbags/>`_ for further information.
.. end documentation
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 <https://gitlab.com/ternaris/rosbags/-/blob/master/CONTRIBUTING.rst>`_.
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 <https://ternaris.com>`_.
Raw data
{
"_id": null,
"home_page": null,
"name": "sixriver-rosbags",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "cdr, conversion, deserialization, idl, mcap, message, msg, reader, ros, ros2, rosbag, rosbag2, serialization, writer",
"author": null,
"author_email": "Ternaris <team@ternaris.com>",
"download_url": "https://files.pythonhosted.org/packages/e8/98/34b02171c3107b06326e1fe012a351f071d1627b9039384eb7007c3f6b40/sixriver_rosbags-0.0.4.tar.gz",
"platform": null,
"description": ".. image:: https://gitlab.com/ternaris/rosbags/badges/master/pipeline.svg\n :target: https://gitlab.com/ternaris/rosbags/-/commits/master\n :alt: pipeline status\n\n.. image:: https://gitlab.com/ternaris/rosbags/badges/master/coverage.svg\n :target: https://gitlab.com/ternaris/rosbags/-/commits/master\n :alt: coverage report\n\n.. image:: https://img.shields.io/pypi/pyversions/rosbags\n :alt: python versions\n\n.. image:: https://img.shields.io/pypi/dm/rosbags\n :alt: PyPI - Downloads\n\n=======\nRosbags\n=======\n\nRosbags is the **pure python** library for everything rosbag. It contains:\n\n- **highlevel** easy-to-use interfaces,\n- **rosbag2** reader and writer,\n- **rosbag1** reader and writer,\n- **extensible** type system with serializers and deserializers,\n- **efficient converter** between rosbag1 and rosbag2,\n- and more.\n\nRosbags does not have any dependencies on the ROS software stacks and can be used on its own or alongside ROS1 or ROS2.\n\nRosbags was developed for `MARV <https://gitlab.com/ternaris/marv-robotics>`_, which requires a fast, correct, and flexible library to read, manipulate, and write the various rosbag file formats.\n\n\nGetting started\n===============\n\nRosbags is published on PyPI and does not have any special dependencies. Simply install with pip::\n\n pip install rosbags\n\n\nRead and deserialize messages from rosbag1 or rosbag2 files:\n\n.. code-block:: python\n\n from pathlib import Path\n\n from rosbags.highlevel import AnyReader\n from rosbags.typesys import Stores, get_typestore\n\n bagpath = Path('/home/ros/rosbag_2020_03_24')\n\n # Create a type store to use if the bag has no message definitions.\n typestore = get_typestore(Stores.ROS2_FOXY)\n\n # Create reader instance and open for reading.\n with AnyReader([bagpath], default_typestore=typestore) as reader:\n connections = [x for x in reader.connections if x.topic == '/imu_raw/Imu']\n for connection, timestamp, rawdata in reader.messages(connections=connections):\n msg = reader.deserialize(rawdata, connection.msgtype)\n print(msg.header.frame_id)\n\n\nConvert between rosbag versions::\n\n # Convert \"foo.bag\", result will be \"foo/\"\n rosbags-convert foo.bag\n\n # Convert \"bar\", result will be \"bar.bag\"\n rosbags-convert bar\n\n # Convert \"foo.bag\", save the result as \"bar\"\n rosbags-convert foo.bag --dst /path/to/bar\n\n # Convert \"bar\", save the result as \"foo.bag\"\n rosbags-convert bar --dst /path/to/foo.bag\n\n\nDocumentation\n=============\n\nRead the `documentation <https://ternaris.gitlab.io/rosbags/>`_ for further information.\n\n.. end documentation\n\n\nContributing\n============\n\nThank you for considering to contribute to rosbags.\n\nTo submit issues or create merge requests please follow the instructions provided in the `contribution guide <https://gitlab.com/ternaris/rosbags/-/blob/master/CONTRIBUTING.rst>`_.\n\nBy contributing to rosbags you accept and agree to the terms and conditions laid out in there.\n\n\nDevelopment\n===========\n\nClone the repository and setup your local checkout::\n\n git clone https://gitlab.com/ternaris/rosbags.git\n\n cd rosbags\n python -m venv venv\n . venv/bin/activate\n\n pip install -r requirements-dev.txt\n pip install -e .\n\n\nThis 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::\n\n pytest\n\n\nTo build the documentation from its source run sphinx-build::\n\n sphinx-build -a docs public\n\n\nThe entry point to the local documentation build should be available under ``public/index.html``.\n\n\nSupport\n=======\n\nProfessional support is available from `Ternaris <https://ternaris.com>`_.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Pure Python library to read, modify, convert, and write rosbag files.",
"version": "0.0.4",
"project_urls": {
"Changelog": "https://gitlab.com/ternaris/rosbags/-/blob/master/CHANGES.rst",
"Documentation": "https://ternaris.gitlab.io/rosbags",
"Homepage": "https://gitlab.com/ternaris/rosbags",
"Issues": "https://gitlab.com/ternaris/rosbags/issues",
"Source": "https://gitlab.com/ternaris/rosbags"
},
"split_keywords": [
"cdr",
" conversion",
" deserialization",
" idl",
" mcap",
" message",
" msg",
" reader",
" ros",
" ros2",
" rosbag",
" rosbag2",
" serialization",
" writer"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ed6a41e5e4cc04e0806669e07b78324e6b876557d187140425b5217ca38bbedd",
"md5": "cd966b6b5be8e4ad378f9531147ac4e6",
"sha256": "985a34dc5624ef911c7ea9a8ca1868ab776753a179dfc820e89739f42eeb3926"
},
"downloads": -1,
"filename": "sixriver_rosbags-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cd966b6b5be8e4ad378f9531147ac4e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 131354,
"upload_time": "2024-08-29T14:46:58",
"upload_time_iso_8601": "2024-08-29T14:46:58.297640Z",
"url": "https://files.pythonhosted.org/packages/ed/6a/41e5e4cc04e0806669e07b78324e6b876557d187140425b5217ca38bbedd/sixriver_rosbags-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e89834b02171c3107b06326e1fe012a351f071d1627b9039384eb7007c3f6b40",
"md5": "d84cc32558acd2ec54f330ddbbdb31f1",
"sha256": "f3ac6186022ad20ac59e286a9d839b9d01d559371155fd702577971defbc3724"
},
"downloads": -1,
"filename": "sixriver_rosbags-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "d84cc32558acd2ec54f330ddbbdb31f1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 191230,
"upload_time": "2024-08-29T14:46:59",
"upload_time_iso_8601": "2024-08-29T14:46:59.851195Z",
"url": "https://files.pythonhosted.org/packages/e8/98/34b02171c3107b06326e1fe012a351f071d1627b9039384eb7007c3f6b40/sixriver_rosbags-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-29 14:46:59",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "ternaris",
"gitlab_project": "rosbags",
"lcname": "sixriver-rosbags"
}