Current Issue
This Month's Print Issue

Follow Fast Company

We’ll come to you.

5 minute read

Anki's New SDK Makes It Easier For Nonexperts To Write Code For Robots

The SDK for Anki's Cozmo gives everyone access to face and motion detection technology—without requiring a PhD in robotics.

  • 01 /04 | Cozmo Facetracking
  • 02 /04 | Computer Vision
  • 03 /04 | Path Planning
  • 04 /04 | Vision Manipulation

Let me tell you something I bet you probably already know: Writing code for robots is really hard.

While your average tech-savvy hobbyist or undergrad can probably fumble their way through creating something like a basic iPhone app using online tutorials and maybe a little trial and error, when it comes to robotics things get a little more complicated.

Dedicated enthusiasts can do things like get a robot to blink its lights or move forward, but when they start to try and add features like moving around obstacles they get into trouble.

"One of the biggest issues in robotics right now is that there are incredible tools—things like face recognition and object manipulation—but they’re not accessible to people who don’t have a PhD in robotics because they’re very difficult to use," says Hanns Tappeiner, cofounder and president of Anki.

You may know Anki for its product Overdrive, a set of physical race cars and a track that you play with using your smartphone. Now Anki is working on a new robot called "Cozmo" set to debut in October. About the size of a baseball, the tiny robot has artificial intelligence built in that allows it to learn who you are and display human-like emotions while you’re playing with it. It’s essentially the Wall-E we’ve all been dreaming of come to life. In development for the past four years, the company announced Monday that it has plans to make a software developer kit (SDK) available for the robot as well—one that will essentially give anyone some of the same capabilities as one of those PhDs in the field.

Photo: Emily Price

"One of the things that we’re really interested in as a company is just in general trying to figure out how we can advance the field of robotics," says Tappeiner. "Because we had to develop all this stuff over the last four years internally anyways, because it’s necessary for the product. We realized we can open up an SDK to people where they get access to all this functionality with single lines of code, so it’s very, very easy for them to use"

The reason why writing an app is such a comparatively simple process now, explains Tappeiner, is because developers have been working for years and years on the operating systems on which those apps are running.

"That’s why that works, and that doesn’t exist for robotics yet," says Tappeiner. "There have been a huge amount of people, for iOS and Apple, Android and Google, Windows and Microsoft—those operating systems have millions of lines of code in them, so when you as a beginner developer say ‘I want to have a button here" you can really write one line of code and that button is drawn for you, but the 500 lines of code underneath to actually draw every pixel of the button you don’t need to care about because someone else wrote it for you."

The software for Cozmo is currently over a million lines of code, but Anki is making some of its functionality accessible to developers with far fewer lines at their disposal.

"We’re really making it available for people to use with just single lines of code. So you don’t need to care about how face recognition works, you just use it," says Tappeiner. "If you’re a game developer, you might know a lot about game development and if you want to develop a game for Cozmo, you want to spend all your effort on making that game, and not trying to figure out how to recognize faces or something like that."

With the SDK, developers will have access to the robot’s computer vision system and face detection and recognition capabilities, its behavior and animation system, path and motion planners so it can avoid obstacles, and its localization system, which gives developers access to the robot’s internal map as well as all of the objects in it."

Cozmo SDK OCD code

The best part is that all that functionality can be added to a program with just a line or two of code, not thousands. So with just one line the robot can do things like determine how many faces are looking at it, or figure out what's in its path. Those are functions that would typically take around 15,000 lines to make happen.

So what’s Cozmo?

Anki has been working on Cozmo since 2011, when it was developing the first prototype of its Drive product.

Photo: Emily Price

The cars for the product essentially look like your traditional Matchbox car, but each one has a personality of its own, and can be upgraded within the mobile app to open up new character features.

"We realized that character and personality are a really, really big deal," says Tappeiner. "Since there’s so much technology and robotics inside our cars already, we decided the next product should be something that on the outside looks like a robot, has a face, has a head, because it makes it much, much easier for people to make an emotional connection with a real physical thing."

Anki moved through 45 complete revisions of the robot. It can learn your name, remember who your friends are when they come over, avoid obstacles on your floor while it’s moving around, and play games with you in a way that would make you swear it’s almost human.

That human-like quality is something that Anki put a lot of work into. It actually hired animators that previously worked at places like Pixar and DreamWorks to help create Cozmo’s emotions, emotions that are expressed through sound as well as an animated face on the front of the device.

Things like face detection and obstacle avoidance set the robot apart from some other similar robot companions.

"For the robot to really feel intelligent and feel like he can connect with people, he really needs to understand the world around him," Tappeiner says. Turns out, even from a hardware side that gets pretty complicated. While Anki’s cars are made up of 27 parts, Tappeiner says Cozmo has over 300.

With him, you can play a number of games, and now thanks to the SDK, create code to have him do a whole lot more.

"We are really interested in making robotics functionality available to people who might be good developers, but they don’t know anything about robotics necessarily," says Tappeiner.

Related Video: Coding Lessons And Hackathons To Create A New Generation Of More Diverse Tech Company Employees

The Fast Company Innovation Festival