File size: 3,768 Bytes
700dd75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Installation (Training)

This guide walks through setting up the SONIC training environment for whole-body humanoid control.

## Prerequisites

- **GPU**: NVIDIA GPU with CUDA 12.x (L40 recommended)
- **OS**: Ubuntu 22.04+
- **Python**: 3.11 (required by Isaac Lab; sim/teleop/deploy scripts work on 3.10+)
- **Isaac Lab**: 2.3+ (required for simulation environments)

## Install Isaac Lab

SONIC training uses Isaac Lab for physics simulation. Follow the official
[Isaac Lab installation guide](https://isaac-sim.github.io/IsaacLab/main/source/setup/installation/index.html)
to install Isaac Lab.

After installation, verify:

```bash
python -c "import isaaclab; print(isaaclab.__version__)"
```

## Install gear_sonic (Training)

From the repository root:

```bash
pip install -e "gear_sonic/[training]"
```

This installs the training dependencies (Hydra, W&B, HuggingFace TRL, etc.)
on top of the Isaac Lab environment.

## Download Model and Data from Hugging Face

SONIC model checkpoints and SMPL motion data are hosted on
[Hugging Face](https://huggingface.co/nvidia/GEAR-SONIC).

```bash
pip install huggingface_hub
python download_from_hf.py --training
```

This downloads:

- **PyTorch checkpoint** (`sonic_release/last.pt`) for finetuning
- **SMPL motion data** (`data/smpl_filtered/`) for the SMPL encoder

## Prepare Robot Motion Data

SONIC trains on the [Bones-SEED](https://huggingface.co/datasets/bones-studio/seed) motion capture dataset
(142K+ motion sequences retargeted to the Unitree G1).

### Step 1: Download and convert

Download the **G1 retargeted CSVs** (29 DOF, 120 FPS) from
[Bones-SEED on HuggingFace](https://huggingface.co/datasets/bones-studio/seed), then convert:

```bash
python gear_sonic/data_process/convert_soma_csv_to_motion_lib.py \
    --input /path/to/bones_seed/g1/csv/ \
    --output data/motion_lib_bones_seed/robot \
    --fps 30 --fps_source 120 --individual --num_workers 16
```

### Step 2: Filter motions

Remove motions the G1 robot cannot perform:

```bash
python gear_sonic/data_process/filter_and_copy_bones_data.py \
    --source data/motion_lib_bones_seed/robot \
    --dest data/motion_lib_bones_seed/robot_filtered --workers 16
```

This removes ~8.7% of motions (~130K of 142K remain). See the
[Training Guide](../user_guide/training.md) for details.

Your data directory should look like:

```
<repo_root>/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ motion_lib_bones_seed/
β”‚   β”‚   └── robot_filtered/     # Filtered G1 motions (~130K PKLs)
β”‚   └── smpl_filtered/           # SMPL motion data (from Hugging Face)
└── sonic_release/               # Released checkpoint (from Hugging Face)
```

> **Note**: Data processing scripts (`gear_sonic/data_process/`) do **not** require
> Isaac Lab and can be run on any machine with `pip install -e gear_sonic/`.

## Verify Installation

First, run the pre-flight check to verify all dependencies:

```bash
python check_environment.py --training
```

Then run a quick smoke test with a small number of environments:

```bash
# Interactive (with viewer)
python gear_sonic/train_agent_trl.py \
    +exp=manager/universal_token/all_modes/sonic_release \
    num_envs=16 headless=False \
    ++algo.config.num_learning_iterations=5

# Headless (server / no display)
python gear_sonic/train_agent_trl.py \
    +exp=manager/universal_token/all_modes/sonic_release \
    num_envs=16 headless=True \
    ++algo.config.num_learning_iterations=5
```

After a minute of initialization you should see training metrics (rewards, errors)
printing to the console.

## Full Training

Once installation is verified, see the [Training Guide](../user_guide/training.md)
for full training commands (64+ GPU recommended), evaluation, ONNX export, and
SOMA encoder setup.