Skip to content

Commit

Permalink
tello: send Land() command to drone on Halt() to avoid floating mid-air
Browse files Browse the repository at this point in the history
Signed-off-by: Ron Evans <[email protected]>
  • Loading branch information
deadprogram committed Aug 24, 2018
1 parent d306c34 commit a0b92d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platforms/dji/tello/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ func (d *Driver) Start() error {

// Halt stops the driver.
func (d *Driver) Halt() (err error) {
// send a landing command when we disconnect, and give it 500ms to be received before we shutdown
d.Land()
time.Sleep(500 * time.Millisecond)

// TODO: cleanly shutdown the goroutines that are handling the UDP connections before closing
d.cmdConn.Close()
d.videoConn.Close()
return
Expand Down

0 comments on commit a0b92d8

Please sign in to comment.