hybridgroup.gobot/platforms/ardrone
Adrian Zankich db44941c21 Use new Event type for events 2014-06-11 11:37:20 -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 Make golint happy 2014-06-10 15:16:11 -07:00
ardrone_adaptor_test.go Update ardrone adaptor, driver and examples 2014-05-20 23:36:44 -07:00
ardrone_driver.go Use new Event type for events 2014-06-11 11:37:20 -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 Make golint happy 2014-06-10 15:16:11 -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()
}