Skip to content

OpenAI Gym Xarm7 robot environment implemented with PyBullet.

Notifications You must be signed in to change notification settings

jc-bao/gym-xarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gym implementation for Xarm

OpenAI Gym Xarm7 robot environment implemented with PyBullet.

Installation

git clone https://github.com/jc-bao/gym-xarm.git
cd gym-xarm
pip install -e .

Use Cases

Running Example

import gym_xarm
env = gym.make('XarmReach-v0') 
env.reset()
for _ in range(env._max_episode_timesteps):
    env.render()
    obs, reward, done, info = env.step(env.action_space.sample())
env.close()

Test Environment

In the test environment, the robot will take random actions.

python test.py

Training with Stable-Baseline3

python train.py --algo a2c --env XarmPDHandoverDenseEnvNoGoal-v1 

Demo

XarmReach-v0 XarmPickAndPlace-v0 XarmPDPickAndPlace-v0
Large GIF (320x320) Large GIF (320x320) Large GIF (320x320)
XarmPDStackTower-v0 XarmPDRearrange-v0 XarmPDPushWithDoor-v0
Large GIF (700x476) Large GIF (700x476) Large GIF (700x476)
XarmPDOpenBoxAndPlace-v0 XarmPDHandover-v0
Large GIF (700x476) handover_demo
image-20211116142917846

⚠️Note:

  • XarmPickAndPlace-v0 uses Xarm gripper, which can not be constrained in Pybullet. This will result in severe slippage or distortion in gripper shape. Both p.createConstraint() and p.setJointMotorControl2() has been tried, they are helpless in this situation even if we set a extremly large force or friction coefficient.
  • So I recommend to use Panda gripper (the register ID is XarmPDPickAndPlace-v0) which needs less constrains and has a better performance in fetch tasks.

About

OpenAI Gym Xarm7 robot environment implemented with PyBullet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages