grippers

Submodules

Classes

class brom_drake.control.grippers.gripper_controller.GripperController(gripper_type: GripperType, Kp: ndarray = None, Kd: ndarray = None)[source]

Description

A simple gripper controller with two modes: position and velocity. Both modes are essentially simple PD controllers.

Diagram

The GripperController LeafSystem can be represented with the following block diagram.

                        -------------------------
                        |                       |
                        |                       |
gripper_target -------> |   GripperController   | ---> applied_gripper_torques
gripper_target_type --> |                       |
                        |                       | ---> measured_gripper_position
                        |                       | ---> measured_gripper_velocity
gripper_state --------> |                       |
                        |                       |
                        |                       |
                        -------------------------

Parameters

gripper_type: GripperType

The type of gripper being controlled.

Kp: np.ndarray, optional

The proportional gain matrix for the PD controller. By default, this is set based on the gripper type.

Kd: np.ndarray, optional

The derivative gain matrix for the PD controller. By default, this is set based on the gripper type.

CalcGripperPosition(context: Context, output: BasicVector)[source]

Description

Callback function for the measured_gripper_position output port. This method computes the gripper position based on the current state input.

Parameters

context: pydrake.systems.framework.Context

The current context of the system.

output: pydrake.systems.framework.BasicVector

The output vector to store the gripper position.

ComputePosition(state: ndarray) ndarray[source]

Description

Compute the gripper position from state data. This is especially useful for the 2F-85 gripper, since the state does not map neatly to the finger positions.

Parameters

state: np.ndarray

The state vector of the gripper.

Returns

finger_position: np.ndarray of shape (2,)

The positions of the gripper fingers.

ComputeVelocity(state: ndarray) ndarray[source]

Description

Compute the gripper velocity from state data. This is especially useful for the 2F-85 gripper, since the state does not map neatly to the finger positions.

Parameters

state: np.ndarray

The state vector of the gripper.

Returns

finger_velocity: np.ndarray of shape (2,)

The velocities of the gripper fingers.

property gripper_width: float

Description

Return the gripper width.

Returns

width: float

The width of the gripper.

initialize_gains(Kp: ndarray, Kd: ndarray)[source]

Description

Initialize the gains for the gripper controller.

Parameters

Kp: np.ndarray

The proportional gain

Kd: np.ndarray

The derivative gain

class brom_drake.control.grippers.gripper_target.GripperTarget(*values)[source]

Functions

(None found)

Variables

brom_drake.control.grippers.gripper_controller.package_dir = '/home/runner/work/brom_drake-py/brom_drake-py/src/brom_drake/control/grippers'

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.