Skip to content

Commit

Permalink
Added tello edu driver
Browse files Browse the repository at this point in the history
  • Loading branch information
danacr authored and deadprogram committed Jan 11, 2020
1 parent 38593ad commit 78ae715
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions platforms/dji/tello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 28 additions & 0 deletions platforms/dji/tello/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down

0 comments on commit 78ae715

Please sign in to comment.