
sgodbole
USA
Asked
— Edited

I am trying to create an application that will track a green tennis ball but I am having problems with finding the location the ball. Here's the code that I think is incorrect, how can I change it find the location of the ball?
Thank you!
private void timer_Tick(object sender, EventArgs e) { camera = new Camera(ezB_Connect1.EZB); ezB_Connect1.EZB.Movement.MovementType = EZ_B.Movement.MovementTypeEnum.ARDrone; ObjectLocation objectLocation = camera.CameraBasicColorDetection.GetObjectLocationByColor(true, ColorDetection.ColorEnum.Green, 10, 100);
//camera.UpdatePreview();
if (!objectLocation.isFound)
tbLog.Text = "found not object";
if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Left)
ezB_Connect1.EZB.Movement.GoLeft();
else if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Right)
ezB_Connect1.EZB.Movement.GoRight();
else if (objectLocation.horizontalLocation == ObjectLocation.HorizontalLocationEnum.Middle)
ezB_Connect1.EZB.Movement.GoForward();
}
download the EZ-SDK and take a look at the tracking examples.
All detection needs to be done in the OnNewFrame event. For example, take a look at the code for Tutorial 11
Only set the MovementType once. Set it in the Form Load event
Thank your for your reply DJ! I looked at the code to for the movement of various robots. I am still not able to get the AR Drone off the ground. I received following error when I tried to start my camera using the code.
Also, I am not able to use
with AR Drone. My Visual Studio would not find the method. The only method that would work was
and this method would not work when dealing with following colored objects.
What version of the AR Parrot Drone do you have? Our SDK currently only works with v1. I have time allocated in the future this summer to add support for v2... but our priorities currently are getting the product out the door
I am on AR Drone V1.0 and the firmware is 1.7.10
I believe this is not the current firmware. Do I need to upgrade to the latest firmware version for the SDK to work?
Good to hear V2 support is coming. My wife just bought me one for my birthday.
You should be aware that with the latest firmware, the Drone can connect to an infrastructure network and no longer needs to create its own ad-hoc network, so being able to specify the IP address of the drone to the EZ-B controls would be a great addition (as well as the long awaited support for the V2 camera).
Alan
I think I figured out answer to this question. Thanks!