While writing my computer science end-of-quarter evaluation late on a Sunday night, I had a bit of a revelation. Inspired by sleep deprivation and delirium, I thought, “Since the PCDuino thing isn’t working, why don’t we just try something totally different?”
I proposed the idea of instead using a normal Arduino board, which wouldn’t have any software compatibility issues since we would be writing all the code on the official Arduino IDE on our own computers. We would either hard wire the board into the drone or connect using WiFi via the WiFi Shield made by Arduino. It would also be able to easily connect to the GPS sensor and retrieve data, since the sensor was built with Arduino in mind. The only difficult part would be finding a software library to communicate with the drone, or to build our own.
After researching the idea further, I found a few Arduino libraries for AR.Drones, but most were outdated and designed around the AR.Drone V1, not the V2 that we have. Then, with a YouTube search, I found our savior, Dirk Herrendoerfer. The German YouTuber has videos showing testing of his system which navigates an AR.Drone V2 to preset GPS waypoints using an Arduino hard wired into the drone and a GPS sensor very similar to ours. In addition, he has uploaded his code to GitHub for anyone to use.
We purchased an Arduino Uno board, and I downloaded the code and began looking through it. Though I still haven’t figured out exactly how it works and how the different files interact, I found the section that handles GPS input and slightly modified it to work with our module (I changed the baud rate that it was reading at and I changed the input pin). I also added a line that printed GPS coordinates over the board’s Serial communications, meaning that it would get sent to the computer for me to read.
I compiled and uploaded the code to the Arduino board with no problems, connected the GPS sensor, and went outside. The computer began showing empty GPS coordinates, which meant that the sensor was working and communicating with the Arduino succesfully, but it hadn’t acquired a satellite lock. Finally, the sensor locked on, and the Serial monitor on my computer began printing out flight commands for the drone. This was because the code talks to the drone over Serial communications, but the computer was reading them since it was connected by USB to the board.
So already, we’re way further than we ever were with the PCDuino, and once we get the hardware needed to connect the Arduino to the drone, we can begin testing Dirk’s flying code. Of course, his code isn’t exactly what we want, so we will likely be using it as a model or template to create our own.
The other important part is the tracking beacon, which will consist of another Arduino with a GPS sensor, and an XBee RF module that will communicate with an identical module on the drone’s Arduino.
It feels a bit wasteful to be completely starting over and buying a whole new set of electronics, but it feels great to finally be making progress once again.