wangcongrobot / gym-ur5_gripper

11 stars 4 forks source link
gym-environment mujoco-environments reinforcement-learning robotiq-gripper stable-baselines ur5-env

gym-ur5_gripper

This is a gym environment, using ur5 robot and robotiq 3 finger gripper, in mujoco simulator.

The robot xml file is from http://www.mujoco.org/forum/index.php?resources/universal-robots-ur5-robotiq-s-model-3-finger-gripper.22/

This package includes:

Overview


install


$ git clone https://github.com/wangcongrobot/gym-ur5_gripper.git
$ cd gym-ur5_gripper
$ virtualenv env --python=python3
$ pip install -e .
$ python gym-ur5_gripper/tests/test_ur5_gripper_env.py

Robot Environments

UR5 Env

Task Environments

UR5 Reach Env

Observation space

Reward function

In this environment, the reward function is given by:

Here is the code used to compute the reward function:

Gripper

The Robotiq 3 finger gripper has 11 dof, the control mode includes torque control, position control and so on.

We use position control, and change the 11-dof joint control into a 1-dof open/close action.


def gripper_format_action(self, action):
    """ Given (-1,1) abstract control as np-array return the (-1,1) control signals
    for underlying actuators as 1-d np array
    Args:
        action: 1 => open, -1 => closed
    """
    movement = np.array([0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1])
    return -1 * movement * action

P.S.: 1 => open, 0 => close, (0,1) => grasp