-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Hello, during my testing of this SDK or thingamajig on the Holystone 200 I have discovered that the example provided is not complete and is sort of misleading, the example provided is as follows
package main
import (
"time"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/platforms/holystone/hs200"
)
func main() {
drone := hs200.NewDriver("172.16.10.1:8888", "172.16.10.1:8080")
work := func() {
drone.TakeOff()
gobot.After(5*time.Second, func() {
drone.Land()
})
}
robot := gobot.NewRobot("hs200",
[]gobot.Connection{},
[]gobot.Device{drone},
work,
)
if err := robot.Start(); err != nil {
panic(err)
}
}
however theres 2 things that i had to figure out, firstly is adding a drone.Enable() before drone.Start() and then waiting for the drone to flash the strobe-y lights, then press control + C on your terminal to end the process, then run it again this has worked for me 100% of the time and i dont know why, heres the modified example i just tested to be working
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/holystone/hs200"
)
func main() {
drone := hs200.NewDriver("172.16.10.1:8888", "172.16.10.1:8080")
work := func() {
drone.Enable()
drone.TakeOff()
gobot.After(5*time.Second, func() {
drone.Land()
})
}
robot := gobot.NewRobot("hs200",
[]gobot.Connection{},
[]gobot.Device{drone},
work,
)
robot.Start()
}
Metadata
Metadata
Assignees
Labels
No labels