This repository provides an implementation of the paper:
SoftMimic: Learning Compliant Whole-body Control from ExamplesGabriel B. Margolis*, Michelle Wang*, Nolan Fey, and Pulkit Agrawal
preprint, 2025
paper / project page
If you use this repository in your work, consider citing:
@article{margolis2025softmimic,
title={{SoftMimic}: Learning Compliant Whole-body Control from Examples},
author={Margolis, Gabriel B. and Wang, Michelle and Fey, Nolan and Agrawal, Pulkit},
journal={arXiv preprint arXiv:2510.17792},
year={2025}
}
The project is distributed under the MIT License (see LICENSE). Third-party components such as unitree_sdk2 retain their original licenses in third-party/unitree_sdk2.
Code in unitree_sdk2 for LCM interface comes from OpenHomie: https://github.com/InternRobotics/OpenHomie which is based on walk-these-ways: https://github.com/Improbable-AI/walk-these-ways
This code depends on a number of open-source projects without which the system would not be possible:
- IsaacLab: https://github.com/isaac-sim/IsaacLab
- RSL-RL: https://github.com/leggedrobotics/rsl_rl
- Mink: https://github.com/kevinzakka/mink
- MuJoCo: https://github.com/google-deepmind/mujoco
- unitree_sdk2: https://github.com/unitreerobotics/unitree_sdk2
git clone https://github.com/Improbable-AI/softmimic_release_dev.git
cd softmimic_release_dev
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -e ".[all]" # installs optional extras (mujoco, lcm, mink, seaborn)Use pip install -e softmimic_gym[isaac] if you intend to run Isaac-based training scripts.
softmimic_release_dev/
├── compliant_motion_augmentation/ # Compliant motion augmentation pipeline
├── pretrained_models/ # Exported policies (JIT + params)
├── scripts/ # RSL-RL training/eval helpers
├── softmimic_deploy/ # Deployment interfaces, sensors, utils
├── softmimic_gym/ # Isaac Lab extension + packaging
└── third-party/unitree_sdk2/ # Unitree SDK source (for deployment)
python softmimic_deploy/src/deploy_policy_interface.py \
--interface mujoco \
--policy ../../pretrained_models/2025-09-26_03-54-58_StaticStand-SoftMimic/model_48000.jit \
--motion_path stand.csv \
--renderControls (mujoco viewer):
L: calibrate to the initial pose,X: start the policy,Y: enter damping mode,- Arrow keys/PageUp/PageDown: joystick emulation.
The CLI accepts any motion CSV under datasets/motions_csv/ or SOFTMIMIC_DATA_ROOT. Paths outside that tree can be passed explicitly.
-
Network setup
- Connect via Ethernet and assign a static IP on
192.168.123.0/24. - Ensure
ssh unitree@ROBOT_IPis reachable (default G1ROBOT_IPis192.168.123.164and default password123).
- Connect via Ethernet and assign a static IP on
-
Repository sync
# Optional overrides: ROBOT_HOST, TARGET_DIR ./send_to_g1.sh -
On-robot environment
ssh unitree@192.168.123.164 cd ~/softmimic_release wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh bash Miniconda3-latest-Linux-aarch64.sh conda create -n softmimic python=3.10 conda activate softmimic pip install -e ".[lcm]" sudo apt-get install liblcm-dev
-
Unitree SDK build
cd third-party/unitree_sdk2 mkdir -p build && cd build cmake .. make -j
-
Deployment
-
Terminal 1 (
./g1_control eth0) to bridge between LCM and the Unitree SDK. -
Terminal 2 to launch the policy:
python softmimic_deploy/src/deploy_policy_interface.py \ --interface lcm \ --policy ../../pretrained_models/2025-09-26_03-54-58_StaticStand-SoftMimic/model_48000.jit
-
Button guide matches the physical remote (L1: initial pose, X: deploy, Y: e-stop/damping mode).
-
Visualize the augmentation process in Mujoco:
python mink_generator_ff.py interactive --motion_path ../datasets/motions_csv/stand.csv --force_mode forcefieldpython mink_generator_ff.py interactive --motion_path ../datasets/motions_csv/boxpick.csv --force_mode collision-emulatorGenerate the full augmented dataset:
cd compliant_motion_augmentation
./generate_all.sh # batch-generate datasets listed in config.pyTo generate a compliant dataset for a new csv file, simply edit generate_all.sh.
We follow the CSV formatting convention of Unitree's LAFAN1 Retargeting Dataset, appending two columns that annotate the foot contact state.
Install the extension then register environments:
cd softmimic_gym
pip install -e ".[isaac]"
cd ..
python scripts/list_envs.py # prints registered task IDsTraining example (requires Isaac Sim running or headless):
python scripts/rsl_rl/train.py \
--task Isaac-G1-AugmentedReference-ForceTorque-Control-VariableStiffness-Hybrid-Deployable-Mimic-v0 --headlesspython scripts/rsl_rl/test.py \
--task Isaac-G1-AugmentedReference-ForceTorque-Control-VariableStiffness-Hybrid-Deployable-Mimic-v0 \
--num_envs 1 \
--video --video_length 2000 --headless- Follow all safety guidelines given by Unitree.
- Ensure that only one instance of the deployment script runs on the robot at a time.
- This is research code provided as-is to facilitate future research -- the user assumes all liability.