Jannie-5 is a kickass and assistant drone driven with a bionic arm and the voice of its owner. It is extremely dangerous when it gets hungry, but very useful when you are fighting kaijus or zombie nazis.
TL;DR: You can go directly to the videos, or read the short version of this project.
Oh, wait, maybe you don’t know what is PIWeek; well PIWeek stands for Personal Innovation Week and consists in a whole week where participants only work in offside projects, with two rules:
- You have to use and develop Open Source
- You have to show something functional by friday (no slides or ideas but actual code working)
Would you like to join us in the VIII PIWeek? Send an email to firstname.lastname@example.org. Well, the main idea for this PIWeek was fiddle with Arduino and the perfect excuse to buy a drone:
We chose the ARdrone because it’s driven with WiFi, and the Yún because it combines the power of Arduino pins with a simple Linux and WiFi access. The final trigger was that we found this amazing python ardrone library so we had the main structure.
We started with a simple scheme:
- Initially, we thought of a robotic arm with sensors, leds, music, and some ligth weapons.
- The information of the sensors would reach the Arduino
- This Arduino connected to a Linux with WiFi
- Using a Python library in a clean and perfect way
- Ocassionally, some gummy bears would rained
The scheme was almost perfect!! It was only a matter of connecting the components…
- The drone
The first thing was, of course, download the official application to control the drone. Simple and intuitive panel and a very fluid flight. It’s really awsome.
Then, we had to be sure about other third party component. This library exposes some actions like takeoff, spin to the right or land and translates them to AT Commands. Besides, the library creates and manages the socket for UDP connection. This is where magic begins: have my action reached the drone? who knows!!
(this blog is also UDP: as my dear readers aren’t used to commenting, I don’t really know if you are here ^_^)
The original library was written by Bastian Ventur. It implements lots of functionalities, more than we needed for this first version, so we took it and removed some parts; the result was lighter and more deterministic (perfect for our mvp).
We connected my computer to the ARDrone WiFi and tried this example to check everything was ok. And it was! We also made the same test from the Linux in the Yún.
We needed a little wrapper for this library, to use from different environments. We found that BottlePy was the perfect solution: it’s a very simple and light wsgi server; it provided an API-like interface and its only dependence is Python.
This script raises a little server which stands in the port 8080. It’s in charge of the communication with the libardrone library and provides a cleaner interface. The script is located in the Linux part of the Yún and starts automatically thanks to an init script.
One key part of this project was managing sensors. And for this task it’s really important to know… well, the sensors:
Our initial robotic arm became a glove with some components sewed. We removed leds and weapons (doh!) and focused in the sensors:
- a pressure sensor to takeoff and land the drone
- a flexometer, to activate and deactivate the navigation mode
- an accelerometer, to control the movements of the drone
We made a simple sketch to read the values of the sensors and calibrate ranges.
Our first attempt using the sensors…
The second was much better!!
Protip: Using Arduino from command line
And we built the glove:
Last piece, but not least was the Arduino sketch and to finish the circuit. We needed to solder some pieces:
In the real world, the circuit was more like that:
And that’s all!! With all these pieces put together, we could make the drone fly!! At demo time..
And we could even make a bis!
Post PIWeek. I have learnt some valuable things:
- fiddling with hardware is so cool! I really love it
- fiddling with hardware sucks because it’s always broken
- Linino (the Linux inside the Yún) is a very limited Linux
- the Lilypad is way better, but I don’t know if there is a “LilyPadYún”, with Linux and WiFi
- the open hardware is an amazing concept and I really hope it developes and evolves, the more the better
- and.. which of you recognize the reference of Jannie-5? ;-)