How can I obtain Absolute Altitude Value (ASL) using DJI MSDK and M300 drone

Viewed 48

I am trying to get the drone absolute 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. M300 Fpv view in dji pilot app

Anyone has accomplish the above or has any ideas to what I should use?

1 Answers

This is from DJI:

This KEY does not currently support the M300. Do you know how to use MSDK V5, which provides the KEY for obtaining real-time altitude: KeyRTKAbsoluteAltitude? MSDK V5:https://developer.dji.com/doc/mobile-sdk-tutorial/cn/

Related