ardrone

package
v0.0.0-...-885376e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2014 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

README

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/gobot/platforms/ardrone

Using

package main

import (
	"time"

	"github.com/hybridgroup/gobot"
	"github.com/hybridgroup/gobot/platforms/ardrone"
)

func main() {
	gbot := gobot.NewGobot()

	ardroneAdaptor := ardrone.NewArdroneAdaptor("Drone")
	drone := ardrone.NewArdroneDriver(ardroneAdaptor, "Drone")

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

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

	gbot.Start()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArdroneAdaptor

type ArdroneAdaptor struct {
	gobot.Adaptor
	// contains filtered or unexported fields
}

func NewArdroneAdaptor

func NewArdroneAdaptor(name string) *ArdroneAdaptor

func (*ArdroneAdaptor) Connect

func (a *ArdroneAdaptor) Connect() bool

func (*ArdroneAdaptor) Finalize

func (a *ArdroneAdaptor) Finalize() bool

type ArdroneDriver

type ArdroneDriver struct {
	gobot.Driver
}

func NewArdroneDriver

func NewArdroneDriver(adaptor *ArdroneAdaptor, name string) *ArdroneDriver

func (*ArdroneDriver) Backward

func (a *ArdroneDriver) Backward(n float64)

func (*ArdroneDriver) Clockwise

func (a *ArdroneDriver) Clockwise(n float64)

func (*ArdroneDriver) CounterClockwise

func (a *ArdroneDriver) CounterClockwise(n float64)

func (*ArdroneDriver) Down

func (a *ArdroneDriver) Down(n float64)

func (*ArdroneDriver) Forward

func (a *ArdroneDriver) Forward(n float64)

func (*ArdroneDriver) Halt

func (a *ArdroneDriver) Halt() bool

func (*ArdroneDriver) Hover

func (a *ArdroneDriver) Hover()

func (*ArdroneDriver) Land

func (a *ArdroneDriver) Land()

func (*ArdroneDriver) Left

func (a *ArdroneDriver) Left(n float64)

func (*ArdroneDriver) Right

func (a *ArdroneDriver) Right(n float64)

func (*ArdroneDriver) Start

func (a *ArdroneDriver) Start() bool

func (*ArdroneDriver) TakeOff

func (a *ArdroneDriver) TakeOff()

func (*ArdroneDriver) Up

func (a *ArdroneDriver) Up(n float64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL