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
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.
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.
-
__init__
()[source]¶ 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.
Args:
-
__module__
= 'openai_ros.robot_envs.sawyer_env'¶
-
_check_all_systems_ready
()[source]¶ 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.
-
_init_env_variables
()[source]¶ Inits variables needed to be initialised each time we reset at the start of an episode.
-
execute_movement
(action_id)[source]¶ 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
-
get_all_limb_joint_efforts
()[source]¶ Returns a dictionary dict({str:float}) with all the joints efforts
-
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 transformReturns: trans,rot of the transform between the start and end frames.
-
init_joint_limits
()[source]¶ 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.
-