Creating Autonomous Flying Robots with the CogniFly Project
The CogniFly project is a foray into combining autonomous drones with AI vision, allowing for novel solutions when tackling tough problems.
How It Started
Smart agriculture is vital for making farming more efficient and thus more sustainable. This includes tracking crop yields, water usage, and weather over time, all of which requires ample amounts of data and powerful processing to make it useful. Some data scientists use satellite imaging to gather information, but it can tough in certain locations. The alternative is to use UAVs to get images, which is what the MISTLab postdoctoral researcher Ricardo de Azambuja set out to do in his project called “High Fidelity Data Collection for Precision Agriculture with Drone Swarms”. He originally wanted to use off-the-shelf DJI Tello drones and customize their control software, but since they had to be connected to laptops the entire time and with new Canadian UAV restrictions, a new solution was needed. The next idea was to combine an open source design with AI capabilities and a customized battery holder for an ultra-versatile platform.
The recent explosion in popularity of the FPV (First person view) racing hobby has brought many lightweight, off-the-shelf flight controllers onto the market. A flight controller's role is to tell the electronic speed controller (ESC) how to turn the motors in order to maintain proper balance, usually while using some kind of inertial measurement unit for positional data. More advanced FCs might also come with GPS units for tracking, but they still generally need a human or other flight software to send them commands.
Building an Autonomous Pilot
CogniFly gets around this limitation by making a Raspberry Pi Zero W the pilot. It is positioned on top of the drone and sends commands to the FC via the UART port. The drone has an array of sensors to maintain its position, including a Time-of-Flight sensor for measuring its distance to the ground and a relative odometry (optical flow) sensor to keep itself in one place. Together with onboard WiFi and Bluetooth, the Pi Zero is a powerful enough computer for this task while still being lightweight. AI is also much easier because anything from an AI Vision Kit to a Coral Edge Tensor Processing Unit can be plugged in to assist with the computationally-expensive operations needed when processing and running inferencing on images.
How to Survive a Crash (or 1,000 Crashes)
Naturally, an autonomous flying device will crash many times while the software is being improved and the sensors are being tuned, which requires a frame capable of withstanding impacts. The CogniFly team took inspiration from a surprising place in nature- bees! There are countless videos and gifs of bees running into each other or the ground, yet remaining relatively unscathed. From this lesson in nature, they assembled a frame that uses a combination of hard and soft materials to both absorb shocks and provide enough rigidity to avoid crumpling. As seen from this video, the drone is able to run directly into a wooden corner and come out just fine.
Building Your Own
This project is open source, so it's available to anyone who might be interested in learning more about AI and autonomous flight. Design files can be found here on Github, and the software is located within their repositories here.