Convert tabular CSV data to MCAP format with support for ROS2 and JSON schemas
Project description
Tabular2MCAP
Convert tabular data (CSV, Parquet) to MCAP format with support for ROS2 and JSON schemas, enabling seamless integration with robotics workflows, data visualization in Foxglove Studio, and playback of sensor and navigation data.
Please :star: if this helps you today!
Features
- Multi-Format Support: Convert to ROS2 or JSON messages with support for standard message types (e.g.,
sensor_msgs/msg/NavSatFix,geometry_msgs/msg/TransformStamped,foxglove.LocationFix, and more) - Configuration-Driven: YAML-based mapping with Jinja2 templates for flexible data transformation
- Batch Processing: Process multiple files and directories with a single command
Quick Start
Installation
pip install tabular2mcap
Basic Usage
tabular2mcap \
-i /path/to/data/directory \
-o output.mcap \
-c config.yaml \
-f converter_functions.yaml
Configuration System
The tool uses YAML configuration files to define how CSV files should be processed. These are:
config.yaml: Defines file patterns and converter function mappingsconverter_functions.yaml: Contains Jinja2 templates for data transformation
Example Configurations
JSON Format:
# config.yaml
writer_format: "json"
file_mappings:
- file_pattern: 'data.csv'
converter_functions:
- function_name: "row_to_foxglove_location_fix"
schema_name: "foxglove.LocationFix"
topic_suffix: "LocationFix"
ROS2 Format:
# config.yaml
writer_format: "ros2"
tabular_mappings:
- file_pattern: '**/data.csv'
converter_functions:
- function_name: "row_to_nav_sat_fix"
schema_name: "sensor_msgs/msg/NavSatFix"
topic_suffix: "NavSatFix"
Tutorial
For detailed instructions on adding support for new types of CSV data, see the Tutorial in the documentation.
Contributing
See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
License
GNU General Public License v3.0 - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tabular2mcap-0.1.3.tar.gz.
File metadata
- Download URL: tabular2mcap-0.1.3.tar.gz
- Upload date:
- Size: 75.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17618703c73a1f4c215b6cd16731c768f0b0fcd939ce1d169b3d1251c78df201
|
|
| MD5 |
7a56c01aaafaa1bb3fe82990c7a90d0b
|
|
| BLAKE2b-256 |
02f31582c7a986fe7dd6dfe8767a0e45dde5fc34f4ba2cee099764bf8ea8fb4b
|
File details
Details for the file tabular2mcap-0.1.3-py3-none-any.whl.
File metadata
- Download URL: tabular2mcap-0.1.3-py3-none-any.whl
- Upload date:
- Size: 101.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ba18bf585b2b85cf9e7584fd35a7d8cbfac8b90a01c7b5e92424dd192821f77
|
|
| MD5 |
ec7f270ceea88dd784c7656155652c25
|
|
| BLAKE2b-256 |
27cd598cece6734c34eed9fa222c99e6bdc02a6b43c93af9cd10fae4baf5c7c6
|