Package com.irurueta.ar.slam
Class AbsoluteOrientationBaseSlamEstimator<D extends BaseCalibrationData>
java.lang.Object
com.irurueta.ar.slam.BaseSlamEstimator<D>
com.irurueta.ar.slam.AbsoluteOrientationBaseSlamEstimator<D>
- Type Parameters:
D- calibrator type associated to implementations of SLAM calibration data.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbsoluteOrientationConstantVelocityModelSlamEstimator,AbsoluteOrientationSlamEstimator
public abstract class AbsoluteOrientationBaseSlamEstimator<D extends BaseCalibrationData>
extends BaseSlamEstimator<D>
implements Serializable
Base class to estimate position, velocity, acceleration and orientation of
a device using sensor data such as accelerometers, gyroscopes and magnetic
fields (to obtain absolute orientation).
Implementations of this class are designed taking into account sensors
available on Android devices.
This subclass of BaseSlamEstimator takes into account magnetic field measures
to compute device orientation respect Earth's frame rather than relative to
the start position and orientation of the device.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.irurueta.ar.slam.BaseSlamEstimator
BaseSlamEstimator.BaseSlamEstimatorListener<D extends BaseCalibrationData> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.irurueta.geometry.QuaternionAverage orientation accumulated since last full sample.protected intNumber of orientation samples accumulated since last full sample.protected longTimestamp expressed in nanoseconds since the epoch time of the last sample containing absolute orientation.private com.irurueta.geometry.QuaternionTemporary quaternion.Fields inherited from class com.irurueta.ar.slam.BaseSlamEstimator
accelerometerTimestampNanos, accumulatedAccelerationSampleX, accumulatedAccelerationSampleY, accumulatedAccelerationSampleZ, accumulatedAccelerometerSamples, accumulatedAngularSpeedSampleX, accumulatedAngularSpeedSampleY, accumulatedAngularSpeedSampleZ, accumulatedGyroscopeSamples, accumulationEnabled, calibrationData, DEFAULT_ENABLE_SAMPLE_ACCUMULATION, error, gyroscopeTimestampNanos, listener, N_COMPONENTS_3D, NANOS_TO_SECONDS, normalDist, stateAccelerationX, stateAccelerationY, stateAccelerationZ, stateAngularSpeedX, stateAngularSpeedY, stateAngularSpeedZ, statePositionX, statePositionY, statePositionZ, stateQuaternionA, stateQuaternionB, stateQuaternionC, stateQuaternionD, stateVelocityX, stateVelocityY, stateVelocityZ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.geometry.Rotation3DGets average orientation accumulated since last full sample.voidgetAccumulatedOrientation(com.irurueta.geometry.Rotation3D result) Gets average orientation accumulated since last full sample.intGets number of orientation samples accumulated since last full sample.longGets most recent timestamp of received partial samples (accelerometer, gyroscope or magnetic field).longGets timestamp expressed in nanoseconds since the epoch time of the last orientation sample, or -1 if no sample has been set yet.booleanIndicates whether a full sample (accelerometer + gyroscope + magnetic field) has been received or not.booleanIndicates whether the orientation sample has been received since last full sample (accelerometer + gyroscope + orientation).protected voidNotifies that a full sample has been received and resets flags indicating whether partial samples have been received.voidupdateOrientationSample(long timestamp, com.irurueta.geometry.Rotation3D orientation) Provides a new orientation sample.Methods inherited from class com.irurueta.ar.slam.BaseSlamEstimator
correctWithPositionMeasure, correctWithPositionMeasure, correctWithPositionMeasure, correctWithPositionMeasure, correctWithPositionMeasure, correctWithPositionMeasure, getAccelerometerTimestampNanos, getAccumulatedAccelerationSample, getAccumulatedAccelerationSample, getAccumulatedAccelerationSampleX, getAccumulatedAccelerationSampleY, getAccumulatedAccelerationSampleZ, getAccumulatedAccelerometerSamples, getAccumulatedAngularSpeedSample, getAccumulatedAngularSpeedSample, getAccumulatedAngularSpeedSampleX, getAccumulatedAngularSpeedSampleY, getAccumulatedAngularSpeedSampleZ, getAccumulatedGyroscopeSamples, getCalibrationData, getGyroscopeTimestampNanos, getListener, getPositionCovarianceMatrix, getStateAcceleration, getStateAcceleration, getStateAccelerationX, getStateAccelerationY, getStateAccelerationZ, getStateAngularSpeed, getStateAngularSpeed, getStateAngularSpeedX, getStateAngularSpeedY, getStateAngularSpeedZ, getStateCovariance, getStatePosition, getStatePosition, getStatePositionX, getStatePositionY, getStatePositionZ, getStateQuaternion, getStateQuaternion, getStateQuaternionA, getStateQuaternionArray, getStateQuaternionArray, getStateQuaternionB, getStateQuaternionC, getStateQuaternionD, getStateVelocity, getStateVelocity, getStateVelocityX, getStateVelocityY, getStateVelocityZ, hasError, isAccelerometerSampleReceived, isAccumulationEnabled, isGyroscopeSampleReceived, processFullSample, reset, reset, resetAcceleration, resetAngularSpeed, resetOrientation, resetPosition, resetPositionAndVelocity, resetVelocity, setAccumulationEnabled, setCalibrationData, setListener, setPositionCovarianceMatrix, updateAccelerometerSample, updateAccelerometerSample, updateGyroscopeSample, updateGyroscopeSample
-
Field Details
-
orientationTimestampNanos
protected long orientationTimestampNanosTimestamp expressed in nanoseconds since the epoch time of the last sample containing absolute orientation. -
accumulatedOrientationSamples
protected int accumulatedOrientationSamplesNumber of orientation samples accumulated since last full sample. -
accumulatedOrientation
protected com.irurueta.geometry.Quaternion accumulatedOrientationAverage orientation accumulated since last full sample. -
tempQ
private com.irurueta.geometry.Quaternion tempQTemporary quaternion. For memory reuse.
-
-
Constructor Details
-
AbsoluteOrientationBaseSlamEstimator
protected AbsoluteOrientationBaseSlamEstimator()Constructor.
-
-
Method Details
-
getOrientationTimestampNanos
public long getOrientationTimestampNanos()Gets timestamp expressed in nanoseconds since the epoch time of the last orientation sample, or -1 if no sample has been set yet.- Returns:
- timestamp expressed in nanoseconds since the epoch time of the last orientation sample, or -1.
-
getAccumulatedOrientation
public com.irurueta.geometry.Rotation3D getAccumulatedOrientation()Gets average orientation accumulated since last full sample.- Returns:
- orientation accumulated since last full sample.
-
getAccumulatedOrientation
public void getAccumulatedOrientation(com.irurueta.geometry.Rotation3D result) Gets average orientation accumulated since last full sample.- Parameters:
result- instance where orientation accumulated since last full sample will be stored.
-
getAccumulatedOrientationSamples
public int getAccumulatedOrientationSamples()Gets number of orientation samples accumulated since last full sample.- Returns:
- number of orientation samples accumulated since last full sample.
-
isOrientationSampleReceived
public boolean isOrientationSampleReceived()Indicates whether the orientation sample has been received since last full sample (accelerometer + gyroscope + orientation).- Returns:
- true if orientation sample has been received, false otherwise.
-
isFullSampleAvailable
public boolean isFullSampleAvailable()Indicates whether a full sample (accelerometer + gyroscope + magnetic field) has been received or not.- Overrides:
isFullSampleAvailablein classBaseSlamEstimator<D extends BaseCalibrationData>- Returns:
- true if full sample has been received, false otherwise.
-
updateOrientationSample
public void updateOrientationSample(long timestamp, com.irurueta.geometry.Rotation3D orientation) Provides a new orientation sample. If accumulation is enabled, samples are averaged until a full sample is received. When a full sample (accelerometer + gyroscope + orientation) is received, internal state gets also updated.- Parameters:
timestamp- timestamp of accelerometer sample since epoch time and expressed in nanoseconds.orientation- new orientation.
-
getMostRecentTimestampNanos
public long getMostRecentTimestampNanos()Gets most recent timestamp of received partial samples (accelerometer, gyroscope or magnetic field).- Overrides:
getMostRecentTimestampNanosin classBaseSlamEstimator<D extends BaseCalibrationData>- Returns:
- most recent timestamp of received partial sample.
-
notifyFullSampleAndResetSampleReceive
protected void notifyFullSampleAndResetSampleReceive()Notifies that a full sample has been received and resets flags indicating whether partial samples have been received.- Overrides:
notifyFullSampleAndResetSampleReceivein classBaseSlamEstimator<D extends BaseCalibrationData>
-