Asked — Edited

How To Track Red Color With Ar Drone In Sdk C #


I want to make my own program to track red color with my ar drone, there are two tutorials that could help (tutorial 11 and tutorial 31) , I just want to know the code that the ar drone control panel and the camera device is using in C#

Greetings From Mexico



Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.


Hello :)

Use the Tutorial 31 to determine how to connect and initialize the drone.

You'll need to do set the Movement Panel to be an AR Parrot Drone

_ezb.Movement.MovementType = Movement.MovementTypeEnum.ARDrone;

Then add a timer that will check for the location and set the direction. Good idea to set the timer for 100ms works well. Here's an example of the timer code.

private void timer1_Tick(object sender, EventArgs e) {

  ObjectLocation objectLocation = _camera.CameraBasicColorDetection.GetObjectLocationByColor(ColorDetection.ColorEnum.Red, 10, 100);


  if (!objectLocation.isFound)

  if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Left)
  else if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Right)
  else if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Middle)


Hi DJ,

Can the built in ARC C# script read the $CameraCenterX $CameraCenterY $CameraIsTracking camera data? Or preferably is there a way Ez Script can use the equivalent of 3 ands in an if statement yet?

I've spent about 20 hours now reading everything post and using trial and error to get the camera wireless camera object location to work in the ARC C# scripting language because it can handle weighting algorythms with multiple ands in if statements to make some really smart robots with ping sensors.

if ((LeftDistance>Far) && (CenterDistance>Far) && (RightDistance>Far)){ ezb0.Movement.GoForward(50); System.Threading.Thread.Sleep(50); };

Below is a video of a ARC C# script using 3 ping sensors to autonomously navigate using distance weighting.

Click To Watch Video

BTW I really like the new interface layout.

A yes, no or wait answer could save me lots of time.

Thanks, Bill


In C#/VB Control there is no way currently to read EZ-Script variables, but I can do something about that in the future.

PS, this question does not pertain to the original thread. In the future, please create a new thread. :)


Thanks much DJ.

I'll be more mindful about thread contexts too.