← Back to all demos

# SONIC Motion Tracking

Humanoid MoCap API GPU Required

## Overview

NVIDIA GEAR-SONIC locomotion controller with two operational modes:

- Planner mode — velocity commands → full-body pose trajectories (10 Hz planning, 50 Hz output)
- Tracking mode — reproduce motion capture clips via encoder+decoder latent-space pipeline

## Architecture: Encoder + Decoder Pipeline

MoCap Clip
CSV joint angles
Encoder
model_encoder.onnx
Latent Space
z ∈ Rd
Decoder
model_decoder.onnx
Joint Targets
29-DOF output

## ONNX Models

Model | File | Purpose
--- | --- | ---
Planner | planner_sonic.onnx | Velocity → full-body trajectory
Encoder | model_encoder.onnx | MoCap clip → latent code
Decoder | model_decoder.onnx | Latent code → joint targets

Models are downloaded from `nvidia/GEAR-SONIC` on HuggingFace on first use.

## Usage: Planner Mode

    from roboharness.robots.unitree_g1 import (
        SonicLocomotionController, SonicMode
    )

    ctrl = SonicLocomotionController()
    action = ctrl.compute(
        command={"velocity": [0.3, 0.0, 0.0], "mode": SonicMode.WALK},
        state={"qpos": qpos, "qvel": qvel},
    )

## Usage: Tracking Mode

    from roboharness.robots.unitree_g1 import (
        SonicLocomotionController, MotionClip
    )

    ctrl = SonicLocomotionController()
    clip = MotionClip.from_csv_dir("path/to/dance_clip/")
    ctrl.set_tracking_clip(clip)

    action = ctrl.compute(
        command={"tracking": True},
        state={"qpos": qpos, "qvel": qvel},
    )

Note: This demo requires an NVIDIA GPU with CUDA/TensorRT and cannot run in CI. The page documents the API and architecture. See #86 (Phase 1) and #92 (Phase 2).
Generated by Roboharness