Class LinearMixedPositionEstimator<P extends com.irurueta.geometry.Point<P>>

Type Parameters:
P - a Point type.
Direct Known Subclasses:
LinearMixedPositionEstimator2D, LinearMixedPositionEstimator3D

public abstract class LinearMixedPositionEstimator<P extends com.irurueta.geometry.Point<P>> extends MixedPositionEstimator<P>
Linearly estimates position using located radio sources and any kind of readings at unknown locations. These kind of estimators can be used to determine the position of a given device by getting any kind of readings at an unknown location of different radio sources whose locations are known.
  • Field Details

    • 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 position.
      See Also:
    • homogeneousTrilaterationSolver

      protected com.irurueta.navigation.lateration.HomogeneousLinearLeastSquaresLaterationSolver<P extends com.irurueta.geometry.Point<P>> homogeneousTrilaterationSolver
      An homogeneous linear lateration solver to solve position.
    • inhomogeneousTrilaterationSolver

      protected com.irurueta.navigation.lateration.InhomogeneousLinearLeastSquaresLaterationSolver<P extends com.irurueta.geometry.Point<P>> inhomogeneousTrilaterationSolver
      An inhomogeneous linear lateration solver to solve position.
    • laterationSolverListener

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

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

    • LinearMixedPositionEstimator

      protected LinearMixedPositionEstimator()
      Constructor.
    • LinearMixedPositionEstimator

      protected LinearMixedPositionEstimator(MixedPositionEstimatorListener<P> listener)
      Constructor.
      Parameters:
      listener - listener in charge of handling events.
  • Method Details

    • isHomogeneousLinearSolverUsed

      public boolean isHomogeneousLinearSolverUsed()
      Indicates whether an homogeneous linear solver is used to estimate 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 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.
    • 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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      Returns:
      true if estimator is locked, false otherwise.
    • estimate

      public void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, PositionEstimationException
      Estimates position based on provided located radio sources and RSSI readings of such radio sources at an unknown location.
      Specified by:
      estimate in class PositionEstimator<P extends com.irurueta.geometry.Point<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      Returns:
      Euclidean distances used internally.
    • 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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      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 Reading<? 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<P>,Reading<? extends RadioSource>,MixedPositionEstimatorListener<P extends com.irurueta.geometry.Point<P>>>
      Parameters:
      fingerprint - fingerprint containing readings at an unknown location for provided located radio sources.
      Throws:
      IllegalArgumentException - if provided value is null.
    • setPositionsAndDistances

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

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

      private void buildPositionsAndDistances()
      Builds positions and distances for the internal lateration solver.