Use of clamping jaws

1 IO control

1.1 set_gripper_zero()

  • Function: Set the gripper zero position (set the current position as zero position).
  • Return value: None

1.2 set_gripper_state(degree,speed):

  • Function: Set gripper switch
  • Parameter description: degree:0~100, 0-all close, 100-all open speed:0~1500 RPM/s
  • Return value: None

1.3 set_gripper_release()

  • Function: Release gripper
  • Return value: None

2 Case

import time
import platform
from pymycobot.ultraArm import ultraArm

# Automatically select the system and connect the mechanical arm
if platform.system() == "Windows":
    ua = ultraArm('COM6', 115200)
    ua.go_zero()
elif platform.system() == "Linux":
    ua = ultraArm('/dev/ttyUSB0', 115200)
    ua.go_zero()

# Position of mechanical arm movement
angles = [
    [-81.71, 0.0, 0.0],
    [-90.53, 21.77, 47.56],
    [-90.53, 0.0, 0.0],
    [-59.01, 21.77, 45.84],
    [-59.01, 0.0, 0.0]
]

ua.set_angles(angles[0], 50)
time.sleep(3)

i = 5
# Cycle for 5 times
while i > 0:
    # Open clamping jaws
    ua.set_gripper_state(100,50)
    time.sleep(2)
    # Close clamping jaws
    ua.set_gripper_state(0,100)
    time.sleep(2)
    i -= 1

results matching ""

    No results matching ""