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
<<<<<<< HEAD
1.2 set_gripper_state(degree,speed):
- Function: Set gripper switch
- Parameter description:
degree
:0~100, 0-all close, 100-all openspeed
:0~1500 RPM/s Return value: None
1.2
set_gripper_state(degree, speed):
功能: 设置夹爪开关
- 参数说明:
degree
:0~100, 0全关,100全开speed
:0~1500 RPM/s - 返回值: 无
1.3 set_gripper_release()
- 功能: 放松夹爪
- 返回值: 无
482c782c42e70f0b2e44445345f6461e795f9189
1.3 set_gripper_release()
- Function: Release gripper
- Return value: None
2 Case
import time
import platform
from pymycobot.ultraArmP340 import ultraArmP340
# Automatically select the system and connect the mechanical arm
if platform.system() == "Windows":
ua = ultraArmP340('COM6', 115200)
ua.go_zero()
elif platform.system() == "Linux":
ua = ultraArmP340('/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:
<<<<<<< HEAD
# Open clamping jaws
ua.set_gripper_state(100,50)
time.sleep(2)
# Close clamping jaws
ua.set_gripper_state(0,100)
=======
# 张开夹爪
ua.set_gripper_state(100,50)
time.sleep(2)
# 闭合夹爪
ua.set_gripper_state(0,50)
>>>>>>> 482c782c42e70f0b2e44445345f6461e795f9189
time.sleep(2)
i -= 1