Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Introduction

MetaLocomotion implement canonical gym bullet locomotion environments, but with diversed geometries. The repo is inspired by PyBulletGym. We provide a total of 368 ants and 368 humanoids, which have diverse limb lengths, sampled by multiplying the original limb length by random numbers. Among those configurations, 256 of them are training set, 64 are testing set, the left 64 are extreme examples or out-of-distribution (OOD) testing set, which is exceptionally harder to control.

Currently we support

Meta Ants

Meta Humanoids

Install

pip install metagym[metalocomotion]

For local installation, execute following commands:

git clone https://github.com/PaddlePaddle/MetaGym
cd MetaGym
pip install .[metalocomotion]

Quick Start

Import

Import and create the meta maze environment with

import gym
import metagym.metalocomotion

loco_env = gym.make("meta-humanoids-v0", enable_render=False, max_steps=1000) # Running meta humanoids
#loco_env = gym.make("meta-ants-v0") # Running meta ants

Sampling Geometries

Use the following code to sample an unique geometry

#Sample a task by specifying the configurations
task = loco_env.sample_task(
        task_type = "TRAIN" # we provide 256 geometries for training
        #task_type = "TEST" # we provide 64 geometries for testing
        #task_type = "OOD" # we provide 64 extreme testing cases
        )

Running Locomotion

#Set the task configuration to the meta environment
loco_env.set_task(task)
loco_env.render()
loco_env.reset()

#Start the task
done = False
while not done:
    action = loco_env.action_space.sample() 
    observation, reward, done, info = loco_env.step(action)

Examples of Different Geometries