From 49180621798369292419d976f83a561ca38949bf Mon Sep 17 00:00:00 2001 From: cbwang2016 Date: Tue, 22 May 2018 08:46:15 +0800 Subject: [PATCH] StopLanding feature --- platforms/dji/tello/driver.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platforms/dji/tello/driver.go b/platforms/dji/tello/driver.go index bf6657d72..92350cd7f 100644 --- a/platforms/dji/tello/driver.go +++ b/platforms/dji/tello/driver.go @@ -315,6 +315,18 @@ func (d *Driver) Land() (err error) { return } +// StopLanding tells drone to stop landing. +func (d *Driver) StopLanding() (err error) { + buf, _ := d.createPacket(landCommand, 0x68, 1) + d.seq++ + binary.Write(buf, binary.LittleEndian, d.seq) + binary.Write(buf, binary.LittleEndian, byte(0x01)) + binary.Write(buf, binary.LittleEndian, CalculateCRC16(buf.Bytes())) + + _, err = d.reqConn.Write(buf.Bytes()) + return +} + // PalmLand tells drone to come in for a hand landing. func (d *Driver) PalmLand() (err error) { buf, _ := d.createPacket(palmLandCommand, 0x68, 1)