Documentation ¶
Index ¶
- Constants
- Variables
- func GetButtonChan() chan bool
- func GetFrameChan() chan DataFrame
- func InitSpine() error
- func IsInited() bool
- func SetLEDs(front uint32, middle uint32, back uint32) error
- func SetMotors(m1 int16, m2 int16, m3 int16, m4 int16) error
- func StopSpine()
- type DataFrame
- type MotorStatus
Constants ¶
View Source
const ( LED_GREEN = 0x00FF00 LED_RED = 0x0000FF LED_BLUE = 0xFF0000 LED_OFF = 0x0 )
Variables ¶
View Source
var ReadOnly bool = false
Functions ¶
func GetButtonChan ¶ added in v1.2.3
func GetButtonChan() chan bool
Get a button press channel. Sends true when press, false when released.
frameChan := GetButtonChannel()
for frame := range frameChan { <do whatever you need to with frame> <this will repeat whenever a new frame is ready> }
func GetFrameChan ¶ added in v1.2.2
func GetFrameChan() chan DataFrame
Get a frame channel. In your code, you should use it like:
frameChan := GetFrameChan()
for frame := range frameChan { <do whatever you need to with frame> <this will repeat whenever a new frame is ready> }
func InitSpine ¶
func InitSpine() error
Init spine communication. This must be run before you try to get a frame. Starts getting and sending frames, filling the currentDataFrame buffer. Checks if body is functional.
Types ¶
type DataFrame ¶
type DataFrame struct { Seq uint32 Cliffs [4]uint32 // right wheel, left wheel, lift, head Encoders MotorStatus BattVoltage int16 ChargerVoltage int16 BodyTemp int16 Touch uint16 ButtonState bool MicData []int16 ProxSigmaMM uint8 ProxRawRangeMM uint16 ProxSignalRateMCPS uint16 ProxAmbient uint16 ProxSPADCount uint16 ProxSampleCount uint16 ProxCalibResult uint32 }
This is the data each spine frame from GetFrame() contains.
type MotorStatus ¶
Click to show internal directories.
Click to hide internal directories.