以下是python demo中的代码:
result = dType.ConnectDobot(api, “”, 115200)
print(“Connect status:”,errorString[result[0]])
if (result[0] == 0):
# Set command timeout
dType.SetCmdTimeout(api, 3000)
dType.SetJOGJointParams(api, 200, 200, 200, 200, 200, 200, 200, 200) dType.SetJOGCoordinateParams(api, 200, 200, 200, 200, 200, 200, 200, 200) dType.SetJOGCommonParams(api, 100, 100)
while 1: dType.SetJOGCmd(api, 1, 1) time.sleep(0.2) dType.SetJOGCmd(api, 1, 0) time.sleep(1) dType.SetJOGCmd(api, 1, 2) time.sleep(0.2) dType.SetJOGCmd(api, 1, 0) time.sleep(1) dll.DisconnectDobot()
以下是Dobot API接口文档:
有点看不懂。
比如,dType.SetJOGCmd(api, 1, 1):
点动方式为关节点动,
点动命令的值为1。
点动命令值如何对应API接口文档中的 “点动命令详细说明”的enum值呀?
想通过python来控制dobot来抓取物品。
可是点动命令的部分,不知道该怎么写。