This repository contains an environment for simulating a quadruped robot optionally equipped with PEA (Parallel Elastic Actuator) accomplishing several higly-dynamical jumping based tasks as:
- explosive jumping in place and forward
- continuous jumping forward
- backflip
using the methodology described here: Two-Stage Learning.
Here you can see some results:
A full video presentation of the whole project and results is available here.
If you are interested only in the environment to work on a cleaner and leaner code you can find it here: environment_only.
Recommend using conda with python3.7 or higher. After installing conda, this can be done as follows:
conda create -n [YOUR_ENV_NAME] python=3.7
To activate the virtualenv:
conda activate [YOUR_ENV_NAME]
Install all dependencies:
pip install -r requirements.txt
- env for the quadruped environment files, please see the gym simulation environment quadruped_gym_env.py, the robot specific functionalities in quadruped.py, and config variables in configs_go1.py. You will need to make edits in quadruped_gym_env.py, and review quadruped.py carefully for accessing robot states and calling functions to solve inverse kinematics, return the leg Jacobian, etc.
- go1_description contains the robot mesh files and urdf.
- load_model.py provide an interface for loading a RL pre-trained model based on stable-baselines3.
- get_demonstrations.py runs a pre-trained model and collects a numpy file containing the trajectory reference performed by the agent during the episode. Such demonstrations are useful for Imitation Learning.
- hopf_network.py provides a CPG class skeleton for various gaits, and maps these to be executed on an instance of the quadruped_gym_env class.
For training take a look at rl-baselines3-zoo in the YAML support section.
- The PyBullet Quickstart Guide is the current up-to-date documentation for interfacing with the simulation.
- The quadruped environment took inspiration from Google's motion-imitation repository based on this paper.
- Reinforcement learning algorithms from stable-baselines3. Also see for example ray[rllib] and spinningup.
The quadruped env was original created by Guillaume Bellegarda, who developed the hopf_network.py.