bagmanager
A thin wrapper around rosbag.Bag with some convenient methods
Installation
pip install bagmanager
Usage
from bagmanager import BagManager
bag_file = '/path/to/bag/file.bag'
bag_manager = BagManager(bag_file=bag_file)
# info about the bag file
print(bag_manager)
# get information about the topic
topic_info = bag_manager.get_topic_info(topic='some_topic', get_header_time=True)
# get_header_time=True is costly but returns a list of timestamps from the messages headers.
# get the timestamp from the message header of the 3rd message
time_header = topic_info['msg_time_list_header'][2]
# get the timestamp from the bag of the 1st message
time_rosbag = topic_info['msg_time_list_rosbag'][0]
# get the number of messages in the topic
number_of_messages_in_topic = topic_info['message_count']
# get the message type of the topic
message_type = topic_info['message_type']
# get the frequency of messages in the topic
frequency = topic_info['frequency']
# get the closest msg from 'another_topic' to a message from 'some_topic'by its 3rd message **header** time
msg = bag_manager.get_closest_message_by_header_time(topic='another_topic', time_header=time_header)
# get the closest msg from 'another_topic' to a message from 'some_topic'by its 1st message **rosbag** time
msg = bag_manager.get_closest_message_by_rosbag_time(topic='another_topic', time_rosbag=time_rosbag)
# get a msg from 'some_topic' by index
msg = bag_manager.get_message_by_index(topic='some_topic', index=number_of_messages_in_topic-1)
# get the number of messages from topics in an interval of times
start_time_rosbag = topic_info['msg_time_list_rosbag'][2]
end_time_rosbag = topic_info['msg_time_list_rosbag'][7]
message_count = bag_manager.get_message_count_in_interval(topics=['some_topic', 'another_topic'], start_time_rosbag=start_time_rosbag, end_time_rosbag=end_time_rosbag)
Development
Create a venv (recommended)
git clone https://github.com/omrirz/bagmanager.git
python -m pip install -r requirements.txt
Test
python -m pytest
Metadata
Release files for bagmanager 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bagmanager-0.0.5.tar.gz | 3.9 kB | Without provenance | Details for bagmanager-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bagmanager-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for bagmanager-0.0.5-py3-none-any.whl |
Total release size: 8.6 kB
Release files / bagmanager-0.0.5.tar.gz
| Download URL | bagmanager-0.0.5.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6591ef1fee202800ff9077fc507fcaa1a880505c7e3ac39b69d5b386e294eb0
|
|
BLAKE2b-256 checksum How to use checksums |
2d72337fa42df77bfc9db2a4d1ac92f3ab998a2d713cb1b53da679cbd1eb8075
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
|
Release files / bagmanager-0.0.5-py3-none-any.whl
| Download URL | bagmanager-0.0.5-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ee6ceacbea27ef7bf7f148e880085f54690d7dcd38d1a7d99c612f6845b2998
|
|
BLAKE2b-256 checksum How to use checksums |
939cdabcfe9cd53c0d7e57e5a5d8e5267a7fe0e3cf8cd7ec600c3292f7e7a7b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
|
Security for bagmanager 0.0.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.