KalmanAbsoluteAttitudeProcessor4

class KalmanAbsoluteAttitudeProcessor4(location: Location? = null, var currentDate: Date? = null, var computeExternalAcceleration: Boolean = true, var computeEulerAngles: Boolean = true, val computeCovariances: Boolean = true, val computeEulerAnglesCovariance: Boolean = true, val fixMagnetometerMeasurements: Boolean = true, phiMatrixMethod: PhiMatrixMethod = PhiMatrixMethod.APPROXIMATED, processNoiseCovarianceMethod: ProcessNoiseCovarianceMethod = ProcessNoiseCovarianceMethod.BETTER, quaternionStepIntegrator: KalmanAbsoluteAttitudeProcessor4.QuaternionStepIntegratorType = QuaternionStepIntegratorType.RUNGE_KUTTA, val gyroscopeNoisePsd: Double = DEFAULT_GYROSCOPE_NOISE_PSD, val accelerometerNoiseStandardDeviation: Double = DEFAULT_ACCELEROMETER_NOISE_STANDARD_DEVIATION, val magnetometerNoiseStandardDeviation: Double = DEFAULT_MAGNETOMETER_NOISE_STANDARD_DEVIATION, val processorListener: KalmanAbsoluteAttitudeProcessor4.OnProcessedListener? = null)

Estimates absolute attitude using a Kalman filter. This is based on: https://github.com/liviobisogni/quaternion-kalman-filter And: Young Soo Suh. Orientation estimation using a quaternion-based indirect Kalman filter with adaptive estimation of external acceleration.

Constructors

Link copied to clipboard
constructor(location: Location? = null, currentDate: Date? = null, computeExternalAcceleration: Boolean = true, computeEulerAngles: Boolean = true, computeCovariances: Boolean = true, computeEulerAnglesCovariance: Boolean = true, fixMagnetometerMeasurements: Boolean = true, phiMatrixMethod: PhiMatrixMethod = PhiMatrixMethod.APPROXIMATED, processNoiseCovarianceMethod: ProcessNoiseCovarianceMethod = ProcessNoiseCovarianceMethod.BETTER, quaternionStepIntegrator: KalmanAbsoluteAttitudeProcessor4.QuaternionStepIntegratorType = QuaternionStepIntegratorType.RUNGE_KUTTA, gyroscopeNoisePsd: Double = DEFAULT_GYROSCOPE_NOISE_PSD, accelerometerNoiseStandardDeviation: Double = DEFAULT_ACCELEROMETER_NOISE_STANDARD_DEVIATION, magnetometerNoiseStandardDeviation: Double = DEFAULT_MAGNETOMETER_NOISE_STANDARD_DEVIATION, processorListener: KalmanAbsoluteAttitudeProcessor4.OnProcessedListener? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
fun interface OnProcessedListener

Interface to notify when a new attitude has been processed.

Link copied to clipboard

Indicates type of quaternion integrator step. Different types exist with different levels of accuracy and computation accuracy.

Properties

Link copied to clipboard
val ba: Matrix

Estimated accelerometer bias.

Link copied to clipboard
val bg: Matrix

Estimated gyroscope bias.

Link copied to clipboard
val bodyExternalAcceleration: AccelerationTriad?

Estimated external acceleration applied on the device expressed in NED coordinates respect to device body.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ecefAttitude: Quaternion

Estimated device attitude expressed in ECEF coordinates respect to Earth.

Link copied to clipboard
val ecefExternalAcceleration: AccelerationTriad?

Estimated external acceleration applied on the device expressed in ECEF coordinates respect to Earth.

Link copied to clipboard

Euler angles associated to estimated NED attitude. Array contains roll, pitch and yaw angles expressed in radians (rad) and following order indicated here. This is only available if computeCovariances and computeEulerAngles are true.

Link copied to clipboard

Error covariance of estimated Euler angles for NED attitude. This is only available if computeCovariances and computeEulerAnglesCovariance are true.

Link copied to clipboard
Link copied to clipboard

Gets expected gravity norm at current location. If no location is available, average gravity at sea level is returned instead.

Link copied to clipboard
Link copied to clipboard

Gets or sets current device location.

Link copied to clipboard

Obtains magnetic field declination of local NED reference system expressed in radians if World Magnetic Model is used, otherwise zero is returned. Magnetic field declination indicates how much deviation the heading angle has between the magnetic north pole and the true geographic north pole.

Link copied to clipboard

Returns magnetic field dip angle of local NED reference system expressed in radians if World Magnetic Model is used, otherwise zero is returned. Magnetic field dip angle indicates how much the magnetic field points towards Earth's center. At magnetic equator dip angle is zero, at Norm magnetic pole is +90º, and at South magnetic pole is -90º. At the north hemisphere dip angle is positive (magnetic field points downwards), indicating the vertical deviation of magnetic field respect local Earth surface at a given position (latitude, longitude and height). At the south hemisphere dip angle is negative (magnetic field points upwards), indicating the vertical deviation of magnetic field respect local Earth surface at a given position (latitude, longitude and height).

Link copied to clipboard
val nedAttitude: Quaternion

Estimated device attitude expressed in leveled local NED coordinates respect to Earth.

Link copied to clipboard

Error covariance of estimated quaternion attitude expressed in NED coordinates. This is only available if computeCovariances is true.

Link copied to clipboard
val nedExternalAcceleration: AccelerationTriad?

Estimated external acceleration applied on the device expressed in leveled local NED coordinates respect to Earth.

Link copied to clipboard

Time interval between measurements expressed in seconds (s).

Link copied to clipboard

Indicates whether world magnetic model is taken into account magnetic field dip and declination angles, so that orientation pointing to the true north is estimated.

Link copied to clipboard
var worldMagneticModel: WorldMagneticModel?

Earth's magnetic model. If null, the default model is used if useWorldMagneticModel is true. If useWorldMagneticModel is false, this is ignored.

Functions

Link copied to clipboard
fun getAccelerometerBias(result: AccelerationTriad)

Gets estimated accelerometer bias.

Link copied to clipboard
fun getGyroscopeBias(result: AngularSpeedTriad)

Gets estimated gyroscope bias.

Link copied to clipboard

Processes provided synced accelerometer, gyroscope and magnetometer measurement to obtain a relative leveled attitude.

fun process(accelerometerMeasurement: AccelerometerSensorMeasurement, gyroscopeMeasurement: GyroscopeSensorMeasurement, magnetometerMeasurement: MagnetometerSensorMeasurement, timestamp: Long = gyroscopeMeasurement.timestamp): Boolean

Processes provided accelerometer, gyroscope and magnetometer measurements at provided timestamp to obtain a relative leveled attitude.

Link copied to clipboard
fun reset()

Resets internal parameter.