Skip to content

kscalelabs/kbot-joystick

Repository files navigation

K-Sim Gym

Train and deploy your own humanoid robot controller in 700 lines of Python

ksim_video_0514.mp4

Getting Started

You can use this repository as a GitHub template or as a Google Colab.

Google Colab

You can quickly try out the humanoid benchmark by running the training notebook in Google Colab.

On your own GPU

  1. Read through the current leaderboard submissions and through the ksim examples
  2. Create a new repository from this template by clicking here
  3. Make sure you have installed git-lfs:
sudo apt install git-lfs  # Ubuntu
brew install git-lfs  # MacOS
  1. Clone the new repository you create from this template:
git clone [email protected]:<YOUR USERNAME>/ksim-gym.git
cd ksim-gym
  1. Create a new Python environment (we require Python 3.11 or later)
  2. Install the package with its dependencies:
pip install -r requirements.txt
pip install 'jax[cuda12]'  # If using GPU machine, install Jax CUDA libraries
  1. Train a policy:
python -m train
  1. Convert the checkpoint to a kinfer model:
python -m convert /path/to/ckpt.bin /path/to/model.kinfer
  1. Visualize the converted model:
kinfer-sim assets/model.kinfer kbot --save-video assets/video.mp4
  1. Commit the K-Infer model and the recorded video to this repository
  2. Push your code and model to your repository, and make sure the repository is public
  3. Write a message with a link to your repository on our Discord in the "【🧠】submissions" channel
  4. Wait for one of us to run it on the real robot - this should take about a day, but if we are dragging our feet, please message us on Discord
  5. Voila! Your name will now appear on our leaderboard

Troubleshooting

If you encounter issues, please consult the ksim documentation or reach out to us on Discord.

Tips and Tricks

To see all the available command line arguments, use the command:

python -m train --help

To visualize running your model without using kos-sim, use the command:

python -m train run_mode=view

This repository contains a pre-trained checkpoint of a model which has been learned to be robust to pushes, which is useful for both jump-starting model training and understanding the codebase. To initialize training from this checkpoint, use the command:

python -m train load_from_ckpt_path=assets/ckpt.bin

You can visualize the pre-trained model by combining these two commands:

python -m train load_from_ckpt_path=assets/ckpt.bin run_mode=view

If you want to use the Jupyter notebook and don't want to commit your training logs, we suggest using pre-commit to clean the notebook before committing:

pip install pre-commit
pre-commit install

About

K-Bot Joystick Example. Check out K-Sim Gym and K-Sim For More

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •