Class NonLinearRssiPositionEstimator<P extends com.irurueta.geometry.Point<?>>

Type Parameters:
P - a Point type.
Direct Known Subclasses:
NonLinearRssiPositionEstimator2D, NonLinearRssiPositionEstimator3D

public abstract class NonLinearRssiPositionEstimator<P extends com.irurueta.geometry.Point<?>> extends RssiPositionEstimator<P>
Estimates position non-linearly using located radio sources and their RSSI readings at unknown locations. These kind of estimators can be used to determine the position of a given device by getting RSSI readings at an unknown location of different radio sources whose locations are known.
  • Field Details

    • FALLBACK_DISTANCE_STANDARD_DEVIATION

      public static final double FALLBACK_DISTANCE_STANDARD_DEVIATION
      Distance standard deviation assumed for provided distances as a fallback when none can be determined.
      See Also:
    • trilaterationSolver

      protected com.irurueta.navigation.lateration.NonLinearLeastSquaresLaterationSolver<P extends com.irurueta.geometry.Point<?>> trilaterationSolver
      A non-linear lateration solver to solve position.
    • laterationSolverListener

      protected com.irurueta.navigation.lateration.LaterationSolverListener<P extends com.irurueta.geometry.Point<?>> laterationSolverListener
      Listener for the lateration solver.
    • initialPosition

      private P extends com.irurueta.geometry.Point<?> initialPosition
      Initial position to start position estimation. If not defined, centroid of provided located sources will be used.
    • useRadioSourcePositionCovariance

      private boolean useRadioSourcePositionCovariance
      Indicates whether located radio source position covariance must be taken into account (if available) to determine distance standard deviation.
    • fallbackDistanceStandardDeviation

      private double fallbackDistanceStandardDeviation
      Distance standard deviation fallback value to use when none can be determined from provided radio sources and fingerprint readings.
  • Constructor Details

    • NonLinearRssiPositionEstimator

      protected NonLinearRssiPositionEstimator()
      Constructor.
    • NonLinearRssiPositionEstimator

      protected NonLinearRssiPositionEstimator(RssiPositionEstimatorListener<P> listener)
      Constructor.
      Parameters:
      listener - listener in charge of handling events.
    • NonLinearRssiPositionEstimator

      protected NonLinearRssiPositionEstimator(P initialPosition)
      Constructor.
      Parameters:
      initialPosition - initial position to start position estimation.
    • NonLinearRssiPositionEstimator

      protected NonLinearRssiPositionEstimator(P initialPosition, RssiPositionEstimatorListener<P> listener)
      Constructor.
      Parameters:
      initialPosition - initial position to start position estimation.
      listener - listener in charge of handling events.
  • Method Details

    • getInitialPosition

      public P getInitialPosition()
      Gets initial position to start position estimation. If not defined, centroid of located sources position will be used to start the estimation.
      Returns:
      initial position to start position estimation.
    • setInitialPosition

      public void setInitialPosition(P initialPosition) throws com.irurueta.navigation.LockedException
      Sets initial position to start position estimation. If not defined, centroid of located sources position will be used to start the estimation.
      Parameters:
      initialPosition - initial position to start position estimation.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isRadioSourcePositionCovarianceUsed

      public boolean isRadioSourcePositionCovarianceUsed()
      Indicates whether located radio source position covariance must be taken into account (if available) to determine distance standard deviation.
      Returns:
      true to take radio source position covariance into account, false otherwise.
    • setRadioSourcePositionCovarianceUsed

      public void setRadioSourcePositionCovarianceUsed(boolean useRadioSourcePositionCovariance) throws com.irurueta.navigation.LockedException
      Specifies whether located radio source position covariance must be taken into account (if available) to determine distance standard deviation.
      Parameters:
      useRadioSourcePositionCovariance - true to take radio source position covariance into account, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • getFallbackDistanceStandardDeviation

      public double getFallbackDistanceStandardDeviation()
      Gets distance standard deviation fallback value to use when none can be determined from provided radio sources and fingerprint readings.
      Returns:
      distance standard deviation to use as fallback.
    • setFallbackDistanceStandardDeviation

      public void setFallbackDistanceStandardDeviation(double fallbackDistanceStandardDeviation) throws com.irurueta.navigation.LockedException
      Sets distance standard deviation fallback value to use when none can be determined from provided radio sources and fingerprint readings.
      Parameters:
      fallbackDistanceStandardDeviation - distance standard deviation to use as fallback.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • getMinRequiredSources

      public int getMinRequiredSources()
      Gets minimum required number of located radio sources to perform lateration.
      Specified by:
      getMinRequiredSources in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Returns:
      minimum required number of located radio sources to perform lateration.
    • isReady

      public boolean isReady()
      Indicates whether estimator is ready to find a solution.
      Specified by:
      isReady in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Returns:
      true if estimator is ready, false otherwise.
    • isLocked

      public boolean isLocked()
      Returns boolean indicating whether this estimator is locked because an estimation is already in progress.
      Specified by:
      isLocked in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Returns:
      true if estimator is locked, false otherwise.
    • getDistanceStandardDeviations

      public double[] getDistanceStandardDeviations()
      Gets standard deviations of distances from known located radio sources to the location of provided readings in a fingerprint. Distance standard deviations are used internally to solve lateration.
      Returns:
      standard deviations used internally.
    • estimate

      public void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, PositionEstimationException
      Estimates position based on provided located radio sources and readings of such radio sources at an unknown location.
      Specified by:
      estimate in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
      com.irurueta.navigation.NotReadyException - if estimator is not ready.
      PositionEstimationException - if estimation fails for some other reason.
    • getPositions

      public P[] getPositions()
      Gets known positions of radio sources used internally to solve lateration.
      Specified by:
      getPositions in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Returns:
      known positions used internally.
    • getDistances

      public double[] getDistances()
      Gets Euclidean distances from known located radio sources to the location of provided readings in a fingerprint. Distance values are used internally to solve lateration.
      Specified by:
      getDistances in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Returns:
      Euclidean distances used internally.
    • getCovariance

      public com.irurueta.algebra.Matrix getCovariance()
      Gets estimated covariance matrix for estimated position.
      Returns:
      estimated covariance matrix for estimated position.
    • internalSetSources

      protected void internalSetSources(List<? extends RadioSourceLocated<P>> sources)
      Internally sets located radio sources used for lateration.
      Overrides:
      internalSetSources in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Parameters:
      sources - located radio sources used for lateration.
      Throws:
      IllegalArgumentException - if provided value is null or the number of provided sources is less than the required minimum.
    • internalSetFingerprint

      protected void internalSetFingerprint(Fingerprint<? extends RadioSource,? extends RssiReading<? extends RadioSource>> fingerprint)
      Internally sets fingerprint containing readings at an unknown location for provided located radio sources.
      Overrides:
      internalSetFingerprint in class PositionEstimator<P extends com.irurueta.geometry.Point<?>,RssiReading<? extends RadioSource>,RssiPositionEstimatorListener<P extends com.irurueta.geometry.Point<?>>>
      Parameters:
      fingerprint - fingerprint containing readings at an unknown location for provided located radio sources.
      Throws:
      IllegalArgumentException - if provided value is null.
    • setPositionsDistancesAndDistanceStandardDeviations

      protected abstract void setPositionsDistancesAndDistanceStandardDeviations(List<P> positions, List<Double> distances, List<Double> distanceStandardDeviations)
      Sets positions, distances and standard deviations of distances on internal lateration solver.
      Parameters:
      positions - positions to be set.
      distances - distances to be set.
      distanceStandardDeviations - standard deviations of distances to be set.
    • init

      private void init()
      Initializes lateration solver listener.
    • buildPositionsDistancesAndDistanceStandardDeviations

      private void buildPositionsDistancesAndDistanceStandardDeviations()
      Builds positions, distances and standard deviation of distances for the internal lateration solver.