This is part two of a two part series. Please see the first part if you’re unfamiliar with PyBullet.

We’ll want our environment to be neatly structured so that others can install it with pip and run it quickly as any other OpenAI Gym environment. A complete tutorial on packaging projects can be found in the Python documentation. Install OpenAI Gym through pip.

Basic Structure

The following segment is mostly boilerplate and can be skimmed; it is roughly what is covered here, tailored to out environment — viewing that link is encouraged. Completed code is provided, so you do not need to…

This guide assumes rudimentary knowledge of reinforcement learning and the structure of OpenAI Gym environments, along with proficiency in Python.


Many of the standard environments for evaluating continuous control reinforcement learning algorithms are built on the MuJoCo physics engine, a paid and licensed software. Bullet Physics provides a free and open source alternative to physics simulation with OpenAI Gym offering a set of environments built upon it. PyBullet is a library designed to provide Python bindings to the lower level C-API of Bullet. We will use PyBullet to design our own OpenAI Gym environments.

Post Overview:

This post will be the first…

Gerard Maggiolino

CMU MS in Computer Vision student. UCSD Math-CS Graduate. Former ML / CV intern at NASA JPL, Accel Robotics, and Elementary Robotics.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store