制作舞蹈应用预定义 Pepper naoqi 2.5

Make choregraphe app predefined Pepper naoqi 2.5

我有一个应用程序来托管一个网页,该网页将成为机器人的菜单,所以我需要它一直执行,除非我的其他应用程序正在使用。 我试过触发条件 = 1:

在Choregraphe中,您可以set your installed behavior as "default"

The Default Behaviors are played automatically at robot startup.

另请注意,触发条件表示应用程序 可以 为 运行,而不是 应该 或 [=16] =]必须.

您可能希望将应用程序开发为 service outside of Choregraphe. General robot-jumpstarter toolkit may be useful for creating a template here. You may look at an example application creating a service and a webpage to display subtitles of what Pepper says at NLPPepperTools

我通过使用解决了它:

  1. Interactive nature with trigger condition as "1": makes the app run under any circumstances. (Solved in this 堆栈溢出线程)
  2. 设置我的appplication's behavior as default:应用程序将在每次启动后启动,重要的是要提到这是唯一的应用程序(由我设计)运行默认[=31] =]
  3. 使用 switch focus instead of runBehavior 调用其他行为:通过切换焦点,下一个行为将 运行 完成后返回菜单。

这是我使用的代码(因为之前需要下载一些软件,所以在这里不起作用):

var session = new QiSession(function(session) {
  console.log("Connection esterblished!");
}, function() {
  console.log("Could not connect to the robot");
});

function open_app(behavior_name) {
  session.service("ALAutonomousLife").then(function(ALAutonomousLife) {
    ALAutonomousLife.switchFocus(behavior_name, 1)
  }).then(
    console.log('Application cannot be switched to')
  )
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Question Page</title>
  <script src="/libs/qimessaging/2/qimessaging.js"></script>
</head>

<body>
  <button class="app-button" onclick="open_app('mynewapp-5d8038/.')">Open app</button>
  <!-- "mynewapp-5d8038/." is the direction to the behavior you want to run, not the app-->
</body>

</html>

希望其他人发现此信息有用。