How does the aircraft measure altitude when using the Virtual Stick?
322 2 2022-4-16
Uploading and Loding Picture ...(0/1)
o(^-^)o
mjgordon
lvl.1

Switzerland
Offline

I'm developing an Android app with a Phantom 4 Pro v2.

At some points I need the aircraft to ascend to a specific height before continuing any other actions. I'm setting this height with the POSITION VerticalControlMode for the Virtual Stick system, however I'm not sure how to check that the aircraft is at the requested height before continuing.

The ultrasonic sensor altitude does not seem to align with this Virtual Stick throttle altitude, as the reported ultrasonic-altitude is sometimes different by 0.5m+ from my requested altitude when the aircraft stops ascending.

Is it based on the GPS altitude somehow? If so, how does it set the local 'zero' altitude, is it based on the altitude when the Virtual Stick is enabled?

Otherwise, is there some other altitude-related callback I'm missing?


Thanks!


2022-4-16
Use props
Mats Bohlinsson
lvl.4
Flight distance : 1838077 ft
  • >>>
Sweden
Offline

It uses the barometer altitude, which drifts a little bit. Always zero from launchpoint.
If you want to use the ultrasonic sensor, you have to do it on your own.
Preferably using the altitude speed mode together with a PID-regulator.
I've done it, works perfectly, however you have to check that the ultrasonic sensor is valid, otherwise you risk skyrock or crash :-)


2022-4-16
Use props
mjgordon
lvl.1

Switzerland
Offline

Mats Bohlinsson Posted at 4-16 12:44
It uses the barometer altitude, which drifts a little bit. Always zero from launchpoint.
If you want to use the ultrasonic sensor, you have to do it on your own.
Preferably using the altitude speed mode together with a PID-regulator.

Makes sense, thanks! Was hoping to avoid altitude speed mode for simplicity but seems to be the best way at this point.   
Also, I'm now seeing the bit I missed in LocationCoordinate3d saying its barometer based. >>   
I'm not too familiar with that technology but I'm surprised its usable in a normally-outdoor device like these, I would have thought weather variability would make it untenable.
2022-4-16
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules