openai_ros.task_envs.sawyer package


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


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:


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


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


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 )


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.


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


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:


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


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


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