If robots are going to take over the world, they could at least have the courtesy not to bump into us while they’re at it. That’s not as easy as it sounds, though, especially when a robot is trying to make its way through a bustling space like a mall, hospital, or crowded city street.

Thankfully, researchers have developed an algorithm that could give robots the ability to deftly maneuver through spaces packed with unpredictable humans.

Robots are gradually leaving controlled spaces like labs and factories and edging into more settings in which they will inevitably encounter human beings (see “Are You Ready for a Robot Colleague?”). We navigate hectic spaces by reading other people’s movements and planning our paths accordingly. Robots tend to just barrel ahead, and then stop suddenly when someone gets in the way.

Stanford's JackRabbot robot will explore busy spaces while trying to respect people's boundaries.

“The challenge is how to program these devices to respect human social conventions,” says Silvio Savarese at Stanford University.

Savarese and colleagues developed a computer-vision algorithm that predicts the movement of people in a busy space. They trained a deep-learning neural network using several publicly available data sets containing video of people moving around crowded areas. And they found their software to be better at predicting peoples’ movements than existing approaches for several of those data sets.

Savarese's team is testing its algorithm on a mobile robot called JackRabbot developed at Stanford. The two-wheeled robot, which is equipped with cameras, range sensors, and GPS, will explore busy indoor and outdoor spaces to test the approach in real situations.

At the moment, the most notable example of robots interacting directly with members of the public is Google’s self-driving vehicles. The company has acknowledged that its cars, while predominantly safe, have indirectly contributed to accidents due to a failure to understand the social norms of the road (“Google’s Self-Driving Car Chief Defends Safety Record”). As robots begin to proliferate into settings like shops and offices, awkward run-ins could become more common.

“The first problem is to understand the mostly unstated rules that people follow,” Savarese says. “How do people behave in crowds? How do they share resources, like sidewalks, parking spots? When should a person (or a robot) take its turn?”

A startup called Starship Technologies, which makes robots that deliver packages, is also working on this problem. The company has been testing its robots at several locations in the U.S. and the U.K., and besides dealing with uneven sidewalks and navigating around random obstacles, encounters with pedestrians pose the biggest challenge.

“Our robots have now come into contact with over 230,000 people around the world,” says Henry Harris-Burland, a spokesperson for Starship. Engineers at the company monitor the robots remotely as they go about mock deliveries. “Social acceptance is a core focus at the moment,” he says.

Jodi Forlizzi, at Carnegie Mellon University’s Human Computer Interaction Institute, says the Stanford algorithm adds to other research aimed at making robot behavior more humanlike. “Much research in human-robot interaction has looked at whether we can replicate the norms of human social interaction,” she says.

That goes way beyond just predicting a person’s movement. Forlizzi’s own research has involved trying to get robots to move around spaces in such a way that they form natural-seeming clusters with people. She says there is a definite need to teach robots how to blend in.

“There’s a whole class of robots that will be working with people and close to people also, so we need to understand how they should behave,” Forlizzi says.