The physics of how that Star Wars BB-8 toy works

Wired:

When I was kid, I had Star Wars toys—but they weren’t “smart” and most of them weren’t even battery powered. But kids these days have access to awesome toys like this remote controlled BB-8 (by Sphero) from the Star Wars VII movie. It looks pretty cool.But how does it work?

If you prefer to think it works by magic, don’t read this article. But even after reading, the mechanism is still pretty cool.