Asked — Edited

Autonomous Parrot Ar 2 Drone Navigation

Hey everybody!

First of all, I am amazed by how good your software works! I've been searching for software to use in a project for my university and ARC is by far the most promising software i've found.

So I have a few questions that i'd hoped you guys could help me with. For a project on my university me and a few fellow students want to use a drone to help people navigate within the school. To do this we are using a Parrot AR 2 drone, together with (hopefully) ARC. We have played with ARC for a bit to try and understand how the software really works. This went well until the point that we have to make the drone fly autonomously, why autonomously you might think? We want the drone to be able to fly to a given location within the school, by itself, without any user interaction whatshowever AND without crashing or being a hazard to people. This is where we run into trouble. We got the drone to perform a script, but for it to fly autonomously we need the drone to recognize 'danger' being people (automatic ascending) and close proximity to walls (automatic centering in hallways). Do you guys think this is possible to do with ARC, and if so, can you give us a push in the right direction?

Besides this; is it possible to combine different functionality of ARC? For example, let the drone perform a script, while using the camera to make sure it doesn't hit anything, give a led signal when the destination has been reached and then fly back to the starting point?

Im very curious what you guys think about this and if somebody is willing to help us out a bit :D

Lets end this post with another (small) question!: After I connect to the drone in ARC, and let it take off using my keyboard and then land again, the drone won't respond to any scripts I send to it, it will only listen to my keyboard and I have to reset the connection for it to execute scripts again, is there a way to fix this, so to make the drone respond to everything I tell it to do?

Sorry for the long post!


Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!


Autonomous indoor navigation with the parrot drone.... Hmmmm as good as ARC is, currently (unless you are a engineer at google) I am going to go out on a limb and say this is not possible... With GPS it is, but GPS is only accurate within 10ft.... so that would not be good enough for indoor navigation.... If you want to navigate indoors, you are going to need a human pilot....


The challenge is using a camera to detect distance - is kind of impossible... at least without knowing how to identify an object to determine how close you are too it.

I have a GPS Flight Recorder for the AR Drone v2 - it weighs about as much as the EZ-B v4 without the plastic shell. You can use the EZ-B v4 without a plastic shell and connect Ultrasonic Sensors to the drone's body.

There is already a control in ARC that allows that:) User-inserted image


@Richard How about the use of some sort of Wi-Fi positioning system, would that be good enough for a parrot drone to determine it's location in your opinion?

@DJ Sures The thought of additional proximity sensors places on the indoor hull crossed my mind before, though I have no clue on how to connect these to the drone for it to be able to use data from them. Also, due to safety, we are required to keep the indoor hull on at all times when flying with the drone, or do you mean to keep the hull on and also place the EZ-B v4 on the drone? Won't that make the drone unstable, especially when it has to fly through hallways that are 2 metres wide? It's a good suggestion, thanks! But, is it safe to say its near impossible to prevent collisions with walls using sensors already in the drone or ARC?


What wifi positioning system? I have never heard of anything like that... Do you have a link? You are probably new to robotics because otherwise you would know this an unbelievably difficult to accomplish task... The equivalent question would be... "can I build a car with a 3d printer?" The answer... is yes it is possible, but what a monumental task it would be....

In order for the drone to navigate indoors, it needs to know where it is in it's surroundings... This is too big, but it might work... Laser range finder Neato floor vacuums use this technology, however they only need to know x and y coordinates... The drone needs to know x, y and z....


@yuckoz the EZ-B v4 without the plastic shell weighs about the same or less than the GPS Flight Recorder. This allows you to mount the EZ-B v4 on the AR Drone. You may also connect Ultrasonic Distance sensors to the AR Drone for distance avoidance. The sensors are connected to the EZ-B v4. The drone on it's own is unable to avoid obstacles or detect distances.


@Richard R I meant something like this, though I'm not sure if it's possible for the drone to work with a system of that kind.

@DJ Sures Thanks for the good idea's. I will discuss it with my teammates, problem is that we don't really have a budget, so it will be tricky. Seems that we will need to have some sort of additional piece of hardware for our plan to be able to succeed, the drone can do much, but not all.


It doesn't say much, but I got the gist of it... It didn't mention accuracy, but for indoor use I imagine you will need accuracy within at least a few inches...

I know EZ Robot (DJ) is rumoured to be working on a camera based indoor navigation system... I don't know any more details than that and I don't know if it will be able to work with flying type robots, but it sounds promising... I guess we'll have to stay tuned... :)


I've been looking at some of the script functions within ARC and my eyes got caught by the label and Goto (label) parts. Is it possible to define labels in a script, and make the drone fly from label to label to get to the destination of the user, where the user can input his destination and the script 'calculates' which route the drone should take?

Ergo: Is it possible for me to have for example, 30 labels, and write a short script to every possible destination?

Example: User wants to go to destination 1: TakeOff(); Sleep (3000); Goto (label 1); <- Starting point Goto (label 3); Goto (label 4); Sleep (5000); <- waiting at the destination for a bit so the user knows Goto (label 3); <- starting journey back to starting point Goto (label 1); <- back at starting point Land();

Some same script to go to destination 2, 3, 4 and so on flying from label to label and then returning by flying from label to label.

I'm asking because we need to start somewhere, and build up from that point. So if we at the very least can get the drone to fly regular patterns, we can step by step improve the quality of the flight by maybe adding sensors or other possible solutions.


