
ma.manoj
India
Asked
— Edited
Hi,
I tried the colour tracking in the ar drone v2. It works perfectly well. But the problem is, the drone comes racing towards the object as close at it can get. Can you tell me what I can do so that the drone stays a little bit far away from the coloured object always.
Thanks & Regards
Manoj
There are no distance sensors on the drone. There is no way to determine distance with a single camera, either.
The best way is to always use the same object and tell the drone to "stop!" When the detected object is a specific width or height.
You can put that code in the "tracking start" script for the camera control. Find it under the config button.
The code can check the detected object with. It's a variable. Look at the variable tab and determine the max width of your object before stopping the drone.
The software is too good.
How was your script written to measure the object? I know it would use x and y coordinates. Just not sure about the syntax in scripting.
Could you post a quick and short example of a script that could do this, I would like to try this myself, thanks.
if($CameraObjectWidth == 20 && $CameraObjectHeight == 20)
{
Stop()
}
else
{
Forward()
} *confused*
if($CameraObjectWidth > 70)
stop()
endif
endrepeatuntil
i used repeat because I want it to continuously check it.
I am on a vacation. I will upload a video once I am back.
Is that the Height?
Code: