bb

package
v0.0.0-...-418de2e Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinTilt = C.MinTilt
	MaxTilt = C.MaxTilt
)

Min/Max allowed value for tilt (degrees)

View Source
const Address = C.I2CAddress

Address of BotBoarduino on i2c bus

View Source
const (
	ModuleArm = C.ModuleArm
)

Robotic ARM controls

View Source
const (
	ModuleBoard = C.ModuleBoard
)

Reading Arduino board state

View Source
const (
	ModuleCommand = C.ModuleCommand
)

Sending commands/actions to Arduino

View Source
const (
	ModuleEnvironmentSensor = C.ModuleEnvironmentSensor
)

Environment sensor installed on the robot

View Source
const (
	ModuleLightSensor = C.ModuleLightSensor
)

Ambient light sensor installed on the robot

View Source
const (
	ModuleTilt = C.ModuleTilt
)

Pan & Tilt installed on the robot, normally has LIDAR attached

View Source
const ResetPin = 4

ResetPin is a Raspberry Pi pin that is connected to the Arduino Reset pin

Variables

This section is empty.

Functions

This section is empty.

Types

type BB

type BB struct {
	// contains filtered or unexported fields
}

BB is a control interface for BotBoarduino part of the project

func NewBB

func NewBB(bus i2c.Bus, addr byte) *BB

NewBB creates a new instance of BotBoarduino to use

func (*BB) ArmBasePan

func (bb *BB) ArmBasePan(angle byte) error

ArmBasePan commands BB to rotate robotic arm base, 0-180 degrees

func (*BB) ArmBaseTilt

func (bb *BB) ArmBaseTilt(angle byte) error

ArmBaseTilt commands BB to tilt robotic arm, 0-180 degrees

func (*BB) ArmElbow

func (bb *BB) ArmElbow(angle byte) error

ArmElbow commands BB to bend robotic arm's elbow, 0-180 degrees

func (*BB) ArmGrip

func (bb *BB) ArmGrip(angle byte) error

ArmGrip commands BB to change the grip position and width, 0-180

func (*BB) ArmWristRotate

func (bb *BB) ArmWristRotate(angle byte) error

ArmWristRotate commands BB to rotate the wrist, 0-180 degrees

func (*BB) ArmWristTilt

func (bb *BB) ArmWristTilt(angle byte) error

ArmWristTilt commands BB to tilt the wrist, 0-180 degrees

func (*BB) GetAmbientLight

func (bb *BB) GetAmbientLight() (uint16, error)

GetAmbientLight returns ambient light brightness in range 0..1023

func (*BB) GetBatteryPercentage

func (bb *BB) GetBatteryPercentage() (byte, error)

GetBatteryPercentage returns estimated battery charge, in percent

func (*BB) GetStatus

func (bb *BB) GetStatus() (uint16, error)

GetStatus returns the readiness status bitmask, which can be checked with Module* bit numbers Example:

if ((GetStatus() & (1 << ModuleEnvironmentSensor)) != 0) {
  // environment sensor is ready
}

func (*BB) GetTemperatureAndHumidity

func (bb *BB) GetTemperatureAndHumidity() (t byte, h byte, e error)

GetTemperatureAndHumidity gets ambient temperature in Celsius and relative humidity in %

func (*BB) Reset

func (bb *BB) Reset(pin byte)

Reset BotBoarduino given that "pin" is wired to board's Reset

func (*BB) Sleep

func (bb *BB) Sleep() error

Sleep reduces power usage of the module (and some hardware)

func (*BB) Tilt

func (bb *BB) Tilt(angle byte) error

Tilt the LIDAR (or anything else attached to Tilt) for angle degrees (MinTilt-MaxTilt)

func (*BB) Wake

func (bb *BB) Wake() error

Wake is necessary to re-enable hardware disabled by Sleep()

type StatusError

type StatusError struct {
	Status uint16
}

StatusError is returned when the status returned by BB is not compatible with the command

func (*StatusError) Error

func (se *StatusError) Error() string

Jump to

Keyboard shortcuts

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