Drones can be dangerous. From hacking unprotected devices to falling from the sky, drones can cause a lot of digital and physical damage. As these little flying machines become commonplace in public spaces, researchers have even intentionally crashed them into mannequins and uncooked pork to study just how dangerous they can be. The result isn’t pretty, so pedestrians would be wise to be weary when they see one zipping toward them on a city street.

But a research team at the University of Zurich and the National Centre of Competence in Research Robotics in Switzerland may help put a little more consistency and certainty into how drones will move around us in the future. The researchers have developed a system that allows drones to navigate autonomously around obstacles and through unstructured streets by teaching the drone to act more like cars and bicycles.

“We have developed an algorithm that can safely drive a drone through the streets of a city and react promptly to unforeseen obstacles, such as other vehicles and pedestrians,” Davide Scaramuzza, head of the University of Zurich’s Robotics and Perception Group that developed the system, told Digital Trends.

Scaramuzza and his colleagues have called the training algorithm DroNet, short of Drone Network, a nod to the deep neural network that makes its magic happen. By observing and learning how cars and bicycles react to the dynamic environment of a city street, the DroNet algorithm lets the drones recognize static and moving obstacles, triggering it to slow down and avoid crashes.

“With this algorithm, we have taken a step forward toward integrating autonomous drones into our ‘everyday life,’” Scaramuzza said. “Instead of relying on sophisticated sensors, DroNet only requires a single camera — very much like that of every smartphone — on a drone.”

Most of today’s drones use GPS to navigate, which is great if they’re traveling above buildings but complicated if they are flying at low altitudes in densely populated streets. So, in order to teach the drone to navigate city streets safely, Scaramuzza and his team collected data from cars and bicycles in urban settings, and fed that data into the DroNet algorithm, which used the data to learn street etiquette — like staying in one’s own lane and decelerating when approaching obstacles.

Such a common sense system could become valuable as drones take up tasks like delivery and search and rescue. However, Scaramuzza and his team will first have to refine the algorithm to enable faster and more agile flying.

A paper detailing the study was published this week in the journal IEEE Robotics and Automation Letters.