M3E如何设置摇控器位置为返航点
Completed使用的MSDK 5.2,执行航线任务结束时,通过高德地图sdk获取遥控器GPS并且设置为返航点,降落的位置距离遥控器位置有时误差能达到4、5米,有什么办法可以提高这个误差吗?或者msdk是否有接口直接获取到当前摇控器的gps吗?设置摇控器的代码如下
/**
* 设置当前遥控器位置为返航点
*
* @param homeLocation 当前摇控器位置
*/
fun setHomeLocationUsingCurrentRemoteControllerLocation(homeLocation:LocationCoordinate2D) {
KeyManager.getInstance().performAction(KeyTools.createKey(FlightControllerKey.KeyHomeLocationUsingCurrentRemoteControllerLocation),
homeLocation,
object : CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>{
override fun onSuccess(t: EmptyMsg?) {
logger4j.info("设置当前遥控器位置为返航点成功:$t")
}
override fun onFailure(error: IDJIError) {
logger4j.error("设置当前遥控器位置为返航点失败:$error")
}
})
}
-
Hello DJI Developer Support!
We noticed that using FlightControllerKey.KeyHomeLocationUsingCurrentRemoteControllerLocation never works, even if we're connected to the Internet. Also this key is not mentioned in the official SDK API documentation, only in Chapter 15 docs. Is therefore even supported?
Also you mentioned that the M3 RC does not have GPS location, I just tested on RC Plus (M30T) and it does show it's available:
PackageManager packageManager = getApplicationContext().getPackageManager();
Timber.d("Has GPS: " + packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS));Is GPS module available therefore only for RC Plus but not on the RC Pro Enterprise from M3?
-
I just got the following information from the Internet, is this true in the case of DJI RCs?
The following code:
locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && getApplication().getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)
returns True on the DJI RC Plus because the DJI RC Plus does have a GPS receiver. However, as I mentioned earlier, the DJI RC Plus does not have a built-in GPS module. It relies on the GPS signal from the drone to determine its location. This means that the RC Plus will only be able to provide accurate location information when the drone is in flight.
The
locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
method checks to see if the GPS provider is enabled on the device. ThegetApplication().getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)
method checks to see if the device has a GPS receiver. In this case, both methods will return True, even though the DJI RC Plus does not have a built-in GPS module.The reason why the DJI RC Plus can still return True for these methods is because it is able to use the GPS signal from the drone to determine its location. When the drone is in flight, it broadcasts its GPS location to the RC Plus. The RC Plus can then use this information to determine its own location.
This is why the DJI RC Plus can only provide accurate location information when the drone is in flight. When the drone is on the ground, the RC Plus will not be able to receive the drone's GPS signal, and it will not be able to provide accurate location information.
Please sign in to leave a comment.
Comments
6 comments