Class LMedSRobustLateration2DSolver

java.lang.Object
com.irurueta.navigation.lateration.RobustLaterationSolver<com.irurueta.geometry.Point2D>
com.irurueta.navigation.lateration.RobustLateration2DSolver
com.irurueta.navigation.lateration.LMedSRobustLateration2DSolver

public class LMedSRobustLateration2DSolver extends RobustLateration2DSolver
Robustly solves the lateration problem by finding the best pairs of 2D positions and distances among the provided ones using LMedS algorithm to discard outliers.
  • Field Details

    • DEFAULT_STOP_THRESHOLD

      public static final double DEFAULT_STOP_THRESHOLD
      Default value to be used for stop threshold. Stop threshold can be used to avoid keeping the algorithm unnecessarily iterating in case that best estimated threshold using median of residuals is not small enough. Once a solution is found that generates a threshold below this value, the algorithm will stop. The stop threshold can be used to prevent the LMedS algorithm iterating too many times in cases where samples have a very similar accuracy. For instance, in cases where proportion of outliers is very small (close to 0%), and samples are very accurate (i.e. 1e-6), the algorithm would iterate for a long time trying to find the best solution when indeed there is no need to do that if a reasonable threshold has already been reached. Because of this behaviour the stop threshold can be set to a value much lower than the one typically used in RANSAC, and yet the algorithm could still produce even smaller thresholds in estimated results.
      See Also:
    • MIN_STOP_THRESHOLD

      public static final double MIN_STOP_THRESHOLD
      Minimum allowed stop threshold value.
      See Also:
    • stopThreshold

      private double stopThreshold
      Threshold to be used to keep the algorithm iterating in case that best estimated threshold using median of residuals is not small enough. Once a solution is found that generates a threshold below this value, the algorithm will stop. The stop threshold can be used to prevent the LMedS algorithm iterating too many times in cases where samples have a very similar accuracy. For instance, in cases where proportion of outliers is very small (close to 0%), and samples are very accurate (i.e. 1e-6), the algorithm would iterate for a long time trying to find the best solution when indeed there is no need to do that if a reasonable threshold has already been reached. Because of this behaviour the stop threshold can be set to a value much lower than the one typically used in RANSAC, and yet the algorithm could still produce even smaller thresholds in estimated results.
  • Constructor Details

    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver()
      Constructor.
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(RobustLaterationSolverListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Point2D[] positions, double[] distances)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node to be estimated.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (3 points).
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Point2D[] positions, double[] distances, double[] distanceStandardDeviations)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node to be estimated.
      distanceStandardDeviations - standard deviations of provided measured distances.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (3 points).
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Point2D[] positions, double[] distances, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      distanceStandardDeviations - standard deviations of provided measured distances.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if either positions, distances or standard deviations are null, don't have the same length or their length is smaller than required (3 points).
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Point2D[] positions, double[] distances, RobustLaterationSolverListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if either positions or distances are null, don't have the same length or their length is smaller than required (3 points).
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Circle[] circles)
      Constructor.
      Parameters:
      circles - circles defining positions and distances.
      Throws:
      IllegalArgumentException - if circles is null or if length of circles array is less than required (3 points).
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Circle[] circles, double[] distanceStandardDeviations)
      Constructor.
      Parameters:
      circles - circles defining positions and distances.
      distanceStandardDeviations - standard deviations of provided measured distances.
      Throws:
      IllegalArgumentException - if circles is null, length of circles array is less than required (3 points) or don't have the same length.
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Circle[] circles, RobustLaterationSolverListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      circles - circles defining positions and distances.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if circles is null or if length of circles array is less than required (3 points).
    • LMedSRobustLateration2DSolver

      public LMedSRobustLateration2DSolver(com.irurueta.geometry.Circle[] circles, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point2D> listener)
      Constructor.
      Parameters:
      circles - circles defining positions and distances.
      distanceStandardDeviations - standard deviations of provided measured distances.
      listener - listener to be notified of events such as when estimation stats, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if circles is null, length of circles array is less than required (3 points) or don't have the same length.
  • Method Details

    • getStopThreshold

      public double getStopThreshold()
      Returns threshold to be used to keep the algorithm iterating in case that best estimated threshold using median of residuals is not small enough. Once a solution is found that generates a threshold below this value, the algorithm will stop. The stop threshold can be used to prevent the LMedS algorithm to iterate too many times in cases where samples have a very similar accuracy. For instance, in cases where proportion of outliers is very small (close to 0%), and samples are very accurate (i.e. 1e-6), the algorithm would iterate for a long time trying to find the best solution when indeed there is no need to do that if a reasonable threshold has already been reached. Because of this behaviour the stop threshold can be set to a value much lower than the one typically used in RANSAC, and yet the algorithm could still produce even smaller thresholds in estimated results.
      Returns:
      stop threshold to stop the algorithm prematurely when a certain accuracy has been reached.
    • setStopThreshold

      public void setStopThreshold(double stopThreshold) throws LockedException
      Sets threshold to be used to keep the algorithm iterating in case that best estimated threshold using median of residuals is not small enough. Once a solution is found that generates a threshold below this value, the algorithm will stop. The stop threshold can be used to prevent the LMedS algorithm to iterate too many times in cases where samples have a very similar accuracy. For instance, in cases where proportion of outliers is very small (close to 0%), and samples are very accurate (i.e. 1e-6), the algorithm would iterate for a long time trying to find the best solution when indeed there is no need to do that if a reasonable threshold has already been reached. Because of this behaviour the stop threshold can be set to a value much lower than the one typically used in RANSAC, and yet the algorithm could still produce even smaller thresholds in estimated results.
      Parameters:
      stopThreshold - stop threshold to stop the algorithm prematurely when a certain accuracy has been reached.
      Throws:
      IllegalArgumentException - if provided value is zero or negative.
      LockedException - if this solver is locked.
    • solve

      public com.irurueta.geometry.Point2D solve() throws LockedException, NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Solves the lateration problem.
      Specified by:
      solve in class RobustLaterationSolver<com.irurueta.geometry.Point2D>
      Returns:
      estimated position.
      Throws:
      LockedException - if instance is busy solving the lateration problem.
      NotReadyException - is solver is not ready.
      com.irurueta.numerical.robust.RobustEstimatorException - if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
    • getMethod

      public com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Specified by:
      getMethod in class RobustLaterationSolver<com.irurueta.geometry.Point2D>
      Returns:
      method being used for robust estimation.