Gym: Range of observation and action space in Robots

Created on 26 May 2018  路  3Comments  路  Source: openai/gym

What is the range of the action space, observation space, desired goal space, achieved goal space?
How can I get it.
For example, in openai/baselines implemention of DDPG, You tell the range of space. But what's the range in Robots enviroment like FetchReach?

class DDPG(object):
def __init__(self, actor, critic, memory, observation_shape, action_shape, param_noise=None, action_noise=None,
gamma=0.99, tau=0.001, normalize_returns=False, enable_popart=False, normalize_observations=True,
batch_size=128, observation_range=(-5., 5.), action_range=(-1., 1.), return_range=(-np.inf, np.inf),
adaptive_param_noise=True, adaptive_param_noise_policy_threshold=.1,
critic_l2_reg=0., actor_lr=1e-4, critic_lr=1e-3, clip_norm=None, reward_scale=1.):

Most helpful comment

Depends on the task:

  • For Fetch, the first 3 dimensions of the action space are an offset in Cartesian space from the current end effector position and the 4th dimension is the state of the parallel gripper in joint space
  • For the Shadow hand, all 20 dimensions are the desired joint positions, rescaled such that -1 is the lower limit and 1 is the upper limit

See https://github.com/openai/gym/blob/master/gym/envs/robotics/fetch_env.py#L70 and https://github.com/openai/gym/blob/master/gym/envs/robotics/hand_env.py#L22 for details, respectively.

All 3 comments

There are no guarantees for the observation spaces but the actions are always in [-1, 1]. The action space definition should have that set correctly: https://github.com/openai/gym/blob/master/gym/envs/robotics/robot_env.py#L39. You can use env.action_space.low and env.action_space.high to get these ranges. The same works for observations but they will return -np.inf and np.inf, respectively (https://github.com/openai/gym/blob/master/gym/envs/robotics/robot_env.py#L40)

@matthiasplappert May I ask how I should interpret this action? Is it the change in velocity or joint angles, or is it the desired velocity or joint angles?

Depends on the task:

  • For Fetch, the first 3 dimensions of the action space are an offset in Cartesian space from the current end effector position and the 4th dimension is the state of the parallel gripper in joint space
  • For the Shadow hand, all 20 dimensions are the desired joint positions, rescaled such that -1 is the lower limit and 1 is the upper limit

See https://github.com/openai/gym/blob/master/gym/envs/robotics/fetch_env.py#L70 and https://github.com/openai/gym/blob/master/gym/envs/robotics/hand_env.py#L22 for details, respectively.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lbbc1117 picture lbbc1117  路  3Comments

RuofanKong picture RuofanKong  路  4Comments

Gawne picture Gawne  路  4Comments

julian-ramos picture julian-ramos  路  4Comments

david8373 picture david8373  路  4Comments