胡椒动画在使用 python SDK 的模拟中不起作用

问题描述

这个问题类似于Naoqi pepper python SDK

但不幸的是,该解决方案不起作用。我没有大写动画,但仍然有同样的问题,已尝试复制确切路径和所有其他解决方案。

动画在模拟中是否不适用于 SDK?由于 COVID,我无法在真正的机器人上进行测试。

animation_player_service = self.session.service("ALAnimationPlayer")
animation_player_service.run("animations/Stand/Gestures/ShowTablet_3")

在 linux 上运行,无法找到如何访问模拟机器人外壳(所有研究都表明这是不可能的?)

谢谢!

解决方法

虚拟机器人没有(预)安装任何应用程序,因此甚至没有animations。当您使用 Choregraphe 时,唯一运行的应用程序是 .lastUploadedChoregrapheBehavior。如果您想使用 ALAnimationPlayer 在虚拟机器人中运行动画,您可以:

  • 使用应用程序中的动画创建新的(额外的)行为。这种行为可以命名为例如anim。它可以包含例如Pepper 的 Happy 框。
  • 参考 PythonScript 中的 anim 行为(在默认行为中):
    def __init__(self):
        GeneratedClass.__init__(self)
        self.anim = ALProxy('ALAnimationPlayer')

    def onInput_onStart(self):
        self.anim.run(".lastUploadedChoregrapheBehavior/anim")
        self.onStopped() #activate the output of the box