胡椒机器人的自定义动画

时间:2017-06-01 11:08:36

标签: pepper

我有一些动画文件(behavior.xar)我怎样才能将它们上传到胡椒上通过api正常播放?

我将它们复制到/ apps / animations /目录中,当我尝试播放它们时它不起作用

animation_player_service.run("动画/展台/手势/ My_animation")使用此示例http://doc.aldebaran.com/2-5/naoqi/motion/alanimationplayer-tutorial.html

我是否必须以某种方式注册/安装所有这些动画才能使用它们?在这方面你能指导我吗?感谢

2 个答案:

答案 0 :(得分:2)

使用ALBehaviorManager.startBehavior(path_to_animations)来运行您的行为。但对我来说,最好的方法是使用动画安装您的应用程序,而不是使用标准动画"机器人。

请参阅此应用程序(git demo animations)。将其安装在您的机器人上并播放该行为。您可以添加新动画,但在重新安装到机器人之前,您需要选中新动画的框。只需点击choregraphe中的属性即可。你会看到这个:

取消选中

Your new animation, Hey_1 , have his框。所以你需要改变它。 enter image description here

现在,单击确定并保存更改。如果要播放动画,请在机器人上安装并使用ALBehaviorManager.startBehavior(uuid_application/animations/name_animation)进行播放。例如,uuid_application是 demo_animations ,name_application是 Hey_1

答案 1 :(得分:0)

嗨感谢您的回答,我尝试了但是现在我在运行qicli时遇到此错误调用ALBehaviorManager.startBehavior'myanimations / myanimations / Disengage / 15fps / alpha0.5' 错误:ALBehaviorManager :: startBehavior     行为myanimations / myanimations / Disengage / 15fps / alpha0.5无法加载:ALFrameManager :: createBehavior         FMBox :: createPythonModule     _Behavior__myanimationsmyanimationsDisengage15fpsalpha051386748584:/:用户类评估失败并显示错误: ('无效语法',('',1,88,'class _29fa2578a53152cebf36d236019353c9(_29fa2578a53152cebf36d236019353c9Generated):def init (self):_ 29fa2578a53152cebf36d236019353c9Generated。 init (self)传递def onLoad (self):self.oldfps = self.getTimeline()。getFPS()传递def onUnload(self):self.getTimeline()。setFPS(self.oldfps)传递def onInput_onStart(self):newfps =(self.oldfps * self.getParameter(“FPS(%)”))/ 100 self.getTimeline()。setFPS(newfps)pass def onInput_onStop(self):onUnload()pass \ n'))

当我通过choregraphe

运行动画时,它工作正常