Sawyer Environment

Sawyer is the new robot from Rethink Robotics. Its a simplified version of the Baxter Robot. Here is the official page for more details: SawyerPage

Sawyer Robot

This simulation uses all the SDK systems that the real robot does , so anything you develop for the simulation should work seamlessly with the real robot.

Simulated Sawyer

Robot Environment

openai_ros.robot_envs.sawyer_env module

class openai_ros.robot_envs.sawyer_env.SawyerEnv[source]

Bases: openai_ros.robot_gazebo_env.RobotGazeboEnv

Superclass for all SawyerEnv environments.


Initializes a new SawyerEnv environment.

To check any topic we need to have the simulations running, we need to do two things: 1) Unpause the simulation: without that th stream of data doesnt flow. This is for simulations that are pause for whatever the reason 2) If the simulation was running already for some reason, we need to reset the controlers. This has to do with the fact that some plugins with tf, dont understand the reset of the simulation and need to be reseted to work properly.

The Sensors: The sensors accesible are the ones considered usefull for AI learning.

Sensor Topic List: * /robot/joint_limits: Odometry of the Base of Wamv

Actuators Topic List: * As actuator we will use a class to interface with the movements through commands.


__module__ = 'openai_ros.robot_envs.sawyer_env'

Checks that all the sensors, publishers and other simulation systems are operational.

_compute_reward(observations, done)[source]

Calculates the reward to give based on the observations given.


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


Checks if episode done based on observations given.

_map_actions_to_movement(side='right', joint_delta=0.1)[source]

Applies the given action to the simulation.


Sets the Robot in its init pose


Setup of the movement system. :return:


Set ups the TF listener for getting the transforms you ask for.


It executed the command given through an id. This will move any joint of Sawyer, including the gripper if it has it. :param: action_id: These are the possible action_id values and the action asociated.

self.joints[0]+”_increase”, self.joints[0]+_decrease, self.joints[1]+”_increase”, self.joints[1]+”_decrease”, self.joints[2]+”_increase”, self.joints[2]+”_decrease”, self.joints[3]+”_increase”, self.joints[3]+”_decrease”, self.joints[4]+”_increase”, self.joints[4]+”_decrease”, self.joints[5]+”_increase”, self.joints[5]+”_decrease”, self.joints[6]+”_increase”, self.joints[6]+”_decrease”, gripper_close, gripper_open, gripper_calibrate


Return dictionary dict({str:float}) with all the joints angles


Returns a dictionary dict({str:float}) with all the joints efforts


Returns the Joint Names array of the Limb.

get_tf_start_to_end_frames(start_frame_name, end_frame_name)[source]

Given two frames, it returns the transform from the start_frame_name to the end_frame_name. It will only return something different to None if the TFs of the Two frames are in TF topic published and are connected through the TF tree. :param: start_frame_name: Start Frame of the TF transform

end_frame_name: End Frame of the TF transform
Returns:trans,rot of the transform between the start and end frames.

Get the Joint Limits, in the init fase where we need to unpause the simulation to get them :return: joint_limits: The Joint Limits Dictionary, with names, angles, vel and effort limits.

move_joints_to_angle_blocking(joint_positions_dict, timeout=15.0, threshold=0.008726646)[source]

It moves all the joints to the given position and doesnt exit until it reaches that position

set_j(joint_name, delta)[source]