Skip to content

SarahChiu/RobotEnv-PyBullet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Robotic Environments in PyBullet

This is a github project containing multiple simulation environments for robotics. These environments can be used to test different reinforcement learning algorithms.
The environments are modified from the examples provided in Bullet Physics SDK (see here for more examples).

Getting Started

Prerequisites

  1. Install OpenAI Gym (see here for the installation and more information)

  2. Install PyBullet (see here for the installation and more information)

Installation

  1. Clone the repository.
git clone https://github.com/SarahChiu/Robotics_Env_in_PyBullet.git
cd Robotics_Env_in_PyBullet/src
  1. Install the package.
pip install -e .
  1. Add the following lines to your bashrc.
export PYTHONPATH=$PYTHONPATH:your_path_to_this_project/src
export URDF_DATA=your_path_to_this_project/src/data

Usage

Here is an example code for running the simulation environment.

import numpy as np
from kuka.kukaContiGraspEnv import KukaContiGraspEnv as grasp

#Set renders to true if you want to show the UI
env = grasp(renders=True)

#To get an initial observation, you can try one of the following functions
ob = env.reset()
ob, _ = env.getGoodInitState()
ob = env.getMidInitState()

#Run an episode and output the episode reward
ep_r = 0.0
while True:
    a = np.random.normal(0.0, 0.02, size=env.action_space.shape[0]) 
    ob, r, t, _ = env.step(a)
    ep_r += r
    if t:
        print('Episode reward: ', ep_r)
        break

Available Environments

Please checkout src for more information.

Acknowledgement

More environments are under development. If you have any problem or suggestion, please feel free to contact me (email, Twitter, LinkedIn).

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Robotic simulation environments written in PyBullet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages