package
1.13.0
Repository: https://github.com/danielfallon/gobot.git
Documentation: pkg.go.dev

# README

Ardrone

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.

For more info about the ARDrone platform click here.

How to Install

go get -d -u gobot.io/x/gobot/...

How to Use

package main

import (
	"time"

	"gobot.io/x/gobot"
	"gobot.io/x/gobot/platforms/parrot/ardrone"
)

func main() {
	ardroneAdaptor := ardrone.NewAdaptor("Drone")
	drone := ardrone.NewDriver(ardroneAdaptor, "Drone")

	work := func() {
		drone.On(drone.Event("flying"), func(data interface{}) {
			gobot.After(3*time.Second, func() {
				drone.Land()
			})
		})
		drone.TakeOff()
	}

	robot := gobot.NewRobot("drone",
		[]gobot.Connection{ardroneAdaptor},
		[]gobot.Device{drone},
		work,
	)

	robot.Start()
}

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.

# Functions

NewAdaptor returns a new ardrone.Adaptor and optionally accepts: string: The ardrones IP Address .
NewDriver creates an Driver for the ARDrone.
ValidatePitch helps validate pitch values such as those created by a joystick to values between 0-1.0 that are required as params to Parrot ARDrone PCMDs.

# Constants

Flying event.

# Structs

Adaptor is gobot.Adaptor representation for the Ardrone.
Driver is gobot.Driver representation for the Ardrone.