2014-06-10 10:01:53 +08:00
# Ardrone
2014-04-26 18:11:51 +08:00
2014-11-29 07:34:42 +08:00
The ARDrone from Parrot is an inexpensive quadcopter that is controlled using WiFi. It includes a built-in front-facing HD video camera, as well as a second lower resolution bottom facing video camera.
2014-04-26 18:11:51 +08:00
2014-11-29 07:34:42 +08:00
For more info about the ARDrone platform click [here ](http://ardrone2.parrot.com/ ).
2014-04-26 18:11:51 +08:00
2014-11-29 07:34:42 +08:00
## How to Install
2014-04-26 18:11:51 +08:00
```
2015-07-09 07:03:20 +08:00
go get -d -u github.com/hybridgroup/gobot/... & & go install github.com/hybridgroup/gobot/platforms/ardrone
2014-04-26 18:11:51 +08:00
```
2014-11-29 07:34:42 +08:00
## How to Use
2014-04-26 18:11:51 +08:00
```go
package main
import (
2014-07-11 08:02:00 +08:00
"time"
2014-04-26 18:11:51 +08:00
"github.com/hybridgroup/gobot"
2014-06-10 10:01:53 +08:00
"github.com/hybridgroup/gobot/platforms/ardrone"
2014-04-26 18:11:51 +08:00
)
func main() {
2014-06-10 10:01:53 +08:00
gbot := gobot.NewGobot()
2014-07-11 08:02:00 +08:00
ardroneAdaptor := ardrone.NewArdroneAdaptor("Drone")
drone := ardrone.NewArdroneDriver(ardroneAdaptor, "Drone")
2014-04-26 18:11:51 +08:00
work := func() {
2014-07-11 08:02:00 +08:00
gobot.On(drone.Event("flying"), func(data interface{}) {
2014-06-10 10:01:53 +08:00
gobot.After(3*time.Second, func() {
2014-04-26 18:11:51 +08:00
drone.Land()
})
})
2015-11-08 07:59:44 +08:00
drone.TakeOff()
2014-04-26 18:11:51 +08:00
}
2014-07-11 08:02:00 +08:00
robot := gobot.NewRobot("drone",
[]gobot.Connection{ardroneAdaptor},
[]gobot.Device{drone},
work,
)
gbot.AddRobot(robot)
2014-04-26 18:11:51 +08:00
2014-06-10 10:01:53 +08:00
gbot.Start()
2014-04-26 18:11:51 +08:00
}
2014-07-11 08:02:00 +08:00
```
2014-11-29 07:34:42 +08:00
## How to Connect
The ARDrone is a WiFi device, so there is no additional work to establish a connection to a single drone. However, in order to connect to multiple drones, you need to perform some configuration steps on each drone via SSH.