Phantom 4 RTK连接问题
0
发表于2020-10-27
手机看帖
3
2896
在DJI Pilot之中使用网络RTK能正常获取数据,但在MSDK中配置的时候出现了问题,打印信息如下:
开启网络RTK失败::No logged in account or the login session has expired.
网络RTK状态:DISABLEDRTK状态回调:false
网络RTK状态:ACCOUNT_ERROR
网络RTK状态:Unknown account error,please contact DJI Support.
使用的代码如下:
Aircraft aircraft = (Aircraft) DJISDKManager.getInstance().getProduct();
FlightController flightController = aircraft.getFlightController();
rtk = flightController.getRTK();
rtkNetworkServiceProvider = RTKNetworkServiceProvider.getInstance();
/* 启用RTK模块 */
rtk.setRtkEnabled(true, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if(djiError != null){
Log.d(TAG, "启用RTK失败:" + djiError.getDeion());
}
}
});
/* 设置信号源类型 */
rtk.setReferenceStationSource(ReferenceStationSource.NETWORK_RTK, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if(djiError != null){
Log.d(TAG, "设置信号源类型失败::" + djiError.getDeion());
}
}
});
/* 设置坐标系统 */
rtkNetworkServiceProvider.setNetworkServiceCoordinateSystem(CoordinateSystem.CGCS2000, new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if(djiError != null){
Log.d(TAG, "设置坐标系统失败:" + djiError.getDeion());
}
}
});
/* 启动RTK网络服务 */
rtkNetworkServiceProvider.startNetworkService(new CommonCallbacks.CompletionCallback() {
@Override
public void onResult(DJIError djiError) {
if(djiError != null){
Log.d(TAG, "开启网络RTK失败::" + djiError.getDeion());
}
}
});
/* 监听网络RTK状态 */
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().getDeion());
}
}
});
rtk.setStateCallback(new RTKState.Callback() {
@Override
public void onUpdate(RTKState rtkState) {
Log.d(TAG, "RTK状态回调:" + rtkState.isRTKBeingUsed());
}
});
|
|
|
|