hybridgroup.gobot/platforms/ardrone
Adrian Zankich d32a5270f2 Update ardrone adaptor, driver and examples 2014-05-20 23:36:44 -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 WIP project restructure 2014-04-29 13:20:32 -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

Gobot for ardrone

Gobot (http://gobot.io/) is a library for robotics and physical computing using Go

This repository contains the Gobot adaptor for ardrone.

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

Build Status Coverage Status

Installing

go get github.com/hybridgroup/gobot-ardrone

Using

package main

import (
	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot-ardrone"
)

func main() {

	ardroneAdaptor := new(gobotArdrone.ArdroneAdaptor)
	ardroneAdaptor.Name = "Drone"

	drone := gobotArdrone.NewArdrone(ardroneAdaptor)
	drone.Name = "Drone"

	work := func() {
		drone.TakeOff()
		gobot.On(drone.Events["Flying"], func(data interface{}) {
			gobot.After("1s", func() {
				drone.Right(0.1)
			})
			gobot.After("2s", func() {
				drone.Left(0.1)
			})
			gobot.After("3s", func() {
				drone.Land()
			})
		})
	}

	robot := gobot.Robot{
		Connections: []gobot.Connection{ardroneAdaptor},
		Devices:     []gobot.Device{drone},
		Work:        work,
	}

	robot.Start()
}

License

Copyright (c) 2013-2014 The Hybrid Group. Licensed under the Apache 2.0 license.