Skip to content

Official Implementation of "Sampling-Based System Identification with Active Exploration for Legged Robot Sim2Real Learning"

Notifications You must be signed in to change notification settings

LeCAR-Lab/SPI-Active

Repository files navigation

Sampling-based System Identification with Active Exploration for Legged Robot Sim2Real Learning

SPI-Active is a sampling-based System Identification (SysID) framework for legged robots, designed with active exploration to identify parameters of legged robots and therby reducing sim2real gap.
This codebase implements the approach published in our CoRL 2025 paper.

Current codebase targets identification of the base mass, center of mass (CoM), and inertia parameters of the Unitree Go2 robot, along with a modular motor dynamics model—enabling robust sim-to-real transfer for legged locomotion control.

Key features:

  • Hydra-powered configuration for clean, modular experiment setup
  • Modular motor model classes inheriting from a base environment for easy extensibility
  • Isaac Gym accelerated simulation for fast sampling and evaluation

TODO

  • Release SPI Code
  • Release Active Exploration code
  • Release Downstream Task training code
  • Release Dataset Replay and Visualize code
  • Release Sim2real

Table of Contents

  1. Installation
  2. System Identification Tools
  3. Running Active SysID
  4. Citing this Work

Installation

This codebase is built following the structure of Humanoidverse and ASAP codebases.

Prerequisites

Installation with uv

1) Create a uv virtual environment (Python 3.8)

uv venv -p 3.8
source .venv/bin/activate

3) Install the repository

Clone the repository and from the repo root:

# Installs the workspace in editable mode and resolves dependencies
uv sync --dev
uv pip install -e isaac_utils/

Install IsaacGym

Download IsaacGym and extract:

wget https://developer.nvidia.com/isaac-gym-preview-4
tar -xvzf isaac-gym-preview-4

Install IsaacGym Python API:

uv pip install -e isaacgym/python

Test installation:

python 1080_balls_of_solitude.py  # or
python joint_monkey.py

For libpython error:

  • Check conda path:
    conda info -e
  • Set LD_LIBRARY_PATH:
    export LD_LIBRARY_PATH=</path/to/conda/envs/your_env/lib>:$LD_LIBRARY_PATH

System Identification Tools

Tools for collecting trajectory data and identifying physical parameters (e.g., mass) in Isaac Gym.

Data Collection

  • Note: For walk.py, install unitree_rl_gym and place walk.py under unitree_rl_gym/legged_gym/scripts/.
# walk.py should be run from unitree_rl_gym/legged_gym/scripts/
python scripts/data/walk.py [--no-video]

# Other data collection scripts
python scripts/data/jump.py [--no-video]
python scripts/data/stand.py [--no-video]
python scripts/data/sine.py [--no-video]

Mass Landscape

Visualize prediction error across different mass values:

python scripts/mass_landscape.py --config all --horizon 5 \
  --env-batch 2048 --project-dir logs/mass_landscape_all

Mass Optimization

Find optimal mass using Bayesian optimization:

python scripts/mass_opt.py --config all --horizon 5 \
  --env-batch 4096 --project-dir logs/mass_opt_all

Example Results

Configuration: all, horizon=5, 50 trials

Ground truth base mass: 6.921 kg
Optimal base mass: 7.006 kg
Best cost: 0.028378

Optimization Results

Running Active SysID

Detailed documentation in present in Active-SysID

Note

Currently the command and dataset is for Unitree Go2. More details on setting up custom dataset, robot parameters and motor models will be released soon!

Downstream Task Training

We also provide training scripts to train the different downstream tasks we evaluate in our work. More details can be found in Downstream-Tasks

Citation

If you find our work useful, please consider citing us!

@article{sobanbabu2025spiactive,
      title={Sampling-Based System Identification with Active Exploration for Legged Robot Sim2Real Learning}, 
      author={Nikhil Sobanbabu and Guanqi He and Tairan He and Yuxiang Yang and Guanya Shi},
      year={2025}
      url={https://arxiv.org/abs/2505.14266}, 
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Official Implementation of "Sampling-Based System Identification with Active Exploration for Legged Robot Sim2Real Learning"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published