rosbag_to_dataframe
rosbag_to_dataframe is a Python package for extracting data from ROS1 and ROS2 bag files and converting it into pandas DataFrames. This package allows you to easily work with ROS bag file data for analysis and processing.
Requirements
To use the rosbag_to_dataframe package, you need to have the following dependencies installed:
Python 3.7+:Ensure you have Python 3.6 or later installed.pandas:For handling data frames.rosbags:For reading ROS bag files. Make sure you have the rosbags library installed, which supports both ROS1 and ROS2 formats. You can install the required dependencies using pip:
pip install pandas rosbags
Steps to install the package locally
- Clone this repository or download the package files.
- Navigate to the directory containing the setup.py file.
- Run the following command:
pip install .
Steps to use the package to extract data from ROS bag files:
- Import the package:
from rosbag_to_dataframe import extract_data_from_bag
- Specify the bag files, topic, and fields:
bag_files = ['/path/to/your/bagfile1.bag', '/path/to/your/bagfile2.bag'] # List of ROS bag files
topic = '/your_topic' # Topic to extract data from
fields = ['field1', 'field2'] # List of fields to extract from the message
- Extract data:
dataframe = extract_data_from_bag(bag_files, topic, fields)
Error Handling
File Not Found:If a specified bag file does not exist, a warning will be printed, and the file will be skipped.Topic Not Found:If the specified topic is not present in a bag file, a warning will be printed, and the file will be skipped.Field Not Found:If any specified fields are missing from the messages, a warning will be printed. The processing will continue, but missing fields will be noted.Deserialization Errors:If an error occurs during message deserialization, the affected file will be skipped, and an empty DataFrame will be returned for that file.
Contributing
If you would like to contribute to this package, please fork the repository and submit a pull request with your changes. Make sure to include tests and documentation updates as needed.
License
This package is licensed under the MIT License. See the LICENSE file for more details.
Metadata
Release files for rosbag-to-dataframe 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rosbag-to-dataframe-0.2.1.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rosbag_to_dataframe-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / rosbag-to-dataframe-0.2.1.tar.gz
| Download URL | rosbag-to-dataframe-0.2.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5edcc1988a700d8d8046751400429199c28d3132caaab8ab10124267737f8fae
|
|
BLAKE2b-256 checksum How to use checksums |
5270942669bd00349c222030670f82ae081f70562951cb70f9c4ba1e2de08b70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.1
|
Release files / rosbag_to_dataframe-0.2.1-py3-none-any.whl
| Download URL | rosbag_to_dataframe-0.2.1-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d31a06293cb48899e31ea4663d742e3d4fe3447ba18ed1f3ceb17ac38a18bb5
|
|
BLAKE2b-256 checksum How to use checksums |
af586b68a29f324bb9a554201d683b303f5a5641c4ff92c7da7eee841d311d6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.1
|