Anki Cozmo Animations Play_Anim_Trigger

We all love Cozmo animations. At Kinvert we encourage all of our STEM students to add a Cozmo animation and custom victory dance at the end of their coding projects. Whenever they accomplish a task like solving a maze, we have them use a Cozmo animation to celebrate. We’ll use cozmo.robot.Robot.play_anim_trigger for this.

Fun Cozmo Animations with play_anim_trigger()

One thing that helps Cozmo shine over other learning platforms is how interactive and engaging he is. We like to keep things interesting for students and Cozmo animations is one of them.

At the end of an exercise we have students make their own custom victory dances. We’ve done this with other robots as well. However Cozmo has a large list of amazing animations. This leaves students much more room to unleash their creativity.

What could be better at the end of a project than to have Cozmo dance or give a high five?

Cozmo does victory dance in kids robotics python education class by Kinvert play_anim_trigger

cozmo.robot.Robot.play_anim_trigger()

To play Cozmo animations we’ll use cozmo.robot.Robot.play_anim_trigger(). Let’s look at this method in more detail.

We’ll start by looking at the parameters.

  • trigger
  • loop_count
  • in_parallel
  • num_retries
  • use_lift_safe
  • ignore_body_track
  • ignore_head_track
  • ignore_lift_track

The main one we will be using is the trigger. However if we want Cozmo to stay still for some reason we can set some of the ignore parameters to True.

You can find more detail at:

http://cozmosdk.anki.com/docs/generated/cozmo.robot.html?#cozmo.robot.Robot.play_anim_trigger

Coding Cozmo Animations – play_anim_trigger Code

Here is the program we wrote for this simple introduction to Cozmo animations.


import cozmo

def kinvert_victory_dance(robot: cozmo.robot.Robot):
    robot.play_anim_trigger(cozmo.anim.Triggers.CodeLabWin).wait_for_completed()    

cozmo.run_program(kinvert_victory_dance)

You can find a list of Cozmo’s animation names online. There are a ton to choose from. We chose the Cozmo animation CodeLabWin for this example / tutorial.

Conclusion – Cozmo Animations with play_anim_trigger()

This is a simple introduction. We normally have students create more unique victory dances to celebrate projects. See how you can make your own custom victory dance and please share it below in the comments!

If you’re interested in getting Cozmo in your school:

We Have Advice on Creating Cozmo Curriculum for K-12 STEM Classes and Camps

Contact Us For Help and Advice

Cozmo Examples, Tutorials, and Projects for STEM Education Curriculum

If you’re interested in taking a Cozmo Camp Click Here or check out our Courses Page. We also use Cozmo in our Robotics Kids Class K-12.

We have a lot more information about the Anki Cozmo SDK Programmable Robot for Kids in Python. This is our main Cozmo hub where you can find more information on Cozmo animations and a whole lot more.

Leave a Reply

Your email address will not be published. Required fields are marked *