1 Star 0 Fork 0

焦建军/good_robot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_robotiq_2f_85_gripper.py 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
import time
try:
from gripper.robotiq_2f_gripper_ctrl import RobotiqCGripper
except ImportError:
print('Real robotiq gripper control is not available. '
'Ensure pymodbus is installed:\n'
' pip3 install --user --upgrade pymodbus\n')
RobotiqCGripper = None
def main():
# rospy.init_node("robotiq_2f_gripper_ctrl_test")
gripper = RobotiqCGripper('192.168.1.11')
gripper.wait_for_connection()
# if gripper.is_reset():
gripper.reset()
gripper.activate()
print('Start Sleeping!')
time.sleep(2)
print('Close!')
gripper.close(block=True)
print('Start Sleeping!')
# for i in range(6):
# time.sleep(10)
# gripper.get_cur_status()
time.sleep(60)
print('Open!')
gripper.open(block=True)
# while not rospy.is_shutdown():
# print gripper.open(block=False)
# rospy.sleep(0.11)
# gripper.stop()
# print gripper.close(block=False)
# rospy.sleep(0.1)
# gripper.stop()
if __name__ == '__main__':
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jiaojianjun-com/good_robot.git
git@gitee.com:jiaojianjun-com/good_robot.git
jiaojianjun-com
good_robot
good_robot
master

搜索帮助