-
Notifications
You must be signed in to change notification settings - Fork 0
/
tello-basic.go
45 lines (36 loc) · 719 Bytes
/
tello-basic.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/dji/tello"
)
func main() {
drone := tello.NewDriver("8888")
work := func() {
drone.TakeOff()
gobot.After(2000*time.Millisecond, func() {
drone.Clockwise(-90)
})
gobot.After(2200*time.Millisecond, func() {
drone.Clockwise(40)
})
gobot.After(4500*time.Millisecond, func() {
drone.Forward(50)
})
gobot.After(4500*time.Millisecond, func() {
drone.Forward(50)
})
gobot.After(3000*time.Millisecond, func() {
drone.Hover()
})
gobot.After(6*time.Second, func() {
drone.Land()
})
}
robot := gobot.NewRobot("tello",
[]gobot.Connection{},
[]gobot.Device{drone},
work,
)
robot.Start()
}