robocape

package module
v0.0.0-...-831ee84 Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: MIT Imports: 5 Imported by: 0

README

robocape

GoDoc

This is a Go wrapper for the robotcape C library which is designed to work with the beaglebone blue board. It is designed to make it easy to take advantage of this great library without rewriting it in pure Go.

usage

As one would imagine this library must be built on the native platform to enable linking to robotcape library using CGO.

debian@beaglebone:~$ go get -u -v github.com/wolfeidau/robocape
...
debian@beaglebone:~$ cd go/src/github.com/wolfeidau/robocape
debian@beaglebone:~$ go install ./examples/...
debian@beaglebone:~$ sudo /home/debian/go/bin/rc_buttons

license

This code is released under MIT license and is Copyright Mark Wolfe.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalibrateGyro

func CalibrateGyro() error

CalibrateGyro calibrate the gyro

func CalibrateMag

func CalibrateMag() error

CalibrateMag calibrate the magnetometer

func Cleanup

func Cleanup() error

Cleanup release resources used by the robotcape

func DisableMotors

func DisableMotors() error

DisableMotors disable the Motor

func ESCPulseNormalised

func ESCPulseNormalised(ch int, throttle float32) error

ESCPulseNormalised send a pulse to the ESC

func EnableMotors

func EnableMotors() error

EnableMotors enable the Motor

func EnableServoPowerRail

func EnableServoPowerRail() error

EnableServoPowerRail enable the servo power rail

func Exit

func Exit()

Exit stop the process

func Initialise

func Initialise() error

Initialise initialise the robotcape

func IsExiting

func IsExiting() bool

IsExiting check if the process should exit

func MotorBrake

func MotorBrake(ch int, throttle float32) error

MotorBrake send a speed to a given motor

func PowerOffIMU

func PowerOffIMU() error

PowerOffIMU shut down the IMU

func ServoPulseNormalised

func ServoPulseNormalised(ch int, pos float32) error

ServoPulseNormalised send a pulse to the servo

func SetModePressed

func SetModePressed(callback func()) error

SetModePressed register function callback for mode pressed

func SetModeReleased

func SetModeReleased(callback func()) error

SetModeReleased register function callback for mode released

func SetPausePressed

func SetPausePressed(callback func()) error

SetPausePressed register function callback for pause pressed

func SetPauseReleased

func SetPauseReleased(callback func()) error

SetPauseReleased register function callback for pause released

func WaitForExit

func WaitForExit()

WaitForExit wait for exit

Types

type AccelData

type AccelData struct {
	X float32
	Y float32
	Z float32
}

AccelData data read from accelerometer

type FusedQuatData

type FusedQuatData struct {
	QuatW float32
	QuatX float32
	QuatY float32
	QuatZ float32
}

FusedQuatData data read from DMP

type FusedTaitBryanData

type FusedTaitBryanData struct {
	PitchX float32
	RollY  float32
	YawZ   float32
}

FusedTaitBryanData data read from DMP

type GyroData

type GyroData struct {
	X float32
	Y float32
	Z float32
}

GyroData data read from gyro

type IMU

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

IMU holds imu data

func InitialiseIMU

func InitialiseIMU() (*IMU, error)

InitialiseIMU setup the IMU

func (*IMU) ReadAccel

func (i *IMU) ReadAccel() (*AccelData, error)

ReadAccel read the accelerometer data

func (*IMU) ReadGyro

func (i *IMU) ReadGyro() (*GyroData, error)

ReadGyro read the gryro data

func (*IMU) ReadMag

func (i *IMU) ReadMag() (*MagData, error)

ReadMag read the magnetometer data

func (*IMU) ReadTemp

func (i *IMU) ReadTemp() (float32, error)

ReadTemp read the tempreture data

type IMUDmp

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

IMUDmp holds imu data TODO: needs LOCKING

func InitialiseIMUDmp

func InitialiseIMUDmp() (*IMUDmp, error)

InitialiseIMUDmp setup the IMU with DMP

func (*IMUDmp) AssignDmpCallback

func (i *IMUDmp) AssignDmpCallback(callback func(tbd *FusedTaitBryanData, qd *FusedQuatData))

AssignDmpCallback assign a callback function which is invoked for each interupt

type MagData

type MagData struct {
	X float32
	Y float32
	Z float32
}

MagData data read from magnetometer

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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