Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EulerAngles ¶
type EulerAngles struct { Q float64 R float64 S float64 Order RotationOrder }
type IMU ¶
type IMU interface { // Acceleration returns sensor accelerations in micro gravities Acceleration() (ax, ay, az int32) // AngularVelocity returns sensor angular velocity in micro radians AngularVelocity() (gx, gy, gz int32) }
IMU represents an IMU or INS sensor such as the MPU6050 or MPU6250
type IMUHeading ¶
type IMUHeading interface { IMU // North returns the direction of the measured magnetic field // in nanoteslas. North() (mx, my, mz int32) }
IMUHeading represents a group of sensors such as the MPU9250 which have accelerometer, gyroscope and magnetometer. These sensors are ideal for sensor fusion techniques such as Madgwick and Mahony algorithms.
type MadgwickFilter ¶
func NewMadgwickFilter ¶
func NewMadgwickFilter(beta float64) *MadgwickFilter
func (*MadgwickFilter) GetQuaternion ¶
func (mf *MadgwickFilter) GetQuaternion() quat.Number
func (*MadgwickFilter) UpdateARS ¶
func (mf *MadgwickFilter) UpdateARS(ax, ay, az, gx, gy, gz, samplePeriod float64)
type RotationMatrix ¶
type RotationMatrix struct {
// contains filtered or unexported fields
}
func RotationMatrixFromQuat ¶
func RotationMatrixFromQuat(q quat.Number) (r RotationMatrix)
func (*RotationMatrix) Mul ¶
func (A *RotationMatrix) Mul(B *RotationMatrix) (result RotationMatrix)
Mul Calculates A*B and returns the result.
func (*RotationMatrix) TaitBryan ¶
func (r *RotationMatrix) TaitBryan(order RotationOrder) (taitBryanAngles EulerAngles)
TaitBryan returns intrinsic angles of a TaitBryan rotation. Assumes the upper 3x3 of r is a pure rotation matrix (i.e, unscaled)
type RotationOrder ¶
type RotationOrder int
RotationOrder represents a convention for rotating a frame. This package implements intrinsic Tait-Bryan rotations at the time of writing this.
const ( // Tait-Bryan XYZ intrinsic rotation OrderXYZ RotationOrder // Tait-Bryan YXZ intrinsic rotation OrderYXZ // Tait-Bryan ZXY intrinsic rotation OrderZXY // Tait-Bryan ZYX intrinsic rotation OrderZYX // Tait-Bryan YZX intrinsic rotation OrderYZX // Tait-Bryan XZY intrinsic rotation OrderXZY )
func (RotationOrder) String ¶
func (r RotationOrder) String() (order string)
type XioAHRS ¶
type XioAHRS struct {
// contains filtered or unexported fields
}
Taken shamelessly from xioTechnologies/Fusion on github.
func NewXioAHRS ¶
func NewXioAHRS(gain float64, imuWithMagnetometer IMUHeading) *XioAHRS
NewXioAHRS instances a AHRS system with a IMU+heading sensor. Subsequent calls to Update read from IMU.
func NewXioARS ¶
NewFusionAHRS instances a AHRS system with only IMU sensor readings. Calls to Update read from IMU.
func (*XioAHRS) GetLinearAcceleration ¶
func (*XioAHRS) GetQuaternion ¶
func (*XioAHRS) SetMagneticField ¶
type XioAHRS32 ¶
type XioAHRS32 struct {
// contains filtered or unexported fields
}
Taken shamelessly from xioTechnologies/Fusion on github.
func NewXioAHRS32 ¶
func NewXioAHRS32(gain float64, imuWithMagnetometer IMUHeading) *XioAHRS32
NewXioAHRS instances a AHRS system with a IMU+heading sensor. Subsequent calls to Update read from IMU.
func NewXioARS32 ¶
NewFusionAHRS instances a AHRS system with only IMU sensor readings. Calls to Update read from IMU.