Skip to content

kscalelabs/sim

Repository files navigation

K-Scale Open Source Robotics

License Discord Wiki
python black ruff
Python Checks Update Stompy S3 Model

K-Scale Sim Library

A library for simulating Stompy in Isaac Gym. This library is built on top of the Isaac Gym library and Humanoid-gym and provides a simple interface for running experiments with Stompy. For a start, we have defined two tasks: getting up and walking.

We will be adding more tasks and simulator environments in upcoming weeks.

The walking task works reliably with upper body being fixed. The getting up task is still an open challenge!

Getting Started

This repository requires Python 3.8 due to compatibility issues with underlying libraries. We hope to support more recent Python versions in the future.

  1. Clone this repository:
git clone https://github.com/kscalelabs/sim.git
cd sim
  1. Create a new conda environment and install the package:
conda create --name kscale-sim-library python=3.8.19
conda activate kscale-sim-library
make install-dev
  1. Install third-party dependencies:

Manually download IsaacGym_Preview_4_Package.tar.gz from https://developer.nvidia.com/isaac-gym, and run:

tar -xvf IsaacGym_Preview_4_Package.tar.gz
conda env config vars set ISAACGYM_PATH=`pwd`/isaacgym
conda deactivate
conda activate kscale-sim-library
make install-third-party-external

Running Stompy experiments

  1. Download our URDF model from here:
wget https://media.kscale.dev/stompy/latest_stl_urdf.tar.gz && tar -xzvf latest_stl_urdf.tar.gz
python sim/scripts/create_fixed_torso.py
export MODEL_DIR=stompy
  1. Run training with the following command:
python sim/humanoid_gym/train.py --task=legs_ppo --num_envs=4096 --headless

or for full body:

python sim/humanoid_gym/train.py --task=stompy_ppo --num_envs=4096 --headless
  1. Run evaluation with the following command:
python sim/humanoid_gym/play.py --task legs_ppo --sim_device cpu

See this doc for more beginner tips.

Errors

After cloning Isaac Gym, sometimes the bindings mysteriously disappear. To fix this, update the submodule:

git submodule update --init --recursive

If you observe errors with libpython3.8.so.1.0, you can try the following:

export LD_LIBRARY_PATH=PATH_TO_YOUR_ENV/lib:$LD_LIBRARY_PATH

If you still see segmentation faults, you can try the following:

sudo apt-get vulkan1

Appreciation

Discord