https://github.com/simeon-ned/predictive-style-matching
Predictive Style Matching (PSM), is method in which an offline predictor maps the robot’s lower-body state history and velocity commands to interpretable upper-body joint and gait targets that shape the rewards during training.
https://github.com/simeon-ned/predictive-style-matching
humanoid-robotics mjlab mujoco mujoco-warp reinforcement-learning robotics unitree-g1
Last synced: 19 days ago
JSON representation
Predictive Style Matching (PSM), is method in which an offline predictor maps the robot’s lower-body state history and velocity commands to interpretable upper-body joint and gait targets that shape the rewards during training.
- Host: GitHub
- URL: https://github.com/simeon-ned/predictive-style-matching
- Owner: simeon-ned
- Created: 2026-05-26T20:22:57.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2026-06-04T17:37:57.000Z (24 days ago)
- Last Synced: 2026-06-09T01:34:20.398Z (19 days ago)
- Topics: humanoid-robotics, mjlab, mujoco, mujoco-warp, reinforcement-learning, robotics, unitree-g1
- Language: Python
- Homepage: https://simeon-ned.github.io/predictive-style-matching/
- Size: 26.3 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Predictive Style Matching (PSM)
[](https://simeon-ned.github.io/predictive-style-matching/)
[](https://simeon-ned.github.io/predictive-style-matching/)
Code for *Predictive Style Matching: Natural and Robust Humanoid Locomotion* on Unitree G1 (first-draft implementation, **work in progress**).
## Dependencies
RL training and simulation build on **[mjlab](https://github.com/mujocolab/mjlab)**. This repo registers the `Psm-G1` task via mjlab’s task entry point. See the [mjlab docs](https://mujocolab.github.io/mjlab/) for install notes, multi-GPU training, and play/export.
Hardware deployment is described for [unitree_rl_mjlab](https://github.com/unitreerobotics/unitree_rl_mjlab) (also mjlab-based).
## Install
```bash
git clone https://github.com/simeon-ned/predictive-style-matching.git
cd predictive-style-matching
uv sync
```
## Quick start
**Predictor (offline)**
```bash
uv run psm-predictor-train
uv run psm-predictor-play --npz data/motions/your_clip.npz
```
Logs go to `logs/predictor//` (`predictor.pth`, `metadata.pkl`, `config.yaml`).
**RL ([mjlab](https://github.com/mujocolab/mjlab))**
```bash
uv run psm-env-train Psm-G1
uv run psm-env-play Psm-G1
uv run psm-list-envs # optional: list registered tasks
```
By default, RL uses the **latest** bundle under `logs/predictor/`, then falls back to `src/psm/predictor/weights/` if none exist. Override:
```bash
uv run psm-env-train Psm-G1 --predictor-path /path/to/bundle
uv run psm-env-train Psm-G1 --predictor-bundled
# or: --env.commands.twist.predictor-path /path/to/bundle
```
Policy logs: `logs/rsl_rl/g1_psm/` (each run snapshots the active predictor under `params/predictor/`). ONNX: `/params/latest.onnx` on play.
**Deploy:** [unitree_rl_mjlab](https://github.com/unitreerobotics/unitree_rl_mjlab) on the robot; copy the exported policy from your play run.
## Repository layout
```text
├── README.md # this file — code & usage
├── pyproject.toml
├── data/
├── src/psm/
│ ├── predictor/ # training; logs → logs/predictor/; weights/ = packaged fallback
│ ├── scripts/ # psm-env-train, psm-env-play, utilities
│ └── env/ # RL (Psm-G1): cfg/, mdp/, runner.py, utils/ (deploy, symmetry, predictor path/log)
└── docs/ # GitHub Pages project site (not Python)
├── index.html
└── static/
```
Paper TeX may live in a separate private repo during review; figures for the site are under `docs/static/images/`.
## Acknowledgments
- [mjlab](https://github.com/mujocolab/mjlab) — RL environment and training stack
- [MuJoCo](https://github.com/google-deepmind/mujoco) — physics simulation
- [unitree_rl_mjlab](https://github.com/unitreerobotics/unitree_rl_mjlab) — G1 sim2real deploy reference