Welcome to the first proper blog post about my Final Year Project (FYP)!
Since my first post on here (‘I have a blog.’) I’ve been looking into the legalities and applications of drones currently in the big wide world (pretty dry stuff). What I’ve really wanted to do instead is get the laptop out and start writing code. Up to this point however, I haven’t had the luxury of a ‘clean room’; a windless, relatively uncluttered, large, indoor space.
Today, I am glad to announce, I was finally able to sit down and work on programming my Parrot AR 2.0 drone (Dave, or dUAVe as he is known) in a spacious, indoor environment on campus at Brunel.
The goal of the day was to write a simple program on my laptop that would tell the drone what to do. The logic being that if I can get that element to work, I can write a whole PC-based program to communicate with the drone.
After a steady start I was able to follow along with an amazing tutorial I found on the Instructables website. This tutorial goes over connecting the drone to your laptop and sending basic commands to it through node.js, as well as how to program a basic set of instructions for your drone to play out at the click of a button.
After 3 hours of fiddling with the code and witnessing dUAVe survive two fairly serious encounters with the wall, the end result can be seen on my YouTube channel. In the video you can see me hit enter on the keyboard and let the drone carry out the basic set of instructions sent to it.
Tips on the guide I used (Instructables):
- Firstly, it is very well written but if like me you have the attention span of a gnat, you’ll miss out on the handy bits of info at the end of each step so make sure to read each step all the way through before starting!
- In step 5 you are recommended to use Sublime as a text editor. This isnota good text editor. It is a one way ticket to launching your laptop through the window/drone. Try Notepad++ instead!
- When trying to run your automated program for the first time in step 6, make sure you haven’t stored jsin the folder titled nodejs. I did this, it will not work. Instead make sure to create a separate folder for it (called Drone or similar), in the same directory as the nodejs folder and ensure that you run ‘npm install ar-drone’ in the command line while in the new Drone folder you’ve created. By this I mean re-do step 3 in the Instructables guide for the Drone folder. Google the use of ‘cd’ to navigate through directories in command line if you’re unsure of how to get around in there.
- As ever, pay attention to any errors thrown back to you within the command prompt when running your program to find any rogue semicolons/brackets!
To help out, the code used in the video is in the image below (Click to enlarge).
So there we are, a solid achievement for the first day of programming. Now to figure out how to get dUAVe to use his camera while we’re flying…
Please let me know if you have any questions or comments about this post or any other, I’ll do my best to answer any questions and all feedback is welcome!
Note: In the above examples I am using a Windows 7 laptop so I will have very limited knowledge of Linux/OSX instances of this project!
Originally osted on September 26, 2015 Categories: Brunel FYP, Drone Programming