2016-12-29 12:33:11 +00:00
|
|
|
// Package sensors provides a stratux interface to sensors used for AHRS calculations.
|
|
|
|
package sensors
|
|
|
|
|
|
|
|
// IMUReader provides an interface to various Inertial Measurement Unit sensors,
|
2017-03-08 22:16:29 +00:00
|
|
|
// such as the InvenSense MPU9150 or MPU9250. It is a light abstraction on top
|
2017-04-01 18:02:12 +00:00
|
|
|
// of the current github.com/westphae/goflying MPU9250 driver so that it can accommodate other types
|
2017-03-08 22:16:29 +00:00
|
|
|
// of drivers.
|
2016-12-29 12:33:11 +00:00
|
|
|
type IMUReader interface {
|
2017-04-01 18:02:12 +00:00
|
|
|
// Read returns the average (since last reading) time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z,
|
|
|
|
// error reading Gyro/Accel, and error reading Mag.
|
2017-03-08 22:16:29 +00:00
|
|
|
Read() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MagError error)
|
2017-06-22 02:05:44 +00:00
|
|
|
// ReadOne returns the most recent time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z,
|
|
|
|
// error reading Gyro/Accel, and error reading Mag.
|
|
|
|
ReadOne() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MagError error)
|
2017-03-08 22:16:29 +00:00
|
|
|
// Close stops reading the MPU.
|
|
|
|
Close()
|
2016-12-29 12:33:11 +00:00
|
|
|
}
|