Collisions are one of the biggest issues surrounding the widespread use of drones for civilian commercial applications, especially in anything approaching a built up area. But reliable avoidance of mid-air entanglements or strikes against fixed structures has come a step closer thanks to Andrew Barry.

Barry, a Ph.D student at MIT’s Computer Science and Artificial Intelligence Lab (CSAIL), has developed a detection system that spots obstacles mid-flight, making an autonomously flying drone capable of rapid course correction. Barry and his team can be seen testing the technology in this video, where a fast-moving, fixed-wing drone dips and dives to avoid trees at speeds knocking on 48kph.

“Everyone is building drones these days, but nobody knows how to get them to stop running into things,” Barry told CSAIL’s news site. “Sensors like lidar are too heavy to put on small aircraft, and creating maps of the environment in advance isn’t practical. If we want drones that can fly quickly and navigate in the real world, we need better, faster algorithms.”

The software at the heart of Barry’s innovation runs 20 times faster than existing examples, which means the drone to detect nearby objects and build a full map of its immediate surroundings in real-time. Barry has made the software open source and it is available online. The key idea that has made the development possible came when Barry realised that for high-speed drones not much changes between each frame of imaging at 120 frames per second. This allowed him to design a system that processes just a portion of the information the drone gathers through its cameras, concentrating on objects within 10 metres.

“You don’t have to know about anything that’s closer or further than that,” Barry said. “As you fly, you push that 10-meter horizon forward, and, as long as your first 10 meters are clear, you can build a full map of the world around you.”

If the idea can be developed further if could solve a key part of the puzzle for those who see drones being put to more good uses in the future.