Designing custom animations with Anki Vector
The makers of Anki Vector (now owned by Digital Dream Labs) put an extraordinary effort in building animations. Animations were what…
The makers of Anki Vector (now owned by Digital Dream Labs) put an extraordinary effort in building animations. Animations were what brought Vector to life. This article describes how designers coded in Vector’s animations using Maya. Vector has 981 inbuilt animations in him. You can find a full list of animations here.
But what if you wanted to build your own animation. Something unique and different from what Vector usually does. Luckily, the Vector SDK allows you to create new custom animations by using the asynchronous mode. You can build any permutations and combinations of the existing 981 animations.
Here a small snippet on how to do it. First create an asynchronous connection to Vector, which allows you to ask Vector to operate many commands in parallel.
with anki_vector.AsyncRobot() as robot:
Now, let us examine the following code.
_ANIMATION1 = ‘anim_dancebeat_getout_01’
_ANIMATION2 = ‘anim_fistbump_requestoncelong_01’
animation1_without_lift = robot.anim.play_animation(_ANIMATION1, ignore_lift_track=False)
animation2 = robot.anim.play_animation(_ANIMATION2) animation1_without_lift.result() animation2.result()
Here we are choosing two animations. The first animation is used by Vector when he is happy to get out of his charger. The second animation is used by Vector when he is requesting for a fist bump. For the first animation, we have disabled the lift, which implies that the default animation plays without the lift ever moved. This is important because we know that the second animation heavily uses the lift , so we don’t want the two animations to interfere. The animations start playing as soon as the two statements are executed by the python interpreter. The result() command tells the program to wait until both animations have executed in parallel.
The resulting animation is one in which Vector is so happy to get out that he requests for a fist bump.
If you want to try the code, it is available for download at my github.
And here is a video showing how the two animations play separately, and then together.
If you want to learn more about Vector, or learn AI with Vector, I am working on a new course at: https://robotics.thinkific.com
I would love an updated guide! Can the changes be permante?