Have you done any type of programming at all before?... I absolutely mean no offence but I think you need to back up a little and understand a few things first... The "goto" statement in code allows the programmer to jump from one area of the code to another... Without some detailed coding, it doesn't mean for a physical robot to go from one place to another.... You can use many goto statements as you want, but that would get seriously confusing after a while.... Using multiple scripts would work a lot better than many goto statements... I think you need to start right from the basics before tackling some fancy programming/math to accomplish what you want to do.....

To put this in perspective... I consider myself a decent ARC programmer, however what you want to do is even probably beyond me (unless DJ rolls out his indoor nav system). There are a couple of guys on here that have the programming skills to do this, however... What I am trying to say is you have set quite a challenge for yourself indeed... and I seriously applaud your enthusiasm and determination....

Below is a simple example of how to use the "goto" statement in a script


$x++ #add 1 to x


No offense taken at all, I'm just trying to find a way for me and my team to make this work, even if it just works 'a bit'. I have done some programming before, Java and Python, but I'm not good at it (at all). Thanks for the clarification, I didn't understand that the goto() was used for the code itself. This does enable me to re-use code in a decent-ish way, with the correct use of if/elif statements i reckon. Anyways, I will look into it some more tomorrow and I'll update this thread with any progress, or obstacles :)


If you work on this enough, I have no doubt you will be able to accomplish this... If you haven't already done so, download a copy of ARC and start playing with it.... A large portion of the software can be used without having an actual ezb controller... Also, in the menu there are examples on how to do things... like control usage, scripts etc... Basically that is how I learned how to use ARC.... You can always ask on here if you need help with a particular example or piece of code... :)


I have indeed installed ARC and used various functions to check how they worked with the drone. It works great, but the downside is that because the drone is flying indoors, it causes a lot of air displacement, making it unstable.

I'll keep trying and if i run into things or if I succeed, I'll post back here


So a little update for anybody interested. We have proven to be unable to accomplish anything that has been discussed on this thread tired

To not let our heads get down, we wanted to try to use two functions of ARC to work together to maybe accomplish our task in some way.

We wanted to use the nice color identifying feature in ARC to let the drone follow a stripe of coloured something (paper or something), while following a script invoked by a user.

Is it possible to use EZ script to not let the drone fly for an X amount of seconds, but rather an X amount of metres, while paying attention to the coloured stripe on the floor?

If i need to start a new thread for this let me know, I'm curious to your answers.

Greetings :D


Moving a specific distance vs a specific amount of time is the same issue you are trying to solve earlier in the thread. Based on the sensors built into the AR-Drone, there is no way to accurately determine your position relative to anything except height above ground, so there is no way to know when you have reached a particular distance. Solve one, and you have solved the other.

If instead of just a stripe, you had some other object (glyph, shape, etc) intersecting the stripe, so the camera could see that it has approached or passed the object might be a way to do it. More programming than I want to try to wrap my head around, but would at least be something to give you positional awareness.



@thetechguru You make a valid point, Multiple colours could allow us to make the drone recognize when it's in front of a location. For example a green stripe that it follows in general, and Red one in front of a location, so we can let it decide when the right location has been reached using while and if statements?

Also, is it possible to combine the camerafeed with the EZ-Script functions, I cannot find this in the Script documentation.

As a last question, is it possible to declare your own variables and use these to count (and increase the count) of objects it sees with the camera with EZ-script?


Simple answers since I am on my phone.. Yes and yes.

More later



For scripting, there are two ways to do it.

If you click the "gear" icon and go into the camera setup, you can assign a script when tracking has started ( a tracked object it detected) and a script when tracking has stopped (a tracked object is no longer detected). IN that same dialog, click on the variables tab and you will see all the variables available to your scripts related to the camera. Most are related to tracked objects.

ControlCommand can be used to turn tracking on and off or change the type of tracking you are doing.

Incrementing a variable is easy.

Initialize your variable at the beginning of the script. Every time you want to increment it, add 1 to the variable. To decrement, -1.

Very simplified Example:

$counter = 0

#do some stuff
#code for detecting your object
$counter = @counter + 1



@thetechguru Thank you VERY much for your help, I really appreciate it and you've helped me in the right direction BIG TIME!

I only have one more question relating to the use of the various scripts within the camera config window. The way I now see it, is that it is possible to assign a script or even multiple scripts, to be executed when camera tracking starts. I can also assign scripts which I wrote myself.

The eventual goal is to have a different script for each destination, in which the drone follows some commands to reach a destination, and then fly back. The script the drone will execute depends on user input. Can we make it possible to make the drone execute another script every time depending on some form of input by a user?


Or as Rich would code... :P

$counter = 0

#do some stuff
#code for detecting your object



The eventual goal is to have a different script for each destination, in which the drone follows some commands to reach a destination, and then fly back. The script the drone will execute depends on user input. Can we make it possible to make the drone execute another script every time depending on some form of input by a user?

The camera start and stop tracking scripts can only execute a single script each, but each script can execute other scripts, so you could have camera tracking (or a script which is monitoring the various camera variables) kick off a script which requests user input, and then the response to that user input could drive further scripts.

Or, it could all be one big script with Goto and Return statements, and various IF conditions.



@thetechguru I seem to be unable to let keep the drone hovering over the object, in this case a stripe of green on the floor formed by green paper. It recognizes it, but then starts flying around no matter what, losing the object in the process, while I want it to keep the green stripe in the middle 3 grid-fields (so the middle one on the top row, the middle one on the second row and the middle one on the 3rd row). After this, I want it to follow a movement script while constantely making sure the green stripe is in the gridlines. Any clues on how to make this work?

If it's of any value, I'm using the bottom camera of the drone.