Facebook Unleashes Software to Make Programming Robots Easy

Anyone who tells you the robot apocalypse is upon us—that the machines will not stop stealing our jobs, that they are gearing up to chase us through the streets while doing backflips and fighting off stick-wielding humans—has never tried to program a robot. It’s difficult to get a machine to do so much as move an arm, which requires the precise control and coordination of joint angles and torque.

The difficulty of programming robots is a problem that Facebook, of all companies, wants to fix. Today the social network continues its unlikely dive into robotics by open-sourcing a new robot framework, known as PyRobot, that could simplify the way researchers program their machines, and could even make it easier for non-robotics types to jump into the field. If programming robots has so far been something like wading through a command-line interface, PyRobot promises to be like gliding through the sleekness of macOS. At least, that’s the hope: Many others have tried and failed to do this kind of thing.

PyRobot isn’t actually an operating system in and of itself, but a kind of layer above the catchily named Robot Operating System, or ROS, which is omnipresent in robotics research. Simply put, ROS is a platform that allows researchers to control every aspect of a robot, be it sensors or joints. It works across many different kinds of robots doing a wide variety of things. But researchers can still get bogged down in the granular details required to control a robot using ROS.

With PyRobot, a roboticist can write simple code in Python to command a machine, which the platform then translates into the more complex instructions that ROS requires. That is, PyRobot is “abstracting” much of what ROS is doing to control the robot. “If I’m a machine learning researcher, and I only care about going to this X,Y location, I really do not want to be bothered by all the low-level details of how actually the robot ends up getting there,” says Facebook AI researcher Abhinav Gupta. “That’s what we want to abstract away, so that these researchers can focus just on their applications.”

A central challenge of doing research with robots is that they come with a lot of baggage you’re not particularly interested in. Maybe you’re exploring computer vision: how a robot recognizes a particular object. And maybe to get a better look at that object, the robot needs to manipulate it, which happens to be one of the biggest challenges in robotics at the moment. The goal of PyRobot is to simplify as much detail as possible. “The idea is the whole pipeline of doing grasping is only a few lines of code,” says Gupta. “That’s what makes it easier for a computer vision or machine learning researcher.”

Abstraction, though, comes with its downsides. “The idea of abstraction is good, but in practice when the robot breaks you’re stuck trying to fix the abstraction,” says Stefanie Tellex, a roboticist at Brown. “Something goes wrong, the sensors not working anymore or something, and you’ve got to unpack the problem and break down the abstraction.”

PyRobot used to make a LoCoBot position its arm

Beyond abstraction, PyRobot promises to play nice with a range of robots. It’s working with two so far: LoCoBot, a single-armed robot on a mobile base that Gupta helped develop at Carnegie Mellon, and Sawyer, a commercial robot that’s also a single arm, but is stationary and has seven degrees of freedom compared to LoCoBot’s five. The two are fundamentally different beasts to program, but PyRobot can command both with the same code.

“By having this common API that runs across different hardware, what will happen is your code can be downloaded by me for my robot framework,” says Gupta. You’d just have to tell the system you’re working with a LoCoBot instead of a Sawyer, or vice versa. “This is very critical, because there’s a lot of diversity in hardware in robotics currently.”

The real test will come when people start using PyRobot and see how well it manages to work across all that diverse hardware. “I’m a little bit concerned because right now they only have two robots here,” says roboticist Andrew Spielberg of MIT CSAIL. “And I don’t know how generalizable this abstraction is.” But the robotics world would benefit from some better programming tools, assuming the tools’ creators get the details right. Progress in robotics is slow in part because researchers can’t always easily adopt the lessons (or code) of other roboticists—what works on your machine isn’t easily portable to a different kind of robot.

That in turn hinders the rate at which robots gather valuable real-world experience. “This common-sense knowledge is going to come via interacting with the physical world, and I think that’s where we need to scale up,” says Facebook’s Gupta. PyRobot could provide a common framework to supercharge this learning by interaction. Indeed, this is what Facebook is tackling with its robotics program: Helping machines explore their world could improve not only the AI that runs them, but the AI that powers purely digital assistants.

All well and good, but this isn’t the first attempt at the Great Unification of Research Robots. “The problem with it is that there’s been so many people who have tried to do this,” says Tellex. “So many times in robotics. What happens is there’s a little community that uses it and then they go somewhere else.”

Another problem has to do with security. You can’t talk about Facebook without talking about security, but security is also a major component of robotics. ROS comes with no built-in security features, and that’s by design—its makers wanted to leave that to the researchers adopting the platform. Accordingly, last year Tellex was able hack into a research robot and command it from clear across the country. PyRobot doesn’t add any security to ROS, but it’s worth noting that the next version of ROS will come with robust security, its maker says.

“I think security in ROS-land is primarily an issue of awareness,” says Tellex. “People using the toolkits need to be aware of the security implications, and I don’t think ROS 2 is going to be some kind of silver bullet.” The longer-term issue is that as robots continue to move out of the lab and into the real world, they’re going to drag these security issues along with them. Just look at the unfolding crisis of the largely unsecured internet of things.

So can PyRobot become the great unifier of robotics? That remains to be seen, but robots will need something like it if they ever hope to chase us down the street.

More Great WIRED Stories