Python 接口文档:
支持windows和linux操作系统
import robotcontrol
import math
def robot_login():
ret=robotcontrol.Auboi5Robot().initialize()
print("Auboi5Robot().initalize() is {0}".format(ret))
# 实例化一个控制类对象
robot=robotcontrol.Auboi5Robot()
# 创建一个句柄
handle=robot.create_context()
# 登录机器人
ip='192.168.2.2'
port=8899
result=robot.connect(ip,port)
if(result==0):
print("login success")
collision=10
tool_dynamics={"position":(0,0,0),"payload":0.0,"interia":(0,0,0,0,0,0)}
ret=robot.robot_startup(collision,tool_dynamics)
print("robot_startup ret is {0}".format(ret))
# 关节运动
joint=(math.radians(0),math.radians(-4.36),math.radians(90),math.radians(-90),math.radians(-8),math.radians(184))
ret=robot.move_joint(joint)
print("robot move_joint ret is {0}".format(ret))
else:
print("login failed")
if __name__ == '__main__':
robot_login()