hybridgroup.gobot/ardrone
Adrian Zankich 28d0d5178b WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
..
docs WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
examples WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
LICENSE WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
README.md WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
ardrone_adaptor.go WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
ardrone_adaptor_test.go WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
ardrone_driver.go WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
ardrone_driver_test.go WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
gobot-ardrone_suite_test.go WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -07:00
test_helper.go WIP combine all seperate adaptor and driver repos into a single repo 2014-04-29 05:36:25 -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.