feathersdk.robot.gripper.i2rt_gripper Module¶
- class feathersdk.robot.gripper.i2rt_gripper.I2RTGripper(motor: DamiaoMotor, power: BatterySystem = None)¶
Bases:
objectI2RT Gripper interface for high-level gripper control.
This class provides high-level control methods for the gripper, delegating all firmware communication to the DamiaoMotor class.
- __init__(motor: DamiaoMotor, power: BatterySystem = None)¶
Initialize the I2RT Gripper and determine healthy state.
- Parameters:
motor (DamiaoMotor) – DamiaoMotor instance containing motor configuration and firmware interface.
power (BatterySystem, optional) – BatterySystem instance for power state tracking. Defaults to None.
- apply_constant_torque(torque: float, kd: float) FeedbackFrameInfo¶
Apply constant torque to the gripper in the desired direction.
- Parameters:
torque (float) – Target torque in Nm. Positive for closing, negative for opening.
kd (float) – Damping gain for torque control.
- Raises:
Exception – If damping gain or torque values are outside valid ranges.
- apply_torque_and_hold_position(torque: float, kd: float, holding_kp: float, holding_kd: float, verbose: bool = False) FeedbackFrameInfo¶
Apply torque until velocity drops below threshold, then hold position.
Applies constant torque until the gripper reaches a break condition (low velocity for 1 second or velocity < 0.05 with sufficient torque), then switches to position control to hold the current position.
- Parameters:
torque (float) – Torque to apply in Nm. Positive for closing, negative for opening.
kd (float) – Damping gain for torque control phase.
holding_kp (float) – Position gain for holding position after break condition.
holding_kd (float) – Damping gain for holding position after break condition.
verbose (bool) – Enable verbose debug output. Defaults to False.
- Raises:
ValueError – If damping gain or torque values are outside valid ranges.
- clear_error() None¶
Clear motor error state.
- disable() None¶
Disable the gripper motor.
- enable() FeedbackFrameInfo¶
Enable the gripper motor.
- Returns:
Current motor state after enabling.
- Return type:
FeedbackFrameInfo
- get_state() FeedbackFrameInfo¶
Get the current gripper state without enabling the motor.
- Returns:
Current motor state containing position, velocity, torque, and temperatures.
- Return type:
FeedbackFrameInfo
- go_to_position(position: float, kp: float, kd: float) FeedbackFrameInfo¶
Move gripper to a specific position using position control.
- Parameters:
position (float) – Target position in radians.
kp (float) – Position gain.
kd (float) – Damping gain. Must be greater than KD_MIN.
- Raises:
Exception – If gripper is not in a healthy state (needs recalibration).
ValueError – If position is out of valid range or gains are invalid.
- hold_current_position(kp: float, kd: float) FeedbackFrameInfo¶
Hold the gripper at its current position using position control.
- Parameters:
kp (float) – Position gain for position control.
kd (float) – Damping gain for position control.
- Returns:
Current motor state after setting hold command.
- Return type:
FeedbackFrameInfo
- recalibrate() None¶
Recalibrate the gripper by finding full range of motion.
Opens gripper to find minimum position, saves zero position, closes gripper to find maximum position, saves calibration limits, and returns to open position. Sets healthy_state to True upon successful completion.
- Raises:
Exception – If any step of the calibration process fails, including invalid calibration limits or errors during movement.