7.7.1. hsr_wrapper.HSR_wrapper

class hsr_wrapper.HSR_wrapper

Bases: object

Convenience wrapper for commonly used HSR robot commands.

__init__()

Methods

__init__()

grasp_succesful()

Check if the gripper has successfully grasped an object.

gripper_grasp_hsr(force)

Close the gripper with the given force to grasp an object.

gripper_open_hsr()

Open the gripper.

move_eef_by_delta(delta[, ref_frame])

Move the end effector by a given distance in the direction of the reference frame axes.

move_eef_by_line(direction, distance)

Moves the end effector by the given distance in the given direction along a line.

reset_impedance_config()

Reset the impedance configuration to the default value.

set_impedance_config(config)

Set the impedance configuration of the robot.

tts_say(text)

Let the robot say the given text.

grasp_succesful()

Check if the gripper has successfully grasped an object.

The check is based on the gripper distance (distance between the two tips). If the grasp failed, the tips are very close to each other. If the grasp is successful, the tips are further apart. The threshold is set to -0.004 meters.

gripper_grasp_hsr(force)

Close the gripper with the given force to grasp an object.

Parameters:

force (float) – The force to apply to the gripper in Newton.

gripper_open_hsr()

Open the gripper.

move_eef_by_delta(delta, ref_frame='base_link')

Move the end effector by a given distance in the direction of the reference frame axes.

Parameters:
  • delta ((x,y,z) tuple) – The distance to move in meters.

  • ref_frame (str) – The reference frame to move in.

move_eef_by_line(direction, distance)

Moves the end effector by the given distance in the given direction along a line.

Parameters:
  • direction ((x,y,z) tuple) – Direction of movement in meters.

  • distance (float) – Distance to move in meters.

reset_impedance_config()

Reset the impedance configuration to the default value.

set_impedance_config(config)

Set the impedance configuration of the robot.

Parameters:

config (string) –

The name of the impedance configuration to set. Possible values are: [‘compliance_hard’,

’compliance_middle’, ‘compliance_soft’, ‘dumper_hard’, ‘dumper_soft’, ‘grasping’, ‘placing’]

tts_say(text)

Let the robot say the given text.

Parameters:

text (str) – The text to say.