Skip to main content

gym-panda

Build Status Downloads PyPI version

OpenaAI Gym Franka Emika Panda robot grasping environment implemented with PyBullet

Install

Install with pip:

pip install gym-panda

Or, install from source:

git clone https://github.com/mahyaret/gym-panda.git
cd gym-panda
pip install .

Basic Usage

Running an environment:

import gym
import gym_panda
env = gym.make('panda-v0')
env.reset()
for _ in range(100):
    env.render()
    obs, reward, done, info = env.step(
        env.action_space.sample()) # take a random action
env.close()

Running a PD control HACK!

import gym
import gym_panda

env = gym.make('panda-v0')
observation = env.reset()
done = False
error = 0.01
fingers = 1
info = [0.7, 0, 0.1]

k_p = 10
k_d = 1
dt = 1./240. # the default timestep in pybullet is 240 Hz  
t = 0

for i_episode in range(20):
   observation = env.reset()
   fingers = 1
   for t in range(100):
       env.render()
       print(observation)
       dx = info[0]-observation[0]
       dy = info[1]-observation[1]
       target_z = info[2] 
       if abs(dx) < error and abs(dy) < error and abs(dz) < error:
           fingers = 0
       if (observation[3]+observation[4])<error+0.02 and fingers==0:
           target_z = 0.5
       dz = target_z-observation[2]
       pd_x = k_p*dx + k_d*dx/dt
       pd_y = k_p*dy + k_d*dy/dt
       pd_z = k_p*dz + k_d*dz/dt
       action = [pd_x,pd_y,pd_z,fingers]
       observation, reward, done, info = env.step(action)
       if done:
           print("Episode finished after {} timesteps".format(t+1))
           break
env.close()

Development

  • clone the repo:
git clone https://github.com/mahyaret/gym-panda.git
cd gym-panda
  • Create/activate the virtual environment:
pipenv shell --python=python3.6
  • Install development dependencies:
pipenv install --dev

Metadata

Release files for gym-panda 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gym-panda 0.0.6
File Size Uploaded Provenance Actions
gym_panda-0.0.6.tar.gz 4.0 kB Without provenance Details for gym_panda-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gym-panda 0.0.6
File Interpreter ABI Platform Actions
gym_panda-0.0.6-py3-none-any.whl Python 3 none any Details for gym_panda-0.0.6-py3-none-any.whl

Total release size: 9.2 kB

Release files / gym_panda-0.0.6.tar.gz

Download URL gym_panda-0.0.6.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8dcbee398cbed5a751ee50d6faf5f13f56bf1710876b1633464012ebf8b2aba4
BLAKE2b-256 checksum
How to use checksums
2c1ee98d04399d17e745727deb8b588d53199eabd4c4d80739c8f4d7de1919c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

Release files / gym_panda-0.0.6-py3-none-any.whl

Download URL gym_panda-0.0.6-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af6555f3799d274f75a4530d7cb9e2b6416069ba381a9dc95c48fec1940fb67d
BLAKE2b-256 checksum
How to use checksums
0cb5e4c8b45de41e9976b165b55f3052705ee34bbaa4d31f78972f3d7015ee64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.9

Security for gym-panda 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page