How to get GPS fix type (2D, or 3D fixed) in MSDK?
1176 4 2021-3-22
Uploading and Loding Picture ...(0/1)
o(^-^)o
Trong Luan Tran
lvl.1
Australia
Offline

Hi,

I'm working with DJI Mobile SDK, and I would like to get the current GPS fix type (no fix, 2D or 3D fix) on a Mavic Pro 2. I am able to get the GPS signal level in FlightControllerState.getGpsSignalLevel, is it poissble to interprete the values to GPS fix type? Otherwise, is there a class or method in the DJI mobile SDK which can retrieve the GPS fix type. I went through the DJI Mobile SDK documentation, but I couldn't find one except for RTKState.getPositioningSolution; however, I think this is for RTK drones only, because when I tried to get the Rtk instance from the FlightController, it returns null. Any help would be appreciated. Thank you.
2021-3-22
Use props
Mats Bohlinsson
lvl.4
Flight distance : 1838077 ft
  • >>>
Sweden
Offline

public LocationCoordinate3D getAircraftLocation() {
        double la = (double) KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.AIRCRAFT_LOCATION_LATITUDE));
        double lo = (double) KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.AIRCRAFT_LOCATION_LONGITUDE));
        float altitude = (float) KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.ALTITUDE));
        return new LocationCoordinate3D(la, lo, altitude);
    }
2021-3-22
Use props
Trong Luan Tran
lvl.1
Australia
Offline

Mats Bohlinsson Posted at 3-22 22:35
public LocationCoordinate3D getAircraftLocation() {
        double la = (double) KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.AIRCRAFT_LOCATION_LATITUDE));
        double lo = (double) KeyManager.getInstance().getValue(FlightControllerKey.create(FlightControllerKey.AIRCRAFT_LOCATION_LONGITUDE));

Thanks, Mats

2021-3-30
Use props
fans825b15d9
New

Lithuania
Offline

FlightControllerKey does not have function create - did I upload wrong library or method of obtaining key changed?
2022-8-18
Use props
Mats Bohlinsson
lvl.4
Flight distance : 1838077 ft
  • >>>
Sweden
Offline

fans825b15d9 Posted at 8-18 04:23
FlightControllerKey does not have function create - did I upload wrong library or method of obtaining key changed?

Try:

KeyManager.getInstance().getValue(FlightControllerKey.AIRCRAFT_LOCATION_LATITUDE);

I played arround with dynamic keys, so depending of which sdk you're using that might not work.
2022-8-22
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules