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:
  • Field Details

    • orientationTimestampNanos

      protected long orientationTimestampNanos
      Timestamp expressed in nanoseconds since the epoch time of the last sample containing absolute orientation.
    • accumulatedOrientationSamples

      protected int accumulatedOrientationSamples
      Number of orientation samples accumulated since last full sample.
    • accumulatedOrientation

      protected com.irurueta.geometry.Quaternion accumulatedOrientation
      Average orientation accumulated since last full sample.
    • tempQ

      private com.irurueta.geometry.Quaternion tempQ
      Temporary 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:
      isFullSampleAvailable in class BaseSlamEstimator<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:
      getMostRecentTimestampNanos in class BaseSlamEstimator<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:
      notifyFullSampleAndResetSampleReceive in class BaseSlamEstimator<D extends BaseCalibrationData>