gobot: gobot.io/x/gobot/platforms/sphero/ollie Index | Files

package ollie

import "gobot.io/x/gobot/platforms/sphero/ollie"

Package ollie contains the Gobot driver for the Sphero Ollie.

For more information refer to the Ollie README: https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/ollie/README.md

Index

Package Files

doc.go ollie_driver.go ollie_packets.go

Constants

const (

    // SensorData event
    SensorData = "sensordata"

    // Collision event
    Collision = "collision"

    // Error event
    Error = "error"

    // Packet header size
    PacketHeaderSize = 5

    // Response packet max size
    ResponsePacketMaxSize = 20

    // Collision Packet data size: The number of bytes following the DLEN field through the end of the packet
    CollisionDataSize = 17

    // Full size of the collision response
    CollisionResponseSize = PacketHeaderSize + CollisionDataSize
)

func DefaultCollisionConfig Uses

func DefaultCollisionConfig() sphero.CollisionConfig

DefaultCollisionConfig returns a CollisionConfig with sensible collision defaults

type Driver Uses

type Driver struct {
    gobot.Eventer
    // contains filtered or unexported fields
}

Driver is the Gobot driver for the Sphero Ollie robot

func NewDriver Uses

func NewDriver(a ble.BLEConnector) *Driver

NewDriver creates a Driver for a Sphero Ollie

func (*Driver) AntiDOSOff Uses

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

AntiDOSOff turns off Anti-DOS code so we can control Ollie

func (*Driver) Boost Uses

func (b *Driver) Boost(state bool)

Boost executes the boost macro from within the SSB which takes a 1 byte parameter which is either 01h to begin boosting or 00h to stop.

func (*Driver) ConfigureCollisionDetection Uses

func (b *Driver) ConfigureCollisionDetection(cc sphero.CollisionConfig)

ConfigureCollisionDetection configures the sensitivity of the detection.

func (*Driver) Connection Uses

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

Connection returns the connection to this Ollie

func (*Driver) EnableStopOnDisconnect Uses

func (b *Driver) EnableStopOnDisconnect()

EnableStopOnDisconnect auto-sends a Stop command after losing the connection

func (*Driver) Halt Uses

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

Halt stops Ollie driver (void)

func (*Driver) HandleResponses Uses

func (b *Driver) HandleResponses(data []byte, e error)

HandleResponses handles responses returned from Ollie

func (*Driver) Init Uses

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

Init is used to initialize the Ollie

func (*Driver) Name Uses

func (b *Driver) Name() string

Name returns the name for the Driver

func (*Driver) Roll Uses

func (b *Driver) Roll(speed uint8, heading uint16)

Roll tells the Ollie to roll

func (*Driver) SetBackLEDOutput Uses

func (b *Driver) SetBackLEDOutput(value uint8)

SetBackLEDOutput allows you to control the brightness of the back(tail) LED.

func (*Driver) SetName Uses

func (b *Driver) SetName(n string)

SetName sets the Name for the Driver

func (*Driver) SetRGB Uses

func (b *Driver) SetRGB(r uint8, g uint8, bl uint8)

SetRGB sets the Ollie to the given r, g, and b values

func (*Driver) SetRawMotorValues Uses

func (b *Driver) SetRawMotorValues(lmode MotorModes, lpower uint8, rmode MotorModes, rpower uint8)

SetRawMotorValues allows you to take over one or both of the motor output values, instead of having the stabilization system control them. Each motor (left and right) requires a mode and a power value from 0-255

func (*Driver) SetRotationRate Uses

func (b *Driver) SetRotationRate(speed uint8)

SetRotationRate allows you to control the rotation rate that Sphero will use to meet new heading commands. A value of 255 jumps to the maximum (currently 400 degrees/sec). A value of zero doesn't make much sense so it's interpreted as 1, the minimum.

func (*Driver) SetStabilization Uses

func (b *Driver) SetStabilization(state bool)

SetStabilization enables or disables the built-in auto stabilizing features of the Ollie

func (*Driver) SetTXPower Uses

func (b *Driver) SetTXPower(level int) (err error)

SetTXPower sets transmit level

func (*Driver) Sleep Uses

func (b *Driver) Sleep()

Sleep says Go to sleep

func (*Driver) Start Uses

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

Start tells driver to get ready to do work

func (*Driver) Stop Uses

func (b *Driver) Stop()

Stop tells the Ollie to stop

func (*Driver) Wake Uses

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

Wake wakes Ollie up so we can play

type MotorModes Uses

type MotorModes uint8
const (
    Off MotorModes = iota
    Forward
    Reverse
    Brake
    Ignore
)

MotorModes required for SetRawMotorValues command

Package ollie imports 8 packages (graph) and is imported by 2 packages. Updated 2018-04-20. Refresh now. Tools for package owners.