MrDroneCoder
lvl.2
Flight distance : 42799 ft
Israel
Offline
|
Hi,
I am trying to get the drone absoulte altitude value (ASL) in real time (before taking off)
I have 2 drones, Mavic 2 enterprise advanced & M300.
When using the below code in mavic2 i was able to obtain the ASL, however the same code returns NULL value when using with M300:
Object heightAboveSeaLevel = KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.ABSOLUTE_GPS_ALTITUDE));
Also tried with no luck the below:
DJIKey GPSKey = FlightControllerKey.create(FlightControllerKey.ABSOLUTE_GPS_ALTITUDE);
DJISDKManager.getInstance().getKeyManager().getValue(GPSKey, new GetCallback() {
@Override public void onSuccess(@NonNull Object value) {
}
@Override public void onFailure(@NonNull DJIError error) {
}
});
On a side note:
When using the M300, the ASL value is shown in the DJI Pilot app.
Anyone has accomplish the above or has any ideas to what should i use?
Thank you all.
Ron
|
|