Beispiel #1
0
        public async Task <SDKError> TakeOff()
        {
            SDKError result = SDKError.UNKNOWN;

            if (null != DJISDKManager.Instance)
            {
                // start take off
                result = await fcHandler.StartTakeoffAsync();

                // check
                if (result == SDKError.NO_ERROR)
                {
                    var TakeoffAlt = 1.18; // [m]
                    // take off command send
                    bool achieveTakeOffHeight = Drone.Instance.CurrentState.Altitude > TakeoffAlt;
                    while (!achieveTakeOffHeight)
                    {
                        Thread.Sleep(10);
                        achieveTakeOffHeight = Drone.Instance.CurrentState.Altitude > TakeoffAlt;
                        result = await fcHandler.StartTakeoffAsync();
                    }
                    Debug.Print("Take off finish")
                    ;                   Drone.Instance.IsTakeOffFinish = true;
                }
                else
                {
                    // start take off fail
                }
            }
            return(result);
        }
Beispiel #2
0
 public Task <SDKError> flightControllerHandler_StartTakeoffAsync() => flightControllerHandler.StartTakeoffAsync();