【问题标题】:Robot is not responsive during behavior机器人在行为期间没有响应
【发布时间】:2017-08-30 08:15:54
【问题描述】:

我做了一种行为,目的是在平板电脑上显示一些 html 页面。但是当我运行此行为时,我的机器人没有响应,我无法与之对话。我完全不知道为什么会这样。该行为是交互式的,它被添加到默认行为中。

已编辑添加 Choreographe 项目方案

关于启动时显示主 html 页面的问题。 How to make an HTML page to be shown when Pepper boots

【问题讨论】:

  • 你能分享一下 Choregraphe 方案吗? (盒子)
  • 当你说与机器人对话时,我想你想与“自主生活”对话
  • @albert 是的,我也制作了自己的对话框,由基本频道的“run_dialog_dev”运行。
  • 我没用过时间盒。可能是等待框发出sleep() 并在指定时间内冻结程序的执行?
  • @albert 我也尝试过非常简单的 show_html 问题也存在。

标签: python nao-robot pepper choregraphe


【解决方案1】:

有一种开启协作对话的软件方式:ALDialog.runDialog()

所以你可以用下面的代码创建一个盒子:

class MyClass(GeneratedClass):
    def __init__(self):
        GeneratedClass.__init__(self)

    def onLoad(self):
        self.dialog = self.session().service("ALDialog")

    def onUnload(self):
        self.dialog.stopDialog()

    def onInput_onStart(self):
        self.dialog.runDialog()
        #self.onStopped() #activate the output of the box

    def onInput_onStop(self):
        self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
        self.onStopped() #activate the output of the box

【讨论】:

    【解决方案2】:

    您的问题在于,一次只能启动并运行一种交互行为。因此,如果您启动您的行为,则必须停止“run_dialog_dev”,这意味着对话引擎被取消订阅,因此机器人不再监听。

    没有系统提供的方法可以将协作对话用作应用程序的一部分。如果您想使用您创建的对话框主题,您可以使用“Choregraphe 项目方案”中链接到它的对话框来启动对话框并加载主题。

    【讨论】:

    • 有一种启动协作对话的软件方式:ALDialog.runDialog()
    猜你喜欢
    • 2021-05-25
    • 2021-08-18
    • 2020-08-09
    • 2021-11-03
    • 2021-01-06
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 2023-02-10
    相关资源
    最近更新 更多