Use of gripper

Adaptive gripper

1. Set gripper mode

Before using, you need to use the set_gripper_mode interface to set the gripper mode to 0

from pymycobot import Mercury

ml = Mercury('/dev/left_arm')
mr = Mercury('/dev/right_arm')

ml.power_on()
mr.power_on()

ml.set_gripper_mode(0)
mr.set_gripper_mode(0)

2. Gripper control

Angle control

Use the set_gripper_value interface to set the gripper's opening angle

from pymycobot import Mercury
import time

ml = Mercury('/dev/left_arm')
mr = Mercury('/dev/right_arm')

ml.power_on()
mr.power_on()

ml.set_gripper_value(0, 50)
time.sleep(2)
mr.set_gripper_value(100, 50)
time.sleep(2)

IO control

Use set_digital_output interface to realize IO control gripper opening or closing

from pymycobot import Mercury

ml = Mercury('/dev/left_arm')
mr = Mercury('/dev/right_arm')

ml.power_on()
mr.power_on()

ml.set_digital_output(1, 0)
mr.set_digital_output(2, 1)
time.sleep(2)
ml.set_digital_output(1, 1)
mr.set_digital_output(2, 0)
time.sleep(2)

Note: By default, IO control can be used directly. If the gripper mode is set to 0, you need to set the gripper mode to 1 first, that is, set_gripper_mode(1), and then use IO control. If IO control cannot be used after setting it to 1, you need to power on again.

Electric gripper

1. Initialize the gripper

Use the init_electric_gripper interface to initialize the gripper

from pymycobot import Mercury

ml = Mercury('/dev/left_arm')
mr = Mercury('/dev/right_arm')

ml.power_on()
mr.power_on()

ml.init_electric_gripper()
mr.init_electric_gripper()

2. Gripper control

Use the set_electric_gripper interface to control the opening or closing of the gripper

from pymycobot import Mercury
import time

ml = Mercury('/dev/left_arm')
mr = Mercury('/dev/right_arm')

ml.power_on()
mr.power_on()

# Open the gripper
ml.set_electric_gripper(0)
time.sleep(2)
# Close the gripper
ml.set_electric_gripper(1)

myGripper F100 force-controlled gripper

  1. Use the set_pro_gripper_angle interface to control the opening or closing of the gripper.

     from pymycobot import Mercury
     import time
    
     ml = Mercury('/dev/left_arm')
     mr = Mercury('/dev/right_arm')
    
     ml.power_on()
     mr.power_on()
    
     # Open the gripper-left arm
     ml.set_pro_gripper_angle(14, 100)
     time.sleep(2)
     # Close the gripper-left arm
     ml.set_pro_gripper_angle(14, 0)
    
  2. Use the set_pro_gripper_open and set_pro_gripper_close interfaces to control the opening or closing of the gripper.

     from pymycobot import Mercury
     import time
    
     ml = Mercury('/dev/left_arm')
     mr = Mercury('/dev/right_arm')
    
     ml.power_on()
     mr.power_on()
    
     # Open gripper - left arm
     ml.set_pro_gripper_open(14)
     time.sleep(2)
     # Close gripper - left arm
     ml.set_pro_gripper_close(14)
    

myGripper H100 three-finger gripper

Use set_hand_gripper_pinch_action_speed_consort interface to control the pinching action of the gripper.

from pymycobot import Mercury
import time

ml = Mercury('/dev/left_arm')
mr = Mercury('/dev/right_arm')

ml.power_on()
mr.power_on()

# All joints return to zero - left arm
ml.set_hand_gripper_pinch_action_speed_consort(0,5,14)
time.sleep(3)
# Index finger and thumb pinch - left arm
ml.set_hand_gripper_pinch_action_speed_consort(1,5,14)
time.sleep(3)
# Middle finger and thumb pinch - left arm
ml.set_hand_gripper_pinch_action_speed_consort(2,5,14)
time.sleep(3)
# Index finger and middle finger pinch - left arm
ml.set_hand_gripper_pinch_action_speed_consort(3,5,14)
time.sleep(3)
# Three fingers together - left arm
ml.set_hand_gripper_pinch_action_speed_consort(4,5,14)
time.sleep(3)
# All joints return to zero - left arm
ml.set_hand_gripper_pinch_action_speed_consort(0,5,14)
time.sleep(3)

results matching ""

    No results matching ""