Gripper
Gripper commands require installing an LMG-90 gripper on the robot flange. This gripper supports force control and position control.
Note
When the robot starts for the first time or is powered on again, the gripper will automatically open and close once to confirm its travel range. Please ensure there are no obstacles around the gripper before starting the robot.
Configure Throw Gripper Error
By default, the gripper continues running after an error. After configuring to throw gripper errors, a Lua error will be thrown.
- Function:
throw_claw_errorfrom the lua module - Parameters:
- throw: [bool] Whether to throw gripper error. Optional, default
true
- throw: [bool] Whether to throw gripper error. Optional, default
- Returns: none
Example
throw_claw_error(true)
Initialize Gripper auto_sync
Initializes the gripper, opening and closing once to confirm its travel range. Requires new version gripper hardware support.
- Function:
init_clawfrom the lua module - Parameters:
- must: [bool] Whether to force initialization. Optional, default
false, initializes only once. If the gripper has already been initialized, it will not be forced to initialize; selecttrueto force the gripper to initialize
- must: [bool] Whether to force initialization. Optional, default
- Returns: [bool] Whether executed successfully
Example
init_claw()
Set Gripper auto_sync
Sets gripper force (force control) and amplitude (position control). If an object is grasped during closing, it will no longer continue closing to avoid crushing the object. The criterion is the force value set here.
- Function:
set_clawfrom the lua module - Parameters:
- force: [float] Force (0-100)
- amplitude: [float] Opening amplitude (0-100)
- Returns: [bool] Whether executed successfully
Example
-- Close gripper to minimum with half force
set_claw(50, 0)
Set Gripper Parameters auto_sync
Sets gripper amplitude or force separately by type.
- Function:
set_claw_aiofrom the lua module - Parameters:
- type: [str] Gripper parameter:
"Amplitude": Opening amplitude (0-100)"Force": Force (0-100)"Weight": Weight
- value: [float] Value to set
- type: [str] Gripper parameter:
- Returns: [bool] Whether executed successfully
Example
-- Set gripper to open to maximum
set_claw_aio("Amplitude", 100)
Get Gripper Parameters
Gets gripper current amplitude or force separately by type.
- Function:
get_claw_aiofrom the lua module - Parameters:
- type: [str] Gripper parameter, same as Set Gripper Parameters
- Returns: [float] Current value of the corresponding type
Example
print(get_claw_aio("Amplitude"))
Wait Gripper Parameters auto_sync
Compares gripper current amplitude or force value until the given condition is met.
- Function:
wait_claw_aiofrom the lua module - Parameters:
- type: [str] Gripper parameter, same as Set Gripper Parameters
- value: [float] Value to compare
- relation: [str] Relational Operator
- Returns: [bool] Whether condition is met
Example
-- Wait until gripper opens to half
wait_claw_aio("Amplitude", 50, ">")
