robopal.demos.manipulation_tasks.robot_manipulate module

class robopal.demos.manipulation_tasks.robot_manipulate.ManipulateEnv(robot=None, render_mode='human', control_freq=20, enable_camera_viewer=False, controller='CARTIK', is_interpolate=False)[源代码]

基类:RobotEnv

The control frequency of the robot is of f = 20 Hz. This is achieved by applying the same action in 50 subsequent simulator step (with a time step of dt = 0.0005 s) before returning the control to the robot.

action_scale(action)[源代码]

Map to target action space bounds

compute_rewards(achieved_goal: ndarray, desired_goal: ndarray, info: dict = None, **kwargs)[源代码]

Sparse Reward: the returned reward can have two values: -1 if the block hasn’t reached its final target position, and 0 if the block is in the final target position (the block is considered to have reached the goal if the Euclidean distance between both is lower than 0.05 m).

reset(seed=None, options=None)[源代码]

Reset the simulate environment, in order to execute next episode.

reset_object()[源代码]

Set pose of the object.

set_random_init_position()[源代码]

Set the initial position of the end effector to a random position within the workspace.

step(action) tuple[源代码]

Take one step in the environment.

参数:

action -- The action space is 4-dimensional, with the first 3 dimensions corresponding to the desired

position of the block in Cartesian coordinates, and the last dimension corresponding to the desired gripper opening (0 for closed, 1 for open). :return: obs, reward, terminated, truncated, info

robopal.demos.manipulation_tasks.robot_manipulate.goal_distance(goal_a, goal_b)[源代码]