pymycobot library control
Note: Currently only mycobot 320 series and Mercury series can use the following pymycobot library API function to control the gripper. When using, connect the gripper to the end of the robot arm, and the time interval between each gripper instruction call must be greater than 1.5 seconds.
、
set_pro_gripper(gripper_id, address, value)
Function: Set the Pro force control gripper parameters, and you can set a variety of parameter functions. For details, please see the following table.
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.address
(int
): Gripper instruction number.value
: Parameter value corresponding to the instruction number.
Function | gripper_id | address | value |
---|---|---|---|
Set gripper ID | 14 | 3 | 1 ~ 254 |
Set gripper enable status | 14 | 10 | 0 or 1, 0 - off enable; 1 - on enable |
Set gripper clockwise runnable error | 14 | 21 | 0 ~ 16 |
Set the anti-clockwise running error of the gripper | 14 | 23 | 0 ~ 16 |
Set the minimum starting force of the gripper | 14 | 25 | 0 ~ 254 |
IO output setting | 14 | 29 | 0, 1, 16, 17 |
Set IO opening angle | 14 | 30 | 0 ~ 100 |
Set IO closing angle | 14 | 31 | 0 ~ 100 |
Set servo virtual position value | 14 | 41 | 0 ~ 100 |
Set the clamping current | 14 | 43 | 1 ~ 254 |
- Return value:
- Please check the following table:
Function | Return value |
---|---|
Set the gripper ID | 0 - Failure; 1 - Success |
Set the gripper enable status | 0 - Failure; 1 - Success |
Set the clockwise runnable error of the gripper | 0 - Failure; 1 - Success |
Set the counterclockwise runnable error of the gripper | 0 - Failure; 1 - Success |
Set the minimum starting force of the gripper | 0 - Failure; 1 - Success |
IO output setting | 0 - Failure; 1 - Success |
Set IO opening angle | 0 - Failure; 1 - Success |
Set IO closing angle | 0 - Failure; 1 - Success |
Set the servo virtual position value | 0 - Failure; 1 - Success |
Set the clamping current | 0 - Failure; 1 - Success |
get_pro_gripper(gripper_id, address)
- Function: Get the parameters of the Pro force-controlled gripper, which can get a variety of parameter functions. Please refer to the following table for details.
- Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.address
(int
): The command number of the gripper.
Function | gripper_id | address |
---|---|---|
Read firmware major version number | 14 | 1 |
Read firmware minor version number | 14 | 2 |
Read gripper ID | 14 | 3 |
Read gripper clockwise runnable error | 14 | 22 |
Read the anti-clockwise running error of the gripper | 14 | 24 |
Read the minimum starting force of the gripper | 14 | 26 |
Read the IO opening angle | 14 | 34 |
Read the IO closing angle | 14 | 35 |
Get the amount of data in the current queue | 14 | 40 |
Read the servo virtual position value | 14 | 42 |
Read the clamping current | 14 | 44 |
- Return value:
- Check the following table (if the return value is -1, it means that no data can be read):
Function | Return value |
---|---|
Read the firmware major version number | Major version number |
Read the firmware minor version number | Minor version number |
Read the gripper ID | 1 ~ 254 |
Read the gripper clockwise runnable error | 0 ~ 254 |
Read the gripper counterclockwise runnable error | 0 ~ 254 |
Read the minimum starting force of the gripper | 0 ~ 254 |
Read the IO opening angle | 0 ~ 100 |
Read the IO closing angle | 0 ~ 100 |
Get the amount of data in the current queue | Return the amount of data in the current absolute control queue |
Read the servo virtual position value | 0 ~ 100 |
Read the clamping current | 1 ~ 254 |
set_pro_gripper_angle(gripper_id, gripper_angle)
- Function: Set the force-controlled gripper angle.
- Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.gripper_angle
(int
): Gripper angle, value range 0 ~ 100.
- Return value:
- 0 - Failed
- 1 - Successful
get_pro_gripper_angle(gripper_id)
- Function: Read the force-controlled gripper angle.
- Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
- Return value:
int
0 ~ 100
set_pro_gripper_open(gripper_id)
Function: Open the force-controlled gripper.
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
Return value:
0 - Failed
1 - Successful
set_pro_gripper_close(gripper_id)
Function: Close the force-controlled gripper.
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
- Return value:
- 0 - Failure
- 1 - Success
set_pro_gripper_calibration(gripper_id)
Function: Set the zero position of the force-controlled gripper. (The zero position needs to be set first when using it for the first time)
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
Return value:
- 0 - Failure
- 1 - Success
get_pro_gripper_status(gripper_id)
Function: Read the gripping status of the force-controlled gripper.
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
Return value:
0
- Moving.1
- Stopped moving, no object was detected.2
- Stop motion, detect that the object is clamped.3
- After detecting that the object is clamped, the object falls.
set_pro_gripper_torque(gripper_id, torque_value)
- Function: Set the torque of the force-controlled gripper.
- Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.torque_value
(int
): Torque value, value range 1 ~ 100.
- Return value:
- 0 - Failed
- 1 - Successful
get_pro_gripper_torque(gripper_id)
- Function: Read the torque of the force-controlled gripper.
- Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
- Return value: (
int
) 100 ~ 300
set_pro_gripper_speed(gripper_id, speed)
Function: Set the force-controlled gripper speed.
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.speed
(int): Gripper movement speed, value range 1 ~ 100.
Return value:
0 - Failed
1 - Successful
get_pro_gripper_default_speed(gripper_id, speed)
Function: Read the default speed of the force-controlled gripper.
Parameter:
gripper_id
(int
): Gripper ID, default 14, value range 1 ~ 254.
- Return value: Default movement speed of the gripper, range 1 ~ 100.
set_pro_gripper_abs_angle(gripper_id, gripper_angle)
Function: Set the absolute angle of the force-controlled gripper.
Parameter:
gripper_id
(int
): Gripper ID, default 14, range 1 ~ 254.gripper_angle
(int
): Gripper angle, range 0 ~ 100.
Return value:
0 - Failed
1 - Successful
set_pro_gripper_pause(gripper_id)
Function: Pause movement.
Parameter:
gripper_id
(int
) Gripper ID, default 14, range 1 ~ 254.
- Return value:
- 0 - Failure
- 1 - Success
set_pro_gripper_resume(gripper_id)
- Function: Resume motion.
- Parameter:
gripper_id
(int
) Gripper ID, default 14, value range 1 ~ 254.
- Return value:
- 0 - Failure
- 1 - Success
set_pro_gripper_stop(gripper_id)
- Function: Stop motion.
- Parameter:
gripper_id
(int
) Gripper ID, default 14, value range 1 ~ 254.
- Return value:
- 0 - Failure
- 1 - Success