1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-26 13:48:49 +08:00

Added tello edu driver

This commit is contained in:
danacr 2020-01-11 15:20:27 +01:00 committed by Ron Evans
parent 38593ad7f0
commit 78ae715e6c
2 changed files with 36 additions and 0 deletions

View File

@ -50,6 +50,14 @@ func main() {
}
```
## Telo Edu driver
If you are planning to connect to the edu version of the tello, please use the `NewDriverWithIP` driver instead
```go
drone := tello.NewDriverWithIP("192.168.10.1", "8888")
```
## References
This driver could not exist without the awesome members of the unofficial Tello forum:

View File

@ -221,6 +221,34 @@ func NewDriver(port string) *Driver {
return d
}
// NewDriverWithIP creates a driver for the Tello EDU drone. Pass in the ip address and UDP port to use for the responses
// from the drone.
func NewDriverWithIP(ip string, port string) *Driver {
d := &Driver{name: gobot.DefaultName("Tello"),
reqAddr: ip + ":8889",
respPort: port,
videoPort: "11111",
Eventer: gobot.NewEventer(),
}
d.AddEvent(ConnectedEvent)
d.AddEvent(FlightDataEvent)
d.AddEvent(TakeoffEvent)
d.AddEvent(LandingEvent)
d.AddEvent(PalmLandingEvent)
d.AddEvent(BounceEvent)
d.AddEvent(FlipEvent)
d.AddEvent(TimeEvent)
d.AddEvent(LogEvent)
d.AddEvent(WifiDataEvent)
d.AddEvent(LightStrengthEvent)
d.AddEvent(SetExposureEvent)
d.AddEvent(VideoFrameEvent)
d.AddEvent(SetVideoEncoderRateEvent)
return d
}
// Name returns the name of the device.
func (d *Driver) Name() string { return d.name }