Skip to content

Commit

Permalink
Merge pull request hybridgroup#539 from cbwang2016/patch-2
Browse files Browse the repository at this point in the history
Add "Throw & Go" support to Tello
  • Loading branch information
deadprogram authored May 18, 2018
2 parents 8db4d60 + 18bec89 commit d7d776a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions platforms/dji/tello/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const (
takeoffCommand = 0x0054 // 84
landCommand = 0x0055 // 85
flipCommand = 0x005c // 92
throwtakeoffCommand = 0x005d // 93
palmLandCommand = 0x005e // 94
bounceCommand = 0x1053 // 4179
)
Expand Down Expand Up @@ -290,6 +291,17 @@ func (d *Driver) TakeOff() (err error) {
return
}

// Throw & Go support
func (d *Driver) ThrowTakeOff() (err error) {
buf, _ := d.createPacket(throwtakeoffCommand, 0x48, 0)
d.seq++
binary.Write(buf, binary.LittleEndian, d.seq)
binary.Write(buf, binary.LittleEndian, CalculateCRC16(buf.Bytes()))

_, err = d.reqConn.Write(buf.Bytes())
return
}

// Land tells drone to come in for landing.
func (d *Driver) Land() (err error) {
buf, _ := d.createPacket(landCommand, 0x68, 1)
Expand Down

0 comments on commit d7d776a

Please sign in to comment.