Skip to main content

Convert tabular CSV data to MCAP format with support for ROS2 and JSON schemas

Project description

Tabular2MCAP

Convert tabular CSV data to MCAP format with native support for ROS2 and JSON schemas.

Tabular2MCAP is a powerful tool that converts tabular data (CSV files) into MCAP format, enabling seamless integration with robotics workflows, data visualization in Foxglove Studio, and playback of sensor and navigation data.

Features

  • Multi-Format Support: Convert to ROS2 or JSON messages
  • ROS2 Message Support: Native support for standard ROS2 message types including sensor_msgs/NavSatFix, geometry_msgs/TransformStamped, and more
  • Configuration-Driven: YAML-based mapping system for flexible data conversion using Jinja2 templates
  • Foxglove Integration: Native support for LocationFix, FrameTransform, and other Foxglove schemas
  • Batch Processing: Process multiple data directories with a single command

Quick Start

Installation

Following the below steps to install the Tabular2MCAP converter.

# Clone repository
git clone <repository-url>
cd tabular2mcap

# Using uv (recommended)
uv sync

# Or using pip
pip install -r requirements.txt

Basic Usage

Run the below command in terminal to generate an MCAP file. Make sure to be in the tabular2mcap directory and not a sub-folder.

# Convert CSV files to MCAP with configuration
uv run tabular2mcap \
  -i /path/to/csv/files \
  -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 mappings
  • converter_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 TUTORIAL.md.

Development

Foxglove Schema Setup

Foxglove schemas have been already downloaded from the official foxglove-sdk repository. To update schemas to the latest version, run:

cd tabular2mcap/external
uv run python update_foxglove_schema.py

This script downloads the latest JSON schema files directly from GitHub.

Roadmap

  • Schema mapping configuration files
  • Jinja2 template system for data transformation
  • ROS2 message support
  • ROS1 message support
  • Protobuf schema support

License

Proprietary

Project details


Download files

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

Source Distribution

tabular2mcap-0.1.1.tar.gz (75.6 kB view details)

Uploaded Source

Built Distribution

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

tabular2mcap-0.1.1-py3-none-any.whl (102.0 kB view details)

Uploaded Python 3

File details

Details for the file tabular2mcap-0.1.1.tar.gz.

File metadata

  • Download URL: tabular2mcap-0.1.1.tar.gz
  • Upload date:
  • Size: 75.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for tabular2mcap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e4221f0df877a7124e0d0e9254adcd129b08a6cdf2cc336b50b8ffdc2412cdfe
MD5 4a1a5fde52f4a19f688e5236434dc5d6
BLAKE2b-256 3d72ef0c9e9346c7150f00211f50d689a551b77b3b2f40cee1898aa4837372a0

See more details on using hashes here.

File details

Details for the file tabular2mcap-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tabular2mcap-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 102.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for tabular2mcap-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16a61e93e155688af5c304e1af49c811be46128c46e844d8cceb766984ccbe72
MD5 27daebeaef5eda8cb7ad11003030ec2f
BLAKE2b-256 e2ad7e8e34b990c27904f6d9c6b051a04ca0126ee3d70ba137be85f9e6c8bb10

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