hybridgroup.gobot/platforms/ardrone
Adrian Zankich b6b65e9af6 Update READMEs for each platform 2014-06-09 19:01:53 -07:00
..
docs WIP project restructure 2014-04-29 13:20:32 -07:00
LICENSE WIP project restructure 2014-04-29 13:20:32 -07:00
README.md Update READMEs for each platform 2014-06-09 19:01:53 -07:00
ardrone_adaptor.go Update ardrone adaptor, driver and examples 2014-05-20 23:36:44 -07:00
ardrone_adaptor_test.go Update ardrone adaptor, driver and examples 2014-05-20 23:36:44 -07:00
ardrone_driver.go Update ardrone adaptor, driver and examples 2014-05-20 23:36:44 -07:00
ardrone_driver_test.go Update ardrone adaptor, driver and examples 2014-05-20 23:36:44 -07:00
gobot-ardrone_suite_test.go WIP project restructure 2014-04-29 13:20:32 -07:00
test_helper.go WIP project restructure 2014-04-29 13:20:32 -07:00

README.md

Ardrone

This package provides the Gobot adaptor and driver for the Parrot Ardrone.

For more information about Gobot, check out the github repo at https://github.com/hybridgroup/gobot

Getting Started

Installing

go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/platforms/ardrone

Using

package main

import (
	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/ardrone"
	"time"
)

func main() {
	gbot := gobot.NewGobot()
	adaptor := ardrone.NewArdroneAdaptor("Drone")
	drone := ardrone.NewArdroneDriver(adaptor, "Drone")

	work := func() {
		drone.TakeOff()
		gobot.On(drone.Events["Flying"], func(data interface{}) {
			gobot.After(3*time.Second, func() {
				drone.Land()
			})
		})
	}

	gbot.Robots = append(gbot.Robots,
		gobot.NewRobot("drone", []gobot.Connection{adaptor}, []gobot.Device{drone}, work))

	gbot.Start()
}