Reacher

Reacher task.

class ivy_gym.Reacher(num_joints=2)[source]

Bases: Env

__init__(num_joints=2)[source]

Initialize Reacher environment

Parameters

num_joints – Number of joints in reacher.

action_space: Space[ActType]
close()[source]

Close environment.

get_observation()[source]

Get observation from environment.

Returns

ret – observation array

get_reward()[source]

Get reward based on current state

Returns

ret – Reward array

get_state()[source]

Get current state in environment.

Returns

ret – angles, angular velocities, and goal xy arrays

metadata: Dict[str, Any] = {'render.modes': ['human', 'rgb_array'], 'video.frames_per_second': 30}
observation_space: Space[ObsType]
render(mode='human')[source]

Renders the environment. The set of supported modes varies per environment. (And some environments do not support rendering at all.) By convention, if mode is:

  • human: render to the current display or terminal and return nothing. Usually for human consumption.

  • rgb_array: Return an numpy.ndarray with shape (x, y, 3), representing RGB values for an x-by-y pixel image, suitable for turning into a video.

  • ansi: Return a string (str) or StringIO.StringIO containing a terminal-style text representation. The text can include newlines and ANSI escape sequences (e.g. for colors).

Parameters

mode – Render mode, one of [human|rgb_array], default human

Returns

ret – Rendered image.

reset()[source]
set_state(state)[source]

Set current state in environment.

Parameters

state – tuple of angles, angular_velocities, and goal xy arrays

Returns

ret – observation array

step(action)[source]
Parameters

action