parrot ar drone bull

Drive a parrot AR drone around through a webapp with a video feed, targetting and lunging towards red things. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.They might not be delivering our mail (or our burritos) yet, but drones are now simple, small, and affordable enough that they can be considered a toy. even customize and program some of them via handy dandy Application Programming Interfaces (APIs)! The Parrot AR Drone has an API that lets you control not only the drone's movement but also stream video and images from its camera. In this post, I'll show you how you can use Python and node.js to build a drone that moves all by itself. So given that I'm not a drone, or a machine vision professional, I'm going to have to keep things simple. For this project, I'm going to teach my drone how to follow I know, I know, it's a far cry from a T-800 Model 101 (or even something like this), but

given my time and budget constraints it's a good place to start! In the meantime, feel free to send your best autonomous terminators or drone swarms my way. When I opened my drone on Christmas morning I wasn't entirely sure what I was going to do with it, but one thing was for certain: This thing was cool. The AR Drone 2.0 (I know super lame name) is a quadcopter. If you're imagining those fit in the palm of your hand, single-rotor, RC gizmos, you're in the wrong ballpark.
eve online sentry drone shipsThe first thing I noticed (and was most surprised by)
parrot ar drone deutschland was how big the AR Drone is.
parrot ar drone parts hong kongWith its "indoor shell" on, it's about 2 feet wide, 2 feet long,
parrot ar drone 2 bearings

and 6 inches high. It's also kind of loud--in a good way (like a terrify your dog kind of way, unlike this down to drone pup). Combine that with 2 cameras--one front and one bottom, and you've got yourself the ultimate grown up geek toy. What sets the AR Drone apart is that it's old (in drone years)--it was first released in 2012. might seem like a bad thing BUT since we're trying to program this gizmo, it's actually Given that it's had 4 years to "mature", there are some really great APIs, helper
parrot ar drone rescue libraries, and project/code samples for controlling/programming the drone (see list of resources below).
parrot ar drone tips tricksSo in essence, someone else has already done the hard part of figuring out how to communicate with the drone in bytecode, so all I have to do is import the node_module and I'm off to the figurative drone races.

Programming the drone is actually quite easy. I'm using the ar-drone node.js module. found that it works really well despite not being under super active development. To start, let me show you how to do a pre-programmed flightplan. The following program is going to: Pretty simple little program. Now even though it's pretty straightforward, I will still highly recommend having an emergency landing script readily available. you never know you need one till you really need one ;) You can also pull off some fancier moves--you know, to impress your friends. favorite is a backflip. Ok now for the second piece of the puzzle: teaching our drone how to see. To do this, we're going to be using OpenCV and the Python module cv2. be a little prickly to work with, but it can do some really impressive stuff and even has some machine learning libraries baked right into it. We're going to be using OpenCV to do some basic object tracking. We're going to have the

in its field of vision. Sort of like a bull at a bullfight. Good news for us is that cv2 makes this really easy to do. As you can see above, I'm using a color mask to filter the pixels in an image. a simple but intuitive approach. And more importantly it works. Processed with red filterOk well maybe not quite like a T-800 Model 101, but it's at least a start. Ok here comes the tricky part. We've got our little node.js script that can control the drone's navigation, and we've got the python bit that can detect where red things are in an image, but the question looms: How do we glue them together? Well my friends, to do this I'm going to use Yhat's own model deployment software, ScienceOps. I'm going to deploy my Python code onto ScienceOps, where it'll be accessible via an API, and then from node.js I can call my model on ScienceOps. What this means is that I've boiled my OpenCV red-filtering model into a really simple HTTP endpoint.

I'm using ScienceOps to make my childhood drone bull fighting dreams come true, but you could use it to embed any R or Python model into any application capable of making API requests, be it drone or otherwise. I don't need to mess around with any cross-platform baloney, and if I need to up the horsepower of my model (say for instance if I'm controlling more than one drone), I can let ScienceOps scale out my model automatically. If you want more info about deploying models (or drones) into production using ScienceOps, head over to our site or schedule a demo to see it live. What does all this mean? Well for one, it means my node.js code just got a lot simpler. use the Yhat node.js library to execute my model:Now I can pretty much just drop this into my navigation script. All I need to do is tell my script how I want to react to the response. In this case it's going to be a couple steps:What could possibly go wrong? As the adage goes, If at first you don't succeed try, try again.

It took me a few iterations to get the autonomous piece to actually work. Turns out, combining individual components has the propensity to compound your error! But not to worry! My drone took its fair share of bumps and bruises but it's a tough little guy--Pro Tip: You can patch up your drone with duct tape. Just be sure to apply equal amounts to each side of the drone so it's balanced! A couple of things I learned the hard way: In the end with some persistence and a little luck, I was able to get a couple of good autonomous runs in! I wound up presenting this at PAPIs Valencia which was a lot of fun (BTW PAPIs is awesome! I highly recommend it for anyone interestedUnfortunately my PAPIs demo didn't go quite as smoothly. in the lecture hall was different than in our office and as a result, the red didn't quite get filtered the same way. Despite the less than stellar performance, it was still a lot of fun! Want to learn more about programming your own drone?