Skip to main content

Lightwheel Egosuite DevKit - MCAP conversion and visualization pipeline

Project description

LW-Egosuite-DevKit

Backend Installation

Prerequisites

  • Operating System: Ubuntu 20.04 or higher

Install

1. Conda environment

conda create -n lw_egosuite_devkit python=3.11 -y
conda activate lw_egosuite_devkit

2. Install the package

From PyPI:

pip install lw-egosuite-devkit

From source:

git clone https://github.com/LightwheelAI/LW-Egosuite-DevKit.git
cd LW-Egosuite-DevKit
pip install -e .

Usage

1. Conversion for Visualization

Generate visualization-ready MCAP files from raw egosuite MCAP data.

1.1 Single File Conversion

cd LW-Egosuite-DevKit
lw-egosuite convert --mcap $input_mcap_path --mcap_vis $mcap_for_vis_path
Parameter Description
--mcap Path to the source MCAP file (not a directory)
--mcap_vis (Optional) Output path. Default: {input_dir}/{input_stem}_vis.mcap

Output path is printed at the start of conversion.

1.2 Batch Conversion

cd LW-Egosuite-DevKit

data_path="/path/to/your/data"

for input_mcap_path in "$data_path"/*.mcap; do
    [ -e "$input_mcap_path" ] || continue

    echo "Processing: $input_mcap_path ..."

    # output goes to same directory as input
    lw-egosuite convert --mcap "$input_mcap_path"
done
  • $data_path: The directory containing the source MCAP files. Each file will be converted and saved with a _vis.mcap suffix in the same directory as the source file.

2. Visualization with Foxglove Studio

Follow these steps to visualize the processed data in Foxglove Studio:

  1. Launch Foxglove: Open the Foxglove Studio desktop application or web version.
  2. Import Layout: Load the recommended configuration file: assets/default_layout.json.
  3. Load Data Streams: Simultaneously load the source file mcap_filename.mcap and the generated visualization file {mcap_filename}_vis.mcap (in the same directory as the source by default).

Once loaded, the visualization will appear in the Foxglove Studio dashboard as shown below:

image

3. Reading from MCAP

3.1 Export Video (CLI)

Export video requires ffmpeg on PATH. If not installed:

sudo apt install ffmpeg

Export a foxglove.CompressedVideo topic from an MCAP file to MP4. Uses stream copy (no re-encode). Output is a valid MP4 with moov atom at the start for compatibility.

lw-egosuite export-video --mcap path/to/file.mcap --output output.mp4
Parameter Description
--mcap Input MCAP file path
--output Output MP4 file path
--topic (Optional) CompressedVideo topic to export. Default: /sensor/camera/head_left/video

3.2 Iterate decoded messages (Python API)

Iterate decoded proto messages with the built-in reader:

from lw_egosuite_backend.mcap_reader import iter_messages

for m in iter_messages("out.mcap"):
    print(m.topic, m.log_time_ns, m.message)

# Filter by topics
for m in iter_messages("out.mcap", topics=["/pose/body"]):
    print(m.topic, m.message)

3.3 Decoding camera video frames (Python API)

Camera streams are stored as foxglove.CompressedVideo messages on topics such as:

  • /sensor/camera/head_left/video
  • /sensor/camera/head_right/video

You can decode these into numpy.ndarray or torch.Tensor using EgosuiteMcapReader.iter_video_frames:

from lw_egosuite_backend.mcap_reader import EgosuiteMcapReader, iter_video_frames

# Using the context-managed reader:
with EgosuiteMcapReader("episode.mcap") as r:
    for frame in r.iter_video_frames("/sensor/camera/head_left/video", output="numpy"):
        # frame is a numpy.ndarray with shape (H, W, 3), dtype=uint8
        print(frame.shape, frame.dtype)

# Using the convenience helper for a single topic:
for frame in iter_video_frames(
    "episode.mcap",
    topic="/sensor/camera/head_left/video",
    output="numpy",  # or "torch"
):
    print(frame.shape)

Notes:

  • Video decoding requires ffmpeg and ffprobe on PATH.
  • numpy is required; torch is only required when output="torch".

License

This project is licensed under the Apache License 2.0.

Copyright 2026 Lightwheel Team

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

lw_egosuite_devkit-0.3.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

lw_egosuite_devkit-0.3.0-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file lw_egosuite_devkit-0.3.0.tar.gz.

File metadata

  • Download URL: lw_egosuite_devkit-0.3.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for lw_egosuite_devkit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7d7eaa4346e715e1bb5e9093ef2bafca9113dce8c4a8d2b5baa10475f9e474b0
MD5 aaf6a14886d3aae2af67b50281a28204
BLAKE2b-256 269b6e915f95023eeb7605621fa1c62050f6a45b2fb588e788e2a30b5f1ebe39

See more details on using hashes here.

File details

Details for the file lw_egosuite_devkit-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lw_egosuite_devkit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bda6532060ed53d2effcf096c02e63a4a97dfcc6a20c87dc18977692edaee2a
MD5 93180ea7d6e61f776368c8e26efd86f1
BLAKE2b-256 3a31a756308b7a6457b6940409f3dffedab1138ce7abb8b67230b7cb74918d8e

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