Skip to main content

A package to extract data from ROS2 bag files into pandas DataFrames.

Project description

rosbag_to_dataframe

Pylint

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

  1. Clone this repository or download the package files.
  2. Navigate to the directory containing the setup.py file.
  3. Run the following command:
pip install .

Steps to use the package to extract data from ROS bag files:

  1. Import the package:
from rosbag_to_dataframe import extract_data_from_bag
  1. 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
  1. 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.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

rosbag_to_dataframe-0.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file rosbag_to_dataframe-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rosbag_to_dataframe-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7c9ef2db8c7ccf6b0b790c747dc138d0a3a039272780c1559d5f9f133db5a3f
MD5 e2df60898fe8ad24b29adbc4f72f8e71
BLAKE2b-256 0825f252773347512637c41caf8ecd4d51f2d0b791399eb8262413ce41cb2e74

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