Class RangingRadioSourceEstimator<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>

java.lang.Object
com.irurueta.navigation.indoor.radiosource.RadioSourceEstimator<P,RangingReadingLocated<S,P>,RangingRadioSourceEstimatorListener<S,P>>
com.irurueta.navigation.indoor.radiosource.RangingRadioSourceEstimator<S,P>
Direct Known Subclasses:
RangingRadioSourceEstimator2D, RangingRadioSourceEstimator3D

public abstract class RangingRadioSourceEstimator<S extends RadioSource,P extends com.irurueta.geometry.Point<P>> extends RadioSourceEstimator<P,RangingReadingLocated<S,P>,RangingRadioSourceEstimatorListener<S,P>>
Estimates position of a radio source (e.g. Wi-Fi access point or bluetooth beacon) by using ranging measurements. Ranging measurements can be obtained by protocols such as ieee 802.11mc (Wi-Fi RTT) which measures travel time of signal and converts the result into distances by taking into account the speed of light as the propagation speed.
  • Field Details

    • DEFAULT_USE_READING_POSITION_COVARIANCES

      public static final boolean DEFAULT_USE_READING_POSITION_COVARIANCES
      Indicates that by default position covariances of readings must be taken into account to increase the amount of standard deviation of each ranging measure by the amount of position standard deviation assuming that both measures are statistically independent.
      See Also:
    • DEFAULT_USE_HOMOGENEOUS_LINEAR_SOLVER

      public static final boolean DEFAULT_USE_HOMOGENEOUS_LINEAR_SOLVER
      Indicates that by default an homogeneous linear solver is used to estimate an initial position.
      See Also:
    • homogeneousLinearSolver

      protected com.irurueta.navigation.lateration.HomogeneousLinearLeastSquaresLaterationSolver<P extends com.irurueta.geometry.Point<P>> homogeneousLinearSolver
      Internal homogeneous linear solver to find radio source position when no initial position is provided.
    • inhomogeneousLinearSolver

      protected com.irurueta.navigation.lateration.InhomogeneousLinearLeastSquaresLaterationSolver<P extends com.irurueta.geometry.Point<P>> inhomogeneousLinearSolver
      Internal inhomogeneous linear solver to find radio source position when no initial position is provided.
    • nonLinearSolver

      protected com.irurueta.navigation.lateration.NonLinearLeastSquaresLaterationSolver<P extends com.irurueta.geometry.Point<P>> nonLinearSolver
      Internal non-linear solver to estimate radio source position and covariance for an initial provided or estimated position.
    • accuracy

      protected com.irurueta.geometry.Accuracy accuracy
      Contains accuracy of a reading position. This is used internally to compute additional distance standard deviation due to position accuracy.
    • initialPosition

      protected P extends com.irurueta.geometry.Point<P> initialPosition
      Initial position to start the estimation of radio source position.
    • nonLinearSolverEnabled

      protected boolean nonLinearSolverEnabled
      Indicates whether non-linear solver is enabled. If disabled a linear solver is always used, initial position ignored and covariance is not computed.
    • useHomogeneousLinearSolver

      protected boolean useHomogeneousLinearSolver
      Indicates whether an homogeneous linear solver is used to estimate an initial position.
    • useReadingPositionCovariances

      protected boolean useReadingPositionCovariances
      Indicates whether position covariances of readings must be taken into account to increase the amount of standard deviation of each ranging measure by the amount of position standard deviation assuming that both measures are statistically independent.
  • Constructor Details

    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator()
      Constructor.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(List<? extends RangingReadingLocated<S,P>> readings)
      Constructor. Sets radio signal ranging readings belonging to the same radio source.
      Parameters:
      readings - radio signal ranging readings belonging to the same radio source.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(RangingRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      listener - listener in charge of attending events raised by this instance.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(List<? extends RangingReadingLocated<S,P>> readings, RangingRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets radio signal readings belonging to the same radio source.
      Parameters:
      readings - radio signal readings belonging to the same radio source.
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(P initialPosition)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation or radio source position.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(List<? extends RangingReadingLocated<S,P>> readings, P initialPosition)
      Constructor. Sets radio signal readings belonging to the same radio source.
      Parameters:
      readings - radio signal readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      Throws:
      IllegalArgumentException - if readings are not valid.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(P initialPosition, RangingRadioSourceEstimatorListener<S,P> listener)
      Constructor.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position.
      listener - listener in charge of attending events raised by this instance.
    • RangingRadioSourceEstimator

      protected RangingRadioSourceEstimator(List<? extends RangingReadingLocated<S,P>> readings, P initialPosition, RangingRadioSourceEstimatorListener<S,P> listener)
      Constructor. Sets radio signal ranging readings belonging to the same radio source.
      Parameters:
      readings - radio signal ranging readings belonging to the same radio source.
      initialPosition - initial position to start the estimation of radio source position.
      listener - listener in charge of attending events raised by this instance.
      Throws:
      IllegalArgumentException - if readings are not valid.
  • Method Details

    • getInitialPosition

      public P getInitialPosition()
      Gets initial position to start the non-linear estimation of radio source position. If not defined, a linear solution is found instead.
      Returns:
      initial position.
    • setInitialPosition

      public void setInitialPosition(P initialPosition) throws com.irurueta.navigation.LockedException
      Sets initial position to start the non-linear estimation of radio source position. If not defined, a linear solution is found instead.
      Parameters:
      initialPosition - initial position to start the estimation of radio source position or null.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isNonLinearSolverEnabled

      public boolean isNonLinearSolverEnabled()
      Indicates whether non-linear solver is enabled. If disabled a linear solver is always used, initial position ignored and covariance is not computed.
      Returns:
      true if non-linear solver is enabled, false otherwise.
    • setNonLinearSolverEnabled

      public void setNonLinearSolverEnabled(boolean nonLinearSolverEnabled) throws com.irurueta.navigation.LockedException
      Specifies whether non-linear solver is enabled. If disabled a linear solver is always used, initial position ignored and covariance is not computed.
      Parameters:
      nonLinearSolverEnabled - true if non-linear solver is enabled, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isHomogeneousLinearSolverUsed

      public boolean isHomogeneousLinearSolverUsed()
      Indicates whether an homogeneous linear solver is used to estimate an initial position.
      Returns:
      true if homogeneous linear solver is used, false if an inhomogeneous linear one is used instead.
    • setHomogeneousLinearSolverUsed

      public void setHomogeneousLinearSolverUsed(boolean useHomogeneousLinearSolver) throws com.irurueta.navigation.LockedException
      Specifies whether an homogeneous linear solver is used to estimate an initial position.
      Parameters:
      useHomogeneousLinearSolver - true if homogeneous linear solver is used, false if an inhomogeneous linear one is used instead.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • getUseReadingPositionCovariance

      public boolean getUseReadingPositionCovariance()
      Indicates whether position covariances of readings must be taken into account to increase the amount of standard deviation of each ranging measure by the amount of position standard deviation assuming that both measures are statistically independent.
      Returns:
      true to take into account reading position covariances, false otherwise.
    • setUseReadingPositionCovariances

      public void setUseReadingPositionCovariances(boolean useReadingPositionCovariances) throws com.irurueta.navigation.LockedException
      Specifies whether position covariances of readings must be taken into account to increase the amount of standard deviation of each ranging measure by the amount of position standard deviation assuming that both measures are statistically independent.
      Parameters:
      useReadingPositionCovariances - true to take into account reading position covariances, false otherwise.
      Throws:
      com.irurueta.navigation.LockedException - if estimator is locked.
    • isReady

      public boolean isReady()
      Indicates whether this instance is ready to start the estimation.
      Specified by:
      isReady in class RadioSourceEstimator<P extends com.irurueta.geometry.Point<P>,RangingReadingLocated<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>,RangingRadioSourceEstimatorListener<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>>
      Returns:
      true if this instance is ready, false otherwise.
    • estimate

      public void estimate() throws RadioSourceEstimationException, com.irurueta.navigation.NotReadyException, com.irurueta.navigation.LockedException
      Estimate position of radio source.
      Specified by:
      estimate in class RadioSourceEstimator<P extends com.irurueta.geometry.Point<P>,RangingReadingLocated<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>,RangingRadioSourceEstimatorListener<S extends RadioSource,P extends com.irurueta.geometry.Point<P>>>
      Throws:
      RadioSourceEstimationException - if estimation fails.
      com.irurueta.navigation.NotReadyException - if estimator is not ready.
      com.irurueta.navigation.LockedException - if estimator is locked.
    • buildLinearSolverIfNeeded

      protected abstract void buildLinearSolverIfNeeded()
      Builds an instance of a linear lateration solver if needed.
    • buildNonLinearSolverIfNeeded

      protected abstract void buildNonLinearSolverIfNeeded()
      Builds an instance of a non-linear lateration solver if needed.
    • buildAccuracyIfNeeded

      protected abstract void buildAccuracyIfNeeded()
      Build an instance of accuracy if needed.
    • setPositionsDistancesAndDistanceStandardDeviations

      protected abstract void setPositionsDistancesAndDistanceStandardDeviations(List<P> positions, List<Double> distances, List<Double> distanceStandardDeviations) throws com.irurueta.navigation.LockedException
      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 or null.
      Throws:
      com.irurueta.navigation.LockedException - if solvers are locked.
    • buildSolversIfNeeded

      private void buildSolversIfNeeded()
      Build instances of lateration solvers if needed.
    • buildPositionsDistancesAndDistanceStandardDeviations

      private void buildPositionsDistancesAndDistanceStandardDeviations() throws com.irurueta.navigation.LockedException
      Builds positions, distances and standard deviations of distances for the internal lateration solver.
      Throws:
      com.irurueta.navigation.LockedException - if solvers are locked.