Skip to main content

A gym environment for quadruped robots using MuJoCo physics engine.

Project description

Mujoco Gym Environments for quadupedal legged locomotion

Install Instructions

git clone https://github.com/iit-DLSLab/gym-quadruped.git
cd gym-quadruped
pip install -e .   # This will install the package in editable mode

Usage Instructions

from gym_quadruped.quadruped_env import QuadrupedEnv

robot_name = "mini_cheetah"   # "aliengo", "mini_cheetah", "go2", "hyqreal", ...
scene_name = "flat"
robot_feet_geom_names = dict(FL='FL', FR='FR', RL='RL', RR='RR')
robot_leg_joints = dict(FL=['FL_hip_joint', 'FL_thigh_joint', 'FL_calf_joint', ],  # TODO: Make configs per robot.
                        FR=['FR_hip_joint', 'FR_thigh_joint', 'FR_calf_joint', ],
                        RL=['RL_hip_joint', 'RL_thigh_joint', 'RL_calf_joint', ],
                        RR=['RR_hip_joint', 'RR_thigh_joint', 'RR_calf_joint', ])

state_observables_names = tuple(QuadrupedEnv.ALL_OBS)  # return all available state observables

env = QuadrupedEnv(robot='mini_cheetah',
                   hip_height=0.25,
                   legs_joint_names=robot_leg_joints,  # Joint names of the legs DoF
                   feet_geom_name=robot_feet_geom_names,  # Geom/Frame id of feet
                   scene=scene_name,
                   ref_base_lin_vel=0.5, # Constant magnitude of reference base linear velocity [m/s]
                   base_vel_command_type="forward",  # "forward", "random", "forward+rotate", "human"
                   state_obs_names=state_observables_names,  # Desired quantities in the 'state'
                   )
obs = env.reset()

env.render()
for _ in range(10000):
    action = env.action_space.sample() * 50  # Sample random action
    state, reward, is_terminated, is_truncated, info = env.step(action=action)

    if is_terminated:
        pass
        # Do some stuff
    env.render()
env.close()

Package-Name suggestions accepted

The end idea of this package is to be able to have a Mujoco Gym Environment to test model-based and learnign controllers for locomotion in controlled environments with shared metrics (e.g., energy efficiency, robustness, etc.)

The core principles should be:

  • We (will) use robot_descriptions.py to load the robot URDF/SDF files and create the Mujoco model.
  • We programatically generate terrains and obstacles to test the robot in different scenarios.
  • We offer a suit of metrics to evaluate and compare the performance of different controllers with a simple API.
  • THIS IS A LIGHTWEIGHT PACKAGE. all custom stuff should be defined elsewhere.
  • We will publish datasets of expert model-based/learning controlled trajectories using LeRobot (project structure inherited from them) and Huggingface API.

At some point we should generate mujoco jax versions of the environments for simulation and data-collection in GPU.

Death to C++

Att: Giulio Turrisi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gym_quadruped-1.0.2.tar.gz (23.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gym_quadruped-1.0.2-py2.py3-none-any.whl (23.4 MB view details)

Uploaded Python 2Python 3

File details

Details for the file gym_quadruped-1.0.2.tar.gz.

File metadata

  • Download URL: gym_quadruped-1.0.2.tar.gz
  • Upload date:
  • Size: 23.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gym_quadruped-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2cfedbd9fca1fc9664e8bad2b3281d0c2385b2898a032343dfe437e46ce3ff57
MD5 bcde1bdedd4252461e12bce04a9e4b46
BLAKE2b-256 dadf2b793a3d10575c7ac0edccaf1631d18180448b4f811afa3d5466cd9724fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for gym_quadruped-1.0.2.tar.gz:

Publisher: publish2pypi.yaml on iit-DLSLab/gym-quadruped

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gym_quadruped-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: gym_quadruped-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.4 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for gym_quadruped-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a0bc0aa4d6d620466875e43f5079ee5af08d31fa7803b5a64d6c2809c941df39
MD5 3fafd5187779115d84ee8dd7ca22341e
BLAKE2b-256 1ef277c1e8a67af53b1133f9f34dfa32b37d3314c80e9bec97af554280c3125d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gym_quadruped-1.0.2-py2.py3-none-any.whl:

Publisher: publish2pypi.yaml on iit-DLSLab/gym-quadruped

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page