Animation


level_1


What is it

An Animation represents a sequence of movements to be performed by Pepper.

How to use it

Creating animation resources

Animation creation relies on 2 kinds of resources:

  • .qianim file, also called Animation Timeline, contains a sequence of gestures performed by Pepper limbs and head, as well as text labels associated with certain times of the animation.
  • .pmt file, also called Animation Trajectory, contains a trajectory performed by Pepper base.

To create:

You can also import an Animation Timeline. For further details, see: Animation Browser / Viewer.

Playing an animation on Pepper

Here is the pattern to build an Animation and play it on Pepper:

val myAnimation: Animation = AnimationBuilder.with(qiContext)
                                    .withResources(R.raw.animationResource)
                                    .build()

val animate: Animate = AnimateBuilder.with(qiContext)
                                .withAnimation(myAnimation)
                                .build()

animate.async().run()
Animation myAnimation = AnimationBuilder.with(qiContext)
                                      .withResources(R.raw.animationResource)
                                      .build();

Animate animate = AnimateBuilder.with(qiContext)
                                .withAnimation(myAnimation)
                                .build();

animate.async().run();

Where: animationResource is the name of the resource file (.qianim or .pmt).

Retrieving labels

level_3

To retrieve the labels of an Animation, use the labels method:

val myAnimation: Animation = ...

val labels: Map<String, List<Long>> = myAnimation.labels()
Animation myAnimation = ...;

Map<String, List<Long>> labels = myAnimation.labels();

Getting started

See also