gobot: gobot.io/x/gobot/platforms/parrot/minidrone Index | Files

package minidrone

import "gobot.io/x/gobot/platforms/parrot/minidrone"

Package minidrone contains the Gobot driver for the Parrot Minidrone.

For more information refer to the minidrone README: https://github.com/hybridgroup/gobot/blob/master/platforms/parrot/minidrone/README.md


Package Files

doc.go minidrone_driver.go pitch.go


const (

    // Battery event
    Battery = "battery"

    // FlightStatus event
    FlightStatus = "flightstatus"

    // Takeoff event
    Takeoff = "takeoff"

    // Hovering event
    Hovering = "hovering"

    // Flying event
    Flying = "flying"

    // Landing event
    Landing = "landing"

    // Landed event
    Landed = "landed"

    // Emergency event
    Emergency = "emergency"

    // Rolling event
    Rolling = "rolling"

    // FlatTrimChange event
    FlatTrimChange = "flattrimchange"

    // LightFixed mode for LightControl
    LightFixed = 0

    // LightBlinked mode for LightControl
    LightBlinked = 1

    // LightOscillated mode for LightControl
    LightOscillated = 3

    // ClawOpen mode for ClawControl
    ClawOpen = 0

    // ClawClosed mode for ClawControl
    ClawClosed = 1

func ValidatePitch Uses

func ValidatePitch(data float64, offset float64) int

ValidatePitch helps validate pitch values such as those created by a joystick to values between 0-100 that are required as params to Parrot Minidrone PCMDs

type Driver Uses

type Driver struct {
    Pcmd Pcmd
    // contains filtered or unexported fields

Driver is the Gobot interface to the Parrot Minidrone

func NewDriver Uses

func NewDriver(a ble.BLEConnector) *Driver

NewDriver creates a Parrot Minidrone Driver

func (*Driver) BackFlip Uses

func (b *Driver) BackFlip() (err error)

BackFlip tells the drone to perform a backflip

func (*Driver) Backward Uses

func (b *Driver) Backward(val int) error

Backward tells drone to go in reverse. Pass in an int from 0-100.

func (*Driver) ClawControl Uses

func (b *Driver) ClawControl(id uint8, mode uint8) (err error)

ClawControl controls the claw on the Parrot Mambo Params:

id - always 0
mode - either ClawOpen or ClawClosed

func (*Driver) Clockwise Uses

func (b *Driver) Clockwise(val int) error

Clockwise tells drone to rotate in a clockwise direction. Pass in an int from 0-100.

func (*Driver) Connection Uses

func (b *Driver) Connection() gobot.Connection

Connection returns the BLE connection

func (*Driver) CounterClockwise Uses

func (b *Driver) CounterClockwise(val int) error

CounterClockwise tells drone to rotate in a counter-clockwise direction. Pass in an int from 0-100.

func (*Driver) Down Uses

func (b *Driver) Down(val int) error

Down tells the drone to descend. Pass in an int from 0-100.

func (*Driver) Emergency Uses

func (b *Driver) Emergency() (err error)

Emergency sets the Minidrone into emergency mode

func (*Driver) FlatTrim Uses

func (b *Driver) FlatTrim() (err error)

FlatTrim calibrates the Minidrone to use its current position as being level

func (*Driver) Forward Uses

func (b *Driver) Forward(val int) error

Forward tells the drone to go forward. Pass in an int from 0-100.

func (*Driver) FrontFlip Uses

func (b *Driver) FrontFlip() (err error)

FrontFlip tells the drone to perform a front flip

func (*Driver) GenerateAllStates Uses

func (b *Driver) GenerateAllStates() (err error)

GenerateAllStates sets up all the default states aka settings on the drone

func (*Driver) GunControl Uses

func (b *Driver) GunControl(id uint8) (err error)

GunControl fires the gun on the Parrot Mambo Params:

id - always 0

func (*Driver) Halt Uses

func (b *Driver) Halt() (err error)

Halt stops minidrone driver (void)

func (*Driver) HullProtection Uses

func (b *Driver) HullProtection(protect bool) error

HullProtection is not supported by the Parrot Minidrone

func (*Driver) Init Uses

func (b *Driver) Init() (err error)

Init initializes the BLE insterfaces used by the Minidrone

func (*Driver) Land Uses

func (b *Driver) Land() (err error)

Land tells the Minidrone to land

func (*Driver) Left Uses

func (b *Driver) Left(val int) error

Left tells drone to go left. Pass in an int from 0-100.

func (*Driver) LeftFlip Uses

func (b *Driver) LeftFlip() (err error)

LeftFlip tells the drone to perform a flip to the left

func (*Driver) LightControl Uses

func (b *Driver) LightControl(id uint8, mode uint8, intensity uint8) (err error)

LightControl controls lights on those Minidrone models which have the correct hardware, such as the Maclane, Blaze, & Swat. Params:

id - always 0
mode - either LightFixed, LightBlinked, or LightOscillated
intensity - Light intensity from 0 (OFF) to 100 (Max intensity).
			Only used in LightFixed mode.

func (*Driver) Name Uses

func (b *Driver) Name() string

Name returns the Driver Name

func (*Driver) Outdoor Uses

func (b *Driver) Outdoor(outdoor bool) error

Outdoor mode is not supported by the Parrot Minidrone

func (*Driver) Right Uses

func (b *Driver) Right(val int) error

Right tells drone to go right. Pass in an int from 0-100.

func (*Driver) RightFlip Uses

func (b *Driver) RightFlip() (err error)

RightFlip tells the drone to perform a flip to the right

func (*Driver) SetName Uses

func (b *Driver) SetName(n string)

SetName sets the Driver Name

func (*Driver) Start Uses

func (b *Driver) Start() (err error)

Start tells driver to get ready to do work

func (*Driver) StartPcmd Uses

func (b *Driver) StartPcmd()

StartPcmd starts the continuous Pcmd communication with the Minidrone

func (*Driver) StartRecording Uses

func (b *Driver) StartRecording() error

StartRecording is not supported by the Parrot Minidrone

func (*Driver) Stop Uses

func (b *Driver) Stop() error

Stop tells the drone to stop moving in any direction and simply hover in place

func (*Driver) StopRecording Uses

func (b *Driver) StopRecording() error

StopRecording is not supported by the Parrot Minidrone

func (*Driver) TakeOff Uses

func (b *Driver) TakeOff() (err error)

TakeOff tells the Minidrone to takeoff

func (*Driver) TakePicture Uses

func (b *Driver) TakePicture() (err error)

TakePicture tells the Minidrone to take a picture

func (*Driver) Up Uses

func (b *Driver) Up(val int) error

Up tells the drone to ascend. Pass in an int from 0-100.

type Pcmd Uses

type Pcmd struct {
    Flag  int
    Roll  int
    Pitch int
    Yaw   int
    Gaz   int
    Psi   float32

Pcmd is the Parrot Command structure for flight control

Package minidrone imports 8 packages (graph). Updated 2018-04-22. Refresh now. Tools for package owners.