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.0.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.0-py3-none-any.whl (102.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabular2mcap-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 82402607351604f331ed9533c3cb8747adb256e9cd570eab8535c70d3840b166
MD5 87c525a672c4a195d25d5f7cfec372e0
BLAKE2b-256 cbc14e2f399d174bf32c7c3ee5d9ae342fd70922cefdeb654390cf5fdfc1c880

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabular2mcap-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2feb7280993553d889297aa8c99c8596c7e98cce51510cba331471704f3ebd1f
MD5 a0aadb7c6d7e0fa3b35b709167aec025
BLAKE2b-256 3b628289a00406f6d8fd081031e5bc72c863390b3ec9f368f8df71ac529502b3

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