Documentation ¶
Overview ¶
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 ¶
- Constants
- func DefaultCollisionConfig() sphero.CollisionConfig
- type Driver
- func (b *Driver) AntiDOSOff() (err error)
- func (b *Driver) Boost(state bool)
- func (b *Driver) ConfigureCollisionDetection(cc sphero.CollisionConfig)
- func (b *Driver) Connection() gobot.Connection
- func (b *Driver) EnableStopOnDisconnect()
- func (b *Driver) Halt() (err error)
- func (b *Driver) HandleResponses(data []byte, e error)
- func (b *Driver) Init() (err error)
- func (b *Driver) Name() string
- func (b *Driver) Roll(speed uint8, heading uint16)
- func (b *Driver) SetBackLEDOutput(value uint8)
- func (b *Driver) SetName(n string)
- func (b *Driver) SetRGB(r uint8, g uint8, bl uint8)
- func (b *Driver) SetRawMotorValues(lmode MotorModes, lpower uint8, rmode MotorModes, rpower uint8)
- func (b *Driver) SetRotationRate(speed uint8)
- func (b *Driver) SetStabilization(state bool)
- func (b *Driver) SetTXPower(level int) (err error)
- func (b *Driver) Sleep()
- func (b *Driver) Start() (err error)
- func (b *Driver) Stop()
- func (b *Driver) Wake() (err error)
- type MotorModes
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 )
Variables ¶
This section is empty.
Functions ¶
func DefaultCollisionConfig ¶ added in v1.2.0
func DefaultCollisionConfig() sphero.CollisionConfig
DefaultCollisionConfig returns a CollisionConfig with sensible collision defaults
Types ¶
type Driver ¶
Driver is the Gobot driver for the Sphero Ollie robot
func NewDriver ¶
func NewDriver(a ble.BLEConnector) *Driver
NewDriver creates a Driver for a Sphero Ollie
func (*Driver) AntiDOSOff ¶
AntiDOSOff turns off Anti-DOS code so we can control Ollie
func (*Driver) Boost ¶ added in v1.9.0
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 ¶ added in v1.2.0
func (b *Driver) ConfigureCollisionDetection(cc sphero.CollisionConfig)
ConfigureCollisionDetection configures the sensitivity of the detection.
func (*Driver) Connection ¶
func (b *Driver) Connection() gobot.Connection
Connection returns the connection to this Ollie
func (*Driver) EnableStopOnDisconnect ¶
func (b *Driver) EnableStopOnDisconnect()
EnableStopOnDisconnect auto-sends a Stop command after losing the connection
func (*Driver) HandleResponses ¶
HandleResponses handles responses returned from Ollie
func (*Driver) SetBackLEDOutput ¶ added in v1.9.0
SetBackLEDOutput allows you to control the brightness of the back(tail) LED.
func (*Driver) SetRawMotorValues ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
SetStabilization enables or disables the built-in auto stabilizing features of the Ollie
func (*Driver) SetTXPower ¶
SetTXPower sets transmit level
type MotorModes ¶ added in v1.9.0
type MotorModes uint8
const ( Off MotorModes = iota Forward Reverse Brake Ignore )
MotorModes required for SetRawMotorValues command