SMerrony / tello

The tello Go (golang) package is an unofficial, easy-to-use, standalone API for the Ryze Tello® drone.
MIT License
80 stars 21 forks source link

Land command appears to be ignored #12

Closed a34729t closed 5 years ago

a34729t commented 5 years ago

I tried running telloterm and using your library and ran into the same issue- if I send a takeoff command and then a land command even a few seconds later, the land command is ignored. In the basic example you provide, takeoff, wait 10s and land works, but as soon as I try less time- say 1s or 3s- the land command is ignored.

I'm going to implement the basic UDP comms and see if I can replicate this.

Here's the exact code I'm using:

package main

import (
    "fmt"
    "log"

    "github.com/SMerrony/tello"
)

func basicTakeOffAndLandingDemo() {
    fmt.Println("Demo: Connect, takeoff, hover, land")
    fmt.Println("Connecting to drone...")

    drone := new(tello.Tello)
    err := drone.ControlConnectDefault()
    if err != nil {
        log.Fatalf("%v", err)
    }

    drone.TakeOff()
    time.Sleep(3 * time.Second) // 1 second doesn't work
    drone.Land()
    drone.ControlDisconnect()

    fmt.Println("Disconnected from drone...")
}

func main() {
    basicTakeOffAndLandingDemo()
}
SMerrony commented 5 years ago

I don't think this is an issue with my tello package - the Tello is simply not accepting the land command until it has finished doing other things.