openai_ros.task_envs.sawyer package

Submodules

openai_ros.task_envs.sawyer.learn_to_touch_cube module

class openai_ros.task_envs.sawyer.learn_to_touch_cube.SawyerTouchCubeEnv[source]

Bases: openai_ros.robot_envs.sawyer_env.SawyerEnv

__init__()[source]

Make sawyer learn how pick up a cube

__module__ = 'openai_ros.task_envs.sawyer.learn_to_touch_cube'
_compute_reward(observations, done)[source]

We Base the rewards in if its done or not and we base it on if the distance to the block has increased or not. :return:

_get_obs()[source]

Here we define what sensor data defines our robots observations To know which Variables we have access to, we need to read the sawyerEnv API DOCS. :return: observation

_init_env_variables()[source]

Inits variables needed to be initialised each time we reset at the start of an episode. :return:

_is_done(observations)[source]

We consider the episode done if: 1) The sawyer TCP is outside the workspace, with self.translation_tcp_world 2) The Joints exeded a certain effort ( it got stuck somewhere ), self.joints_efforts_array 3) The TCP to block distance is lower than a threshold ( it got to the place )

_set_action(action)[source]

It sets the joints of sawyer based on the action integer given based on the action number given. :param action: The action integer that sets what movement to do next.

_set_init_pose()[source]

Sets the two proppelers speed to 0.0 and waits for the time_sleep to allow the action to be executed

get_distance_from_desired_point(current_position)[source]

Calculates the distance from the current position to the desired point :param start_point: :return:

get_distance_from_point(pstart, p_end)[source]

Given a Vector3 Object, get distance from current position :param p_end: :return:

get_magnitud_tf_tcp_to_block(translation_vector)[source]

Given a Vector3 Object, get the magnitud :param p_end: :return:

get_orientation_euler(quaternion_vector)[source]
is_arm_stuck(joints_efforts_dict)[source]

Checks if the efforts in the arm joints exceed certain theshhold We will only check the joints_0,1,2,3,4,5,6

is_inside_workspace(current_position)[source]

Check if the sawyer is inside the Workspace defined

reached_block(block_to_tcp_vector, minimum_distance, tcp_z_position, tcp_z_position_min)[source]

It return True if the transform TCP to block vector magnitude is smaller than the minimum_distance. tcp_z_position we use it to only consider that it has reached if its above the table.

tcp_z_position_min = None
We supose that its all these: head_pan, right_gripper_l_finger_joint, right_gripper_r_finger_joint, right_j0, right_j1,

right_j2, right_j3, right_j4, right_j5, right_j6

Plus the first three are the block_to_tcp vector

Module contents