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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tabular2mcap-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 33781f0287d7b1ea67ddad19d42b1aba9a67b87f1845d14712a7c581d2ee019b
MD5 81ecbced148f4d9afe1ebb6a2129993a
BLAKE2b-256 7a95706ab97aea54f19cff338bc25e147471c52a750c89f2b1b71fae24de6359

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tabular2mcap-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b2f75748161f218db4605c3f7882b91f7da2beabbdd4b4af55b3416461cb3cb
MD5 82c3f718e200693fa34cb16e41c88845
BLAKE2b-256 3b87b1e4d2baa93cd81c10f234ad156d7404b8183eb2ac5d7bdc7d16d58c2634

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