tello: Fix partially #793 by initialize doneCh in NewDriverWithIP (#931)

This commit is contained in:
Joey Berkovitz 2023-06-11 05:10:17 -04:00 committed by Thomas Kohler
parent 1175db315d
commit d459fc05ab
1 changed files with 2 additions and 24 deletions

View File

@ -202,30 +202,7 @@ type Driver struct {
// NewDriver creates a driver for the Tello drone. Pass in the UDP port to use for the responses
// from the drone.
func NewDriver(port string) *Driver {
d := &Driver{name: gobot.DefaultName("Tello"),
reqAddr: "192.168.10.1:8889",
respPort: port,
videoPort: "11111",
Eventer: gobot.NewEventer(),
doneCh: make(chan struct{}, 1),
}
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
return NewDriverWithIP("192.168.10.1", port)
}
// NewDriverWithIP creates a driver for the Tello EDU drone. Pass in the ip address and UDP port to use for the responses
@ -236,6 +213,7 @@ func NewDriverWithIP(ip string, port string) *Driver {
respPort: port,
videoPort: "11111",
Eventer: gobot.NewEventer(),
doneCh: make(chan struct{}, 1),
}
d.AddEvent(ConnectedEvent)