Created
April 27, 2018 07:54
-
-
Save toricls/aa62f4bf83c039f494279b8122ec740f to your computer and use it in GitHub Desktop.
Playing with DJI Tello(https://www.ryzerobotics.com/tello) and Gobot(https://github.com/hybridgroup/gobot)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
"gobot.io/x/gobot" | |
"gobot.io/x/gobot/platforms/dji/tello" | |
) | |
func main() { | |
drone := tello.NewDriver("8888") | |
work := func() { | |
gobot.After(5*time.Second, func() { | |
drone.TakeOff() | |
}) | |
gobot.After(10*time.Second, func() { | |
drone.FrontFlip() | |
}) | |
gobot.After(15*time.Second, func() { | |
drone.BackFlip() | |
}) | |
gobot.After(20*time.Second, func() { | |
drone.Land() | |
}) | |
} | |
robot := gobot.NewRobot("tello", | |
[]gobot.Connection{}, | |
[]gobot.Device{drone}, | |
work, | |
) | |
robot.Start() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment