LocalPoseEstimator2

class LocalPoseEstimator2(val context: Context, initialLocation: Location, initialVelocity: NEDVelocity = NEDVelocity(), val sensorDelay: SensorDelay = SensorDelay.FASTEST, val useAttitudeSensor: Boolean = true, val useAccelerometerForAttitudeEstimation: Boolean = false, val startOffsetEnabled: Boolean = true, val accelerometerSensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, val magnetometerSensorType: MagnetometerSensorType = MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, val accelerometerAveragingFilter: AveragingFilter = LowPassAveragingFilter(), val gyroscopeSensorType: GyroscopeSensorType = GyroscopeSensorType.GYROSCOPE_UNCALIBRATED, worldMagneticModel: WorldMagneticModel? = null, timestamp: Date? = null, useWorldMagneticModel: Boolean = false, useAccurateLevelingProcessor: Boolean = true, useAccurateRelativeGyroscopeAttitudeProcessor: Boolean = true, val useDoubleFusedAttitudeProcessor: Boolean = true, estimatePoseTransformation: Boolean = false, var poseAvailableListener: LocalPoseEstimator2.OnPoseAvailableListener? = null, var accuracyChangedListener: LocalPoseEstimator2.OnAccuracyChangedListener? = null, var bufferFilledListener: LocalPoseEstimator2.OnBufferFilledListener? = null, adjustGravityNorm: Boolean = true)

Estimates pose with 6DOF (Degrees of Freedom) containing absolute attitude and position using local plane navigation.

Parameters

initialLocation

initial device location.

initialVelocity

initial velocity of device expressed in NED coordinates.

worldMagneticModel

Earth's magnetic model. Null to use default model when useWorldMagneticModel is true. If useWorldMagneticModel is false, this is ignored. This is ignored if useAttitudeSensor is true.

timestamp

Timestamp when World Magnetic Model will be evaluated to obtain current. Only taken into account if useWorldMagneticModel is tue. This is ignored if useAttitudeSensor is true.

useWorldMagneticModel

true so that world magnetic model is taken into account to adjust attitude yaw angle by current magnetic declination based on current World Magnetic Model, location and timestamp, false to ignore declination. This is ignored if useAttitudeSensor is true.

useAccurateLevelingProcessor

true to use accurate leveling, false to use a normal one. This is ignored if useAttitudeSensor is true.

estimatePoseTransformation

true to estimate 3D metric pose transformation, false to skip transformation computation.

Constructors

Link copied to clipboard
constructor(context: Context, initialLocation: Location, initialVelocity: NEDVelocity = NEDVelocity(), sensorDelay: SensorDelay = SensorDelay.FASTEST, useAttitudeSensor: Boolean = true, useAccelerometerForAttitudeEstimation: Boolean = false, startOffsetEnabled: Boolean = true, accelerometerSensorType: AccelerometerSensorType = AccelerometerSensorType.ACCELEROMETER_UNCALIBRATED, magnetometerSensorType: MagnetometerSensorType = MagnetometerSensorType.MAGNETOMETER_UNCALIBRATED, accelerometerAveragingFilter: AveragingFilter = LowPassAveragingFilter(), gyroscopeSensorType: GyroscopeSensorType = GyroscopeSensorType.GYROSCOPE_UNCALIBRATED, worldMagneticModel: WorldMagneticModel? = null, timestamp: Date? = null, useWorldMagneticModel: Boolean = false, useAccurateLevelingProcessor: Boolean = true, useAccurateRelativeGyroscopeAttitudeProcessor: Boolean = true, useDoubleFusedAttitudeProcessor: Boolean = true, estimatePoseTransformation: Boolean = false, poseAvailableListener: LocalPoseEstimator2.OnPoseAvailableListener? = null, accuracyChangedListener: LocalPoseEstimator2.OnAccuracyChangedListener? = null, bufferFilledListener: LocalPoseEstimator2.OnBufferFilledListener? = null, adjustGravityNorm: Boolean = true)

Types

Link copied to clipboard

Interface to notify when sensor (either accelerometer, gravity or magnetometer) accuracy changes.

Link copied to clipboard

Interface to notify when a buffer gets completely filled. When buffers get filled, internal collectors will continue collection at the expense of loosing old data. Consumers of this listener should device what to do at this point (which might require stopping this estimator)..

Link copied to clipboard

Interface to notify when a new pose is available.

Properties

Link copied to clipboard

an averaging filter for accelerometer samples to obtain sensed gravity component of specific force. This is ignored if useAttitudeSensor is true.

Link copied to clipboard

One of the supported accelerometer sensor types. It is suggested to avoid using non-calibrated accelerometers.

Link copied to clipboard

listener to notify changes in accuracy.

Link copied to clipboard

Indicates whether gravity norm must be adjusted to either Earth standard norm, or norm at provided location. If no location is provided, this should only be enabled when device is close to sea level.

Link copied to clipboard

Factor to take into account when interpolation value is computed and useIndirectAttitudeInterpolation is enabled to determine actual interpolation value based on current relative attitude rotation velocity.

Link copied to clipboard

Interpolation value to be used to combine both leveling and relative attitudes. Must be between 0.0 and 1.0 (both included). The closer to 0.0 this value is, the more resemblance the result will have to a pure leveling (which feels more jerky). On the contrary, the closer to 1.0 this value is, the more resemblance the result will have to a pure non-leveled relative attitude (which feels softer but might have arbitrary roll and pitch Euler angles).

Link copied to clipboard

Threshold to determine that geomagnetic attitude has largely diverged and if situation is not reverted soon, attitude will be reset to geomagnetic one.

Link copied to clipboard

Threshold to determine that current geomagnetic attitude appears to be an outlier respect to estimated fused attitude. When geomagnetic attitude and fused attitudes diverge, fusion is not performed, and instead only gyroscope relative attitude is used for fusion estimation.

Link copied to clipboard

Threshold to determine when fused attitude has largely diverged for a given number of samples and must be reset.

Link copied to clipboard

listener to notify that some buffer has been filled. This usually happens when consumer of measurements cannot keep up with the rate at which measurements are generated.

Link copied to clipboard

Android context.

Link copied to clipboard

True to estimate 3D metric pose transformation, false otherwise.

Link copied to clipboard

One of the supported gyroscope sensor types. It is suggested to avoid using non-calibrated gyroscopes.

Link copied to clipboard

Gets initial device location.

Link copied to clipboard
val initialVelocity: NEDVelocity

Gets initial device velocity.

Link copied to clipboard

One of the supported magnetometer sensor types. This is ignored if useAttitudeSensor is true.

Link copied to clipboard

notifies when a new estimated pose is available.

Link copied to clipboard

Indicates whether this estimator is running or not.

Link copied to clipboard

Delay of sensors between samples.

Link copied to clipboard

indicates whether start offsets will be computed when first measurement is received or not. True indicates that offset is computed, false assumes that offset is null.

Link copied to clipboard

Time interval expressed in seconds between consecutive measurements

Link copied to clipboard

Timestamp being used when World Magnetic Model is evaluated to obtain current magnetic declination. This is only taken into account if useWorldMagneticModel is true. If not defined, current date is assumed.

Link copied to clipboard

true to use accelerometer sensor for attitude estimation, false to use system gravity sensor for leveling purposes. Regardless of this values, pose estimator always uses the accelerometer sensor, however, it can be used both for leveling and device motion, or only for device motion. This is ignored if useAttitudeSensor is true.

Link copied to clipboard

Indicates whether accurate leveling must be used or not.

Indicates whether accurate non-leveled relative attitude processor must be used or not.

Link copied to clipboard

true to use Android system attitude sensor, false to fuse accelerometer/gravity + gyroscope + magnetometer sensors to estimate attitude.

Link copied to clipboard

true to use double fused absolute attitude estimator, false otherwise. This is ignored if useAttitudeSensor is true.

Link copied to clipboard

Indicates whether fusion between leveling and relative attitudes occurs based on changing interpolation value that depends on actual relative attitude rotation velocity.

Link copied to clipboard

True indicates that attitude is leveled and expressed respect to estimator start. False indicates that attitude is absolute.

Link copied to clipboard

Indicates whether world magnetic model is taken into account to adjust attitude yaw angle by current magnetic declination based on current World Magnetic Model, location and timestamp. If null, the default model is used if useWorldMagneticModel is true. If useWorldMagneticModel is false, this is ignored.

Link copied to clipboard
var worldMagneticModel: WorldMagneticModel?

Indicates whether world magnetic model is taken into account to adjust attitude yaw angle by current magnetic declination based on current World Magnetic Model, location and timestamp. If null, the default model is used if useWorldMagneticModel is true. If useWorldMagneticModel is false, this is ignored.

Functions

Link copied to clipboard
fun start(startTimestamp: Long = SystemClock.elapsedRealtimeNanos()): Boolean

Starts this estimator.

Link copied to clipboard
fun stop()

Stops this estimator.