((Aircraft) mProduct).getFlightController().getRTK() 获取为null

Completed

Comments

13 comments

  • DJI Developer Support
    RTK的信息需要打开RTK功能才可以获取,在有GPS的情况下可以使用getAircraftLocation
    0
    Comment actions Permalink
  • zxd

    setRtkEnabled?  这个方法是RTK类的方法,现在问题是RTK实例获取不到,怎么打开RTK功能?

    有GPS是只有GPS的地方吗?

    0
    Comment actions Permalink
  • DJI Developer Support
    RTK功能启动:打开RTK功能,您可以下载MSDK V5的demo看一下里面是如何获取实例并设置的 有GPS是指无人机开启了GPS
    0
    Comment actions Permalink
  • zxd

    我说的是V4 SDK, 我看V4 的demo里面也只是判断了一下是否可用,没有打开RTK的代码,

    if (ModuleVerificationUtil.isRTKAvailable()) {
        rtk = DJISampleApplication.getAircraftInstance().getFlightController().getRTK();
    }
            
    public static boolean isRTKAvailable() {
        return isProductModuleAvailable() && isAircraft() && (null != DJISampleApplication.getAircraftInstance()
                .getFlightController().getRTK());
    }

     

    另外无人机开启GPS也是通过SDK开启吗?

     

    0
    Comment actions Permalink
  • DJI Developer Support
    V4的demo中也是有的: rtk.setRtkEnabled(true, new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { ToastUtils.setResultToToast(djiError == null ? "setRtkEnabled ok" : "setRtkEnabled failed: " + djiError.getDescription()); }});
    0
    Comment actions Permalink
  • zxd

    rtk.setRtkEnabled  这得先有rtk实例去调用吧,我说的 问题是 rtk获取不到,为空,请问您理解意思吗?

    0
    Comment actions Permalink
  • DJI Developer Support
    参考sample中获取实例的方式 private void initRTK() { if (ModuleVerificationUtil.isRTKAvailable()) { rtk = DJISampleApplication.getAircraftInstance().getFlightController().getRTK(); }}
    0
    Comment actions Permalink
  • zxd

    我就是这样做的, 我上面都说了,这个东西获取为null

    0
    Comment actions Permalink
  • DJI Developer Support
    您的飞机是什么型号
    0
    Comment actions Permalink
  • zxd

    MAVIC 2 Pro

    0
    Comment actions Permalink
  • DJI Developer Support
    MAVIC 2 Pro 不支持RTK模式
    0
    Comment actions Permalink
  • zxd

    那还有哪个API可以获取飞机的高度呢

    0
    Comment actions Permalink
  • DJI Developer Support
    你可以通过这个去获取飞机高度:getAircraftLocation
    0
    Comment actions Permalink

Please sign in to leave a comment.