puku0x / cvdrone

CV Drone (= OpenCV + AR.Drone)
https://github.com/puku0x/cvdrone/wiki/How-to-build
Other
203 stars 93 forks source link

ardrone.getAltitude() not reading #18

Closed trinhdh closed 9 years ago

trinhdh commented 9 years ago

Thanks for building great library

I got an issue about reading altitude value.

double altitude = ardrone.getAltitude();
printf("ardrone.altitude = %3.2f [m]\n", altitude);

the result after doing this code is : 0.0 only. Even i move the Ardrone around, but nothing change.

Please help me out Thanks

puku0x commented 9 years ago

Hi,

Thank you for your report.

Did the altitude value remain 0.0 even after your AR.Drone took off ?

What about changing the code in "navdata.cpp"

sockCommand.sendf("AT*CONFIG=%d,\"general:navdata_demo\",\"FALSE\"\r", ++seq);

to this ?

sockCommand.sendf("AT*CONFIG=%d,\"general:navdata_demo\",\"TRUE\"\r", ++seq);

I heard some platform caused a memory leak with "general:navdata_demo=FALSE".

Regards, puku0x

trinhdh commented 9 years ago

Hi. I already changed but altitude value still remain 0.0.when ARDrone took off and change the code as you said. Please take a look the photo: image

puku0x commented 9 years ago

Hi.

Did you send the take-off command by using ARDrone::takeoff() ?

I found Vx, Vy and Vz were 0.0 too in the photo. This means your AR.Drone was not flying.

These values, including altitude, change only during the AR.Drone is flying.

Regards, puku0x

trinhdh commented 9 years ago

Hi. You are right. I need to takeoff the Ardrone to get altitude. I though i can lift the ARDrone up by my hand to read those value

Solved the problem

Thanks much for your help

puku0x commented 9 years ago

You're welcome. Good luck !