mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-27 13:48:56 +08:00
Added tello edu driver
This commit is contained in:
parent
38593ad7f0
commit
78ae715e6c
@ -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
|
## References
|
||||||
|
|
||||||
This driver could not exist without the awesome members of the unofficial Tello forum:
|
This driver could not exist without the awesome members of the unofficial Tello forum:
|
||||||
|
@ -221,6 +221,34 @@ func NewDriver(port string) *Driver {
|
|||||||
return d
|
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.
|
// Name returns the name of the device.
|
||||||
func (d *Driver) Name() string { return d.name }
|
func (d *Driver) Name() string { return d.name }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user