Cozmo Code Lab makes robot programming easy as dragging blocks

Anki's Cozmo may have looked like a toy by way of Wall-E when it launched last year, but the personality-filled robot has bigger ambitions than mere entertainment. Launching today is Cozmo Code Lab, an incredibly simple way to unlock the many talents of the robot, even if you can't string together a single line of code.

Cozmo was designed from the outset with user-programing in mind. When it comes to robotics, however, that's easier said than done. Traditional configurable robots have a steep learning curve in-between the basics, like moving around and blinking lights, and next-level features such as facial recognition and object avoidance.

Anki's answer was an SDK which condensed the complexity of robotics-specific features into simple API calls. If you understood Python, and had even a rudimentary grasp of code, you could get Cozmo to do things that a traditional programmable robot might demand a PhD in robotics to figure out. It's served the company well, too: as well as the researchers that Anki expected to find favor with, Cozmo has been adopted by a number of universities including Carnegie Mellon for their robotics classes.

All well and good, but it's still contingent on knowing some sort of coding language in the first place. Anki's next play is to open Cozmo up to everyone who hasn't that grounding. "We can wrap the exact same functionality in a more beginner and kid-friendly interface," Hanns Tappeiner, co-founder and president, explained to me.

To do it, Anki looked to Scratch Blocks, an open-source project by the MIT Media Lab. It distills programming into a series of interlinking boxes, each representing a function or feature. By chaining those boxes together, increasingly complex routines can be created.

It's deceptively simple. Cozmo Code Lab is presented as just another activity in the Anki app for smartphones and tablets, and you start out with a blank page and a row of categories running along the bottom. These – organized by "drive", " animation", "actions", "events", and "control" – contain all the building blocks for making Cozmo do everything you'd previously need knowledge of Python to do.

So, by dragging out a movement box I was able to get Cozmo to trundle five units forward; another box turned the robot 90-degrees. There's support for looping, either a set number of times or continuously, in addition to triggers like seeing a face, or a smile or frown, or one of the robot's blocks. Anki has picked 15-20 of Cozmo's reaction animations to include too, though eventually plans to offer all 1,500 or so.

You can have Cozmo navigate autonomously across a tabletop in a hunt for his block, pick up or push those blocks, and more. What might represent 9,000+ lines of code in the underlying software can be summoned with a short sequence in the new Code Lab.

What's important about Cozmo Code Lab is that it's not some pared-back version of the regular SDK. In fact, Anki customized Scratch Blocks so that every function in the SDK could be implemented by Code Lab. At launch, the interface will be a more simplistic subset, dubbed "horizontal grammar". Strings of blocks run from left to right across the screen, with Cozmo following them from start to finish.

Arriving later in the year, though, will be the "vertical grammar" option, and there things will become even more interesting. That will support things like If/Then/Else, variables and function calls, math and logic operations, and even multi-threading, so that Cozmo will be able to run multiple programs simultaneously. It'll open the door to not only knowing when the robot spots a face, for instance, but where in the frame that was, and to what degree it was smiling or frowning.

For the moment, though, there's the horizontal UI and a set of 32 challenges to guide users through the basics. Right now, there's no way to see the underlying code generated by the blocks you've assembled, though Anki is considering opening that up too.

One of the underlying goals for Code Lab, after all, is accepting and embracing the idea that it will evolve in unexpected ways. As Tappeiner told me, what robotics needs is the same influx of non-roboticist players that, in the shape of non-coders, helped make smartphone apps so popular: "you get people with a very different way of thinking from a programmer."

Cozmo Code Lab will begin rolling out as an update to the Cozmo app today.