Skip to content

Instantly share code, notes, and snippets.

@bruce-willis
Last active February 15, 2020 13:00
Show Gist options
  • Save bruce-willis/6683da339f7a8140f900024d774bddc8 to your computer and use it in GitHub Desktop.
Save bruce-willis/6683da339f7a8140f900024d774bddc8 to your computer and use it in GitHub Desktop.
Add pybullet env to gum
# before install pybullet with `pip install pybullet`
# source: https://github.com/bulletphysics/bullet3/blob/cbede4eb6c4b9b6d0dddf5b3964a1c7449af05d6/examples/pybullet/gym/pybullet_envs/__init__.py#L188-L191
import gym
from gym.envs.registration import registry, make, spec
def register(id, *args, **kvargs):
if id in registry.env_specs:
return
else:
return gym.envs.registration.register(id, *args, **kvargs)
register(id='HalfCheetahBulletEnv-v0',
entry_point='pybullet_envs.gym_locomotion_envs:HalfCheetahBulletEnv',
max_episode_steps=1000,
reward_threshold=3000.0)
@bruce-willis
Copy link
Author

Or you can install pybullet-gym with pip install git+https://github.com/benelot/pybullet-gym
And after:

import pybulletgym

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment