Shadow TC Environment

This simulation was created by Ugo_Cupcic and ShadowHand. It uses apart from ShadowsHand systems, a UR5 robot arm.

UR5 with Shadow Claw

Robot Environment

openai_ros.robot_envs.shadow_tc_env module

class openai_ros.robot_envs.shadow_tc_env.ShadowTcEnv[source]

Bases: openai_ros.robot_gazebo_env.RobotGazeboEnv

Superclass for all ShadowTcEnv environments.


Initializes a new ShadowTcEnv 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: * /imu/data * /joint_states

Actuators Topic List: * As actuator we will use a class SmartGrasper to interface. We use smart_grasping_sandbox, to move and get the pose of the ball and the tool tip.


__module__ = 'openai_ros.robot_envs.shadow_tc_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.


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.


When called it closes robots hand


Get Ball Pose return: Ball Pose in the World frame We unpause and pause the simulation because this calss is a service call. This means that if the simulation is NOT running it wont get the Ball information of position.


Returns the collision of the three fingers object_collision_name: Here yo ustate the name of the model to check collision with fingers. Objects in sim: cricket_ball__link, drill__link


Returns the pose of the tip of the TCP We unpause and pause the simulation because this calss is a service call. This means that if the simulation is NOT running it wont get the TCP information of position.


Moves the Tool tip TCP to the pose given Its relative pose to world frame :param: desired_pose: Pose where you want the TCP to move next

move_tip(x=0.0, y=0.0, z=0.0, roll=0.0, pitch=0.0, yaw=0.0)[source]

Moves that increment of XYZ RPY in the world frame Only state the increment of the variable you want, the rest will not increment due to the default values


When called it opens robots hand


Restarts the simulation and world objects

send_movement_command(command, duration=0.2)[source]

Send a dictionnary of joint targets to the arm and hand directly. To get the available joints names: rostopic echo /joint_states/name -n1 [H1_F1J1, H1_F1J2, H1_F1J3, H1_F2J1, H1_F2J2, H1_F2J3, H1_F3J1, H1_F3J2, H1_F3J3, elbow_joint, shoulder_lift_joint, shoulder_pan_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint]

  • command – a dictionnary of joint names associated with a target: {“H1_F1J1”: -1.0, “shoulder_pan_joint”: 1.0}
  • duration – the amount of time it will take to get there in seconds. Needs to be bigger than 0.0

It activates or deactivates the finger collisions. It also will triguer the publish into the planning_scene the collisions. We puase and unpause for the smae exact reason as the get TCP and get ball pos. Being a service, untill the simulation is unpaused it wont get response.