mycobot_ros/mycobot_pro/mycobot_600_gripper_moveit/scripts/test.py
2024-08-13 10:14:26 +08:00

37 lines
No EOL
639 B
Python
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pymycobot import ElephantRobot
import time
global mc
mc = ElephantRobot("192.168.1.6",5001)
# 启动机器人必要指令
mc.start_client()
time.sleep(1)
# mc.set_gripper_calibrate()
# time.sleep(1)
# mc.set_gripper_mode(0)
# time.sleep(1)
# mc.power_off()#夹爪透传换IO模式时需要先关闭机器再重启机器人一次仅使用夹爪透传模式不必关闭机器人
mc.state_off()
time.sleep(3)
mc.power_on()
time.sleep(3)
mc.state_on()
time.sleep(3)
mc.set_gripper_mode(0)
#透传模式
for i in range(3):
mc.set_gripper_value(10, 20)
time.sleep(1)
mc.set_gripper_value(96, 20)
time.sleep(1)