pyrep.robots.end_effectors package

Submodules

pyrep.robots.end_effectors.gripper module

class pyrep.robots.end_effectors.gripper.Gripper(count: int, name: str, joint_names: List[str])

Bases: pyrep.robots.robot_component.RobotComponent

Represents all types of end-effectors, e.g. grippers.

actuate(amount: float, velocity: float) → bool

Actuate the gripper, but return after each simulation step.

The functions attempts to open/close the gripper according to ‘amount’, where 1 represents open, and 0 represents close. The user should iteratively call this function until it returns True.

This is a convenience method. If you would like direct control of the gripper, use the RobotComponent methods instead.

For some grippers, this method will need to be overridden.

Parameters:
  • amount – A float between 0 and 1 representing the gripper open state. 1 means open, whilst 0 means closed.
  • velocity – The velocity to apply to the gripper joints.
Raises:

ValueError if ‘amount’ is not between 0 and 1.

Returns:

True if the gripper has reached its open/closed limits, or if the ‘max_force’ has been exerted.

get_grasped_objects() → List[pyrep.objects.object.Object]

Gets the objects that are currently grasped.

Returns:A list of grasped objects.
get_open_amount() → List[float]

Gets the gripper open state. 1 means open, whilst 0 means closed.

Returns:A list of floats between 0 and 1 representing the gripper open state for each joint. 1 means open, whilst 0 means closed.
get_touch_sensor_forces() → List[List[float]]
grasp(obj: pyrep.objects.object.Object) → bool

Grasp object if it is detected.

Note: The does not actuate the gripper, but instead simply attaches the detected object to the gripper to ‘fake’ a grasp.

Parameters:obj – The object to grasp if detected.
Returns:True if the object was detected/grasped.
release() → None

Release any grasped objects.

Note: The does not actuate the gripper, but instead simply detaches any grasped objects.

pyrep.robots.end_effectors.mico_gripper module

class pyrep.robots.end_effectors.mico_gripper.MicoGripper(count: int = 0)

Bases: pyrep.robots.end_effectors.gripper.Gripper

pyrep.robots.end_effectors.panda_gripper module

class pyrep.robots.end_effectors.panda_gripper.PandaGripper(count: int = 0)

Bases: pyrep.robots.end_effectors.gripper.Gripper

Module contents