Amol
Amol

Reputation: 11

custom animations on pepper robot

I have some the animation files (behavior.xar) how can i upload them on pepper any play them normally through api?

I copied them into the /apps/animations/ directory and when i try to play them it does not work

animation_player_service.run("animations/Stand/Gestures/My_animation") using this example http://doc.aldebaran.com/2-5/naoqi/motion/alanimationplayer-tutorial.html

Do i have to register/install all these animations somehow in order to use them? Can you please guide me in this regard? thanks

Upvotes: 1

Views: 1123

Answers (2)

Amol
Amol

Reputation: 11

hi thanks for your answer, i tried it but now i get this error when i run qicli call ALBehaviorManager.startBehavior 'myanimations/myanimations/Disengage/15fps/alpha0.5' ERROR: ALBehaviorManager::startBehavior behavior myanimations/myanimations/Disengage/15fps/alpha0.5 failed to load: ALFrameManager::createBehavior FMBox::createPythonModule _Behavior__myanimationsmyanimationsDisengage15fpsalpha051386748584:/: User class evaluation failed with the error: ('invalid syntax', ('', 1, 88, 'class _29fa2578a53152cebf36d236019353c9(_29fa2578a53152cebf36d236019353c9Generated): def init(self): _29fa2578a53152cebf36d236019353c9Generated.init(self) pass def onLoad(self): self.oldfps = self.getTimeline().getFPS() pass def onUnload(self): self.getTimeline().setFPS(self.oldfps) pass def onInput_onStart(self): newfps = (self.oldfps * self.getParameter("FPS (%)")) / 100 self.getTimeline().setFPS(newfps) pass def onInput_onStop(self): onUnload() pass\n'))

It works fine when i run the animation through choregraphe

Upvotes: 0

mcaniot
mcaniot

Reputation: 395

Use ALBehaviorManager.startBehavior(path_to_animations) for run your behavior. But for me, the best way is to install your application with your animations and not to put on the "standard animations" of the robot.

See for example this application (git demo animations). Install it on you robot and play the behavior. You can add a new animation but before to re-install on your robot you need to check the box of your new animation. Just click on properties in choregraphe. You will see this :

Your new animation, Hey_1 , have his box uncheck. So you need to change it. enter image description here

Now, click on ok and save the changes. If you want to play your animation, install on the robot and play it with ALBehaviorManager.startBehavior(uuid_application/animations/name_animation). For example here the uuid_application is demo_animations and the name_application is Hey_1 .

Upvotes: 3

Related Questions