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. Configure environment variables:
conda env config vars set MODEL_DIR=sim/resources
  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 experiments

  1. Run walking training with the following command:
python sim/train.py --task=stompymini --num_envs=4096 --headless

or standing policy:

python sim/train.py --task=stompymini_standing --num_envs=4096 --headless
  1. Run evaluation with the following command:
python sim/play.py --task stompymini --sim_device cpu
  1. You can also run the Mujoco sim2sim example:
python sim/sim2sim.py --load_model examples/standing.pt --embodiment stompypro

Contributing

See the contributing guide to get started.

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

  • Humanoid-gym
  • KScale Labs community for bugspotting and feedback

Discord

Releases

No releases published

Packages

No packages published

Languages