core

package
v0.0.0-...-ab041b8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

core contains data structures and configuration elements that are agnostic to any specific sensor

Index

Constants

This section is empty.

Variables

View Source
var DataRate0_78125Hz = DataRate{ID: 10, Name: "0.78125Hz", Period: 1280 * time.Millisecond, OneSecondBuffer: 1}
View Source
var DataRate100Hz = DataRate{ID: 3, Name: "100Hz", Period: 10 * time.Millisecond, OneSecondBuffer: 100}
View Source
var DataRate12_5Hz = DataRate{ID: 6, Name: "12.5Hz", Period: 80 * time.Millisecond, OneSecondBuffer: 13}
View Source
var DataRate1_5625Hz = DataRate{ID: 9, Name: "1.5625Hz", Period: 640 * time.Millisecond, OneSecondBuffer: 2}
View Source
var DataRate200Hz = DataRate{ID: 2, Name: "200Hz", Period: 5 * time.Millisecond, OneSecondBuffer: 200}
View Source
var DataRate25Hz = DataRate{ID: 5, Name: "25Hz", Period: 40 * time.Millisecond, OneSecondBuffer: 25}
View Source
var DataRate3_125Hz = DataRate{ID: 8, Name: "3.125Hz", Period: 320 * time.Millisecond, OneSecondBuffer: 4}
View Source
var DataRate400Hz = DataRate{ID: 1, Name: "400Hz", Period: 2500 * time.Microsecond, OneSecondBuffer: 400}
View Source
var DataRate50Hz = DataRate{ID: 4, Name: "50Hz", Period: 20 * time.Millisecond, OneSecondBuffer: 50}
View Source
var DataRate6_25Hz = DataRate{ID: 7, Name: "6.25Hz", Period: 160 * time.Millisecond, OneSecondBuffer: 7}
View Source
var DataRate800Hz = DataRate{ID: 0, Name: "800Hz", Period: 1250 * time.Microsecond, OneSecondBuffer: 800}

Functions

This section is empty.

Types

type AccelRange

type AccelRange int

AccelRange represents the dynamic range you wish to use with the accelerometer sensor

const (
	AccelRange8g AccelRange = 8
	AccelRange4g AccelRange = 4
	AccelRange2g AccelRange = 2
)

type AccelReading

type AccelReading struct {
	Timestamp time.Time
	Xmg       float32
	Ymg       float32
	Zmg       float32
}

AccelReading represents 3 axis accelerometer readings in milli-gravities 1mg = 1/1000 earth standard gravity

type AhrsReading

type AhrsReading struct {
	Timestamp time.Time
	PitchRad  float32
	YawRad    float32
	RollRad   float32
}

type DataRate

type DataRate struct {
	ID              int
	Name            string
	Period          time.Duration
	OneSecondBuffer int
}

DataRate allows selection from 0.78125Hz to 800Hz

type GyroRange

type GyroRange int

GyroRange represents the dynamic range you wish to use with the gryoscope sensor

const (
	GyroRange250dps  GyroRange = 250
	GyroRange500dps  GyroRange = 500
	GyroRange1000dps GyroRange = 1000
	GyroRange2000dps GyroRange = 2000
	GyroRange4000dps GyroRange = 4000
)

type GyroReading

type GyroReading struct {
	Timestamp time.Time
	Xdps      float32
	Ydps      float32
	Zdps      float32
}

GyroReading represents 3 axis gyroscope readings in degrees per second

type MadgwickAhrs

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

func NewMadgwickAhrs

func NewMadgwickAhrs(dataRate DataRate) *MadgwickAhrs

func (*MadgwickAhrs) ComputeAhrs

func (d *MadgwickAhrs) ComputeAhrs(gyro *GyroReading, accel *AccelReading, mag *MagReading) *AhrsReading

type MagReading

type MagReading struct {
	Timestamp time.Time
	XuT       float32
	YuT       float32
	ZuT       float32
}

MagReading represents 3 axis magnetometer readings in micro-Teslas

type TemperatureAndHumidityReading

type TemperatureAndHumidityReading struct {
	Timestamp                  time.Time
	TemperatureDegreesCelsius  float32
	RelativeHumidityPercentage float32
}

TemperatureAndHumdityReading is a single reading of both Temperature and Humdity values

Jump to

Keyboard shortcuts

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