dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
994 stars 580 forks source link

M210RTKV2在MSDK启动RTK问题 #816

Open SSZ1 opened 3 years ago

SSZ1 commented 3 years ago

在MSDK GSDemo里的Waypoint1.0中添加了一个按钮,对应写了一个启动RTK获取初始地面点homepoint高程的函数,飞机M210RTKV2上也开了网络RTK服务(千寻服务已激活),但是在MSDK的APP上面还是报错,只显示了“启用 RTK 模块成功”,“设置信号源为: NETWORK_RTK”,后面设置坐标系以及启动网络服务都没有任何显示,再然后APP就崩了,APP重启,回到初始界面。麻烦帮忙看下有什么问题,启动RTK函数如下:

private void RTKStart(){ Aircraft aircraft = (Aircraft) DJISDKManager.getInstance().getProduct(); if(aircraft != null){ FlightController rFlightController = aircraft.getFlightController(); mRTK = rFlightController.getRTK(); RTKNetworkServiceProvider rtkNetworkServiceProvider; rtkNetworkServiceProvider = DJISDKManager.getInstance().getRTKNetworkServiceProvider().getInstance(); boolean rtkSupported = rFlightController.isRTKSupported(); if(rtkSupported){ //启动RTK Objects.requireNonNull(mRTK).setRtkEnabled(true,new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { if(djiError == null){ setResultToToast("启用 RTK 模块成功"); } else{ setResultToToast("启用 RTK 模块失败:" + djiError); } } }); } //设置信号源 Objects.requireNonNull(rFlightController.getRTK()).setReferenceStationSource(ReferenceStationSource .NETWORK_RTK, new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { if(djiError == null){ setResultToToast("设置信号源为: NETWORK_RTK"); }else{ setResultToToast("设置RTK信号源错误:" + djiError); } } }); //设置坐标系统 rtkNetworkServiceProvider.setNetworkServiceCoordinateSystem(CoordinateSystem.WGS84, new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { if(djiError == null){ Log.d(TAG, "设置坐标系统成功"); }else{ Log.d(TAG, "设置坐标系统失败:" + djiError); } } }); //启动网络服务 rtkNetworkServiceProvider.startNetworkService(new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { if(djiError == null){ Log.d(TAG, "开启网络RTK成功"); }else{ Log.d(TAG, "开启网络RTK失败" + djiError); } } }); //监听网络状态 rtkNetworkServiceProvider.addNetworkServiceStateCallback(new NetworkServiceState.Callback() { @Override public void onNetworkServiceStateUpdate(NetworkServiceState networkServiceState) { Log.d(TAG, "网络RTK状态:" + networkServiceState.getChannelState().name()); if(networkServiceState.getError() != null){ Log.d(TAG, "网络RTK状态:" + networkServiceState.getError()); } } }); //判断RTK状态 mRTK.setStateCallback(new RTKState.Callback() { @Override public void onUpdate(RTKState rtkState) { Log.d(TAG, "RTK状态回调:" + rtkState.isRTKBeingUsed()); altitude_rtk = rtkState.getMobileStationAltitude(); if(altitude_rtk != 0.0){ Log.d(TAG, "获取地面点海拔高度成功"); }else{ Log.d(TAG, "获取地面点海拔高度失败"); } } }); } }

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #45256:

尊敬的用户,

您好!感谢您联系DJI 大疆创新。 代码和流程初步上看没有问题,但是M210 RTK V2不支持网络RTK(NETWORK_RTK),仅支持第三方RTK。 崩溃问题检查下有没有添加networkrtk helper库。

非常感谢您的理解与配合,祝您生活愉快!

Best Regards,

DJI 大疆创新SDK技术支持
inline1229818240.png

SSZ1 commented 3 years ago

谢谢!但是我在M210RTKV2的遥控器上使用DJI Pilot APP激活了千寻服务,并且在DJI Pilot APP中是能够使用的(接收网络RTK信号),这种不就是网络RTK服务吗?就是在用以上代码编写自己的APP时候出现了这种问题,以及networkrtk helper库具体该如何添加,求解答。

------------------ Original ------------------ From: "dji-sdk/Mobile-SDK-Android" @.>; Date: Mon, Mar 22, 2021 03:07 PM @.>; @.**@.>; Subject: Re: [dji-sdk/Mobile-SDK-Android] M210RTKV2在MSDK启动RTK问题 (#816)

Agent comment from Luce Luo in Zendesk ticket #45256:

尊敬的用户,

您好!感谢您联系DJI 大疆创新。 代码和流程初步上看没有问题,但是M210 RTK V2不支持网络RTK(NETWORK_RTK),仅支持第三方RTK。 崩溃问题检查下有没有添加networkrtk helper库。 ​

非常感谢您的理解与配合,祝您生活愉快!

Best Regards,

DJI 大疆创新SDK技术支持 inline1229818240.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.