Beispiel #1
0
        public async void EmergencyLanding()
        {
            if (null != DJISDKManager.Instance)
            {
                ResetJoystick();

                var SDKErrorCode = await fcHandler.StartAutoLandingAsync();

                if (SDKErrorCode == SDKError.NO_ERROR)
                {
                    Drone.Instance.IsLanding = true;
                    //Drone.Instance.IsTakingOff = false;
                }
                var isFlyingResult = await fcHandler.GetIsFlyingAsync();

                if (isFlyingResult.value.HasValue)
                {
                    var isFlying = isFlyingResult.value.Value.value;
                    while (isFlying)
                    {
                        await fcHandler.StartAutoLandingAsync();

                        var confirmationNeeded = await fcHandler.GetIsLandingConfirmationNeededAsync();

                        if (confirmationNeeded.value.HasValue)
                        {
                            await fcHandler.ConfirmLandingAsync();
                        }
                        isFlyingResult = await fcHandler.GetIsFlyingAsync();

                        if (isFlyingResult.value.HasValue)
                        {
                            isFlying = isFlyingResult.value.Value.value;
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public Task <SDKError> flightControllerHandler_StartAutoLandingAsync() => flightControllerHandler.StartAutoLandingAsync();