线程评级:
使用Python API向程序添加模拟事件
# 1
你好,

是否有可能从Python API向程序添加模拟事件?

如。

sorter_tray_manipulation = RDK.Item(' sorter_tray_manipulation ')
sorting_destination_frame = RDK.Item('sorting_destination_frame')
掠夺RDKAddProgram (“New_Program”
掠夺。AddSimualtionEvent (type = EVENT_TYPE_ATTACH, tcp = sorter_tray_manipulate)
掠夺。AddSimualtionEvent (type = EVENT_TYPE_DETACH_ALL attach_frame = sorting_destination_frame)
这是不可能的。相反,我建议您向宏添加一个程序调用,以触发自定义事件。

例如,如果你想在程序中的某个特定点上附加一些东西(比如用你的机器人工具抓取一个对象):

程序= RDK.AddProgram('YourProgram')
...
程序。RunInstruction (YourEvent, INSTRUCTION_CALL_PROGRAM)
...

然后,程序“YourEvent”可以是RoboDK站中的Python宏,它可以做这样的事情:

object.setParentStatic(工具)

这将把对象附加到工具上。关于这个函数的更多信息:
//www.w5838.com/doc/en/PythonAPI/robo...rentStatic




浏览此线程的用户:
1客人(年代)