hybridgroup.gobot/platforms/ardrone/README.md

48 lines
1.2 KiB
Markdown
Raw Normal View History

2014-06-10 10:01:53 +08:00
# Ardrone
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-11-29 07:34:42 +08:00
For more info about the ARDrone platform click [here](http://ardrone2.parrot.com/).
2014-11-29 07:34:42 +08:00
## How to Install
```
go get -d -u github.com/hybridgroup/gobot/... && go install github.com/hybridgroup/gobot/platforms/ardrone
```
2014-11-29 07:34:42 +08:00
## How to Use
```go
package main
import (
2014-07-11 08:02:00 +08:00
"time"
"github.com/hybridgroup/gobot"
2014-06-10 10:01:53 +08:00
"github.com/hybridgroup/gobot/platforms/ardrone"
)
func main() {
2014-07-11 08:02:00 +08:00
ardroneAdaptor := ardrone.NewArdroneAdaptor("Drone")
drone := ardrone.NewArdroneDriver(ardroneAdaptor, "Drone")
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() {
drone.Land()
})
})
drone.TakeOff()
}
2014-07-11 08:02:00 +08:00
robot := gobot.NewRobot("drone",
[]gobot.Connection{ardroneAdaptor},
[]gobot.Device{drone},
work,
)
robot.Start()
}
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.