02-05-2020,下午5:16
嘿,伙计们,
我们正在尝试使用python api执行来自机器人程序的特定指令。我们看了看RunInstruction(),但这似乎并不是我们想要的。我们正在遍历指令列表,只是想从文件中执行move命令。下面是搜索程序但不执行的while循环。谢谢
我们正在尝试使用python api执行来自机器人程序的特定指令。我们看了看RunInstruction(),但这似乎并不是我们想要的。我们正在遍历指令列表,只是想从文件中执行move命令。下面是搜索程序但不执行的while循环。谢谢
代码:
遍历程序中的所有指令:
Ins_id = 0
ins_count = prog.InstructionCount()
当ins_id < ins_count:
#检索指令
ins_nom, ins_type, move_type, isjointttarget, pose, joint = prog.Instruction(ins_id)
打印(ins_type)
#ins_type 0 is MoveJ or MoveL, MoveC =1
如果ins_type <= 1:
#选择移动指令作为参考
prog.InstructionSelect (ins_id)
添加一个新的程序调用
#掠夺。RunInstruction (ins_call INSTRUCTION_CALL_PROGRAM)
TeachTar.RunCode ()
虽然TeachTar.Busy ():
暂停(0.01)
#在我们刚刚添加了一条指令的基础上再添加一条指令
Ins_id = Ins_id + 1
Ins_count = Ins_count + 1
Ins_id = Ins_id + 1