Class PROMedSRobustLateration3DSolver

java.lang.Object
com.irurueta.navigation.lateration.RobustLaterationSolver<com.irurueta.geometry.Point3D>
com.irurueta.navigation.lateration.RobustLateration3DSolver
com.irurueta.navigation.lateration.PROMedSRobustLateration3DSolver

public class PROMedSRobustLateration3DSolver extends RobustLateration3DSolver
Robustly solves the lateration problem by finding the best pairs of 3D positions and distances among the provided ones using PROMedS 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.
    • qualityScores

      private double[] qualityScores
      Quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
  • Constructor Details

    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver()
      Constructor.
    • PROMedSRobustLateration3DSolver

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

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Point3D[] 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 of their length is smaller than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Point3D[] 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 (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Point3D[] positions, double[] distances, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> 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 stats, 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 (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Point3D[] positions, double[] distances, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> 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 stats, 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 (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Sphere[] spheres)
      Constructor.
      Parameters:
      spheres - spheres defining positions and distances.
      Throws:
      IllegalArgumentException - if spheres is null or if length of spheres array is less than required (4 points).
    • PROMedSRobustLateration3DSolver

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

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Sphere[] spheres, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      spheres - spheres 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 spheres is null or if length of spheres array is less than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(com.irurueta.geometry.Sphere[] spheres, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      spheres - spheres defining positions and distances.
      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 spheres is null, length of spheres array is less than required (4 points) or don't have the same length.
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      Throws:
      IllegalArgumentException - if quality scores is null, length of quality scores is less than required minimum (4 samples).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if quality scores is null, length of quality scores is less than required minimum (4 samples).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Point3D[] positions, double[] distances)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      positions - known positions of static nodes.
      distances - euclidean distances from static nodes to mobile node to be estimated.
      Throws:
      IllegalArgumentException - if either positions, distances or quality scores are null, don't have the same length or their length is smaller than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Point3D[] positions, double[] distances, double[] distanceStandardDeviations)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      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, distances, quality scores or standard deviations are null, don't have the same length or their length is smaller than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Point3D[] positions, double[] distances, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      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 (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Point3D[] positions, double[] distances, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      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, distances, quality scores or standard deviations are null, don't have the same length or their length is smaller than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Sphere[] spheres)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      spheres - spheres defining positions and distances.
      Throws:
      IllegalArgumentException - if either spheres or quality scores are null don't have the same length or their length is less than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Sphere[] spheres, double[] distanceStandardDeviations)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      spheres - spheres defining positions and distances.
      distanceStandardDeviations - standard deviations of provided measured distances.
      Throws:
      IllegalArgumentException - if either spheres, quality scores or standard deviations are null, don't have the same length or their length is less than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Sphere[] spheres, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      spheres - spheres 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 either spheres or quality scores are null, don't have the same length or their length is less than required (4 points).
    • PROMedSRobustLateration3DSolver

      public PROMedSRobustLateration3DSolver(double[] qualityScores, com.irurueta.geometry.Sphere[] spheres, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener)
      Constructor.
      Parameters:
      qualityScores - quality scores corresponding to each provided sample. The larger the score value the better the quality of the sample.
      spheres - spheres defining positions and distances.
      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 spheres, quality scores or standard deviations are null, don't have the same length or their length is less than required (4 points).
  • 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.
    • getQualityScores

      public double[] getQualityScores()
      Returns quality scores corresponding to each pair of positions and distances (i.e. sample). The larger the score value the better the quality of the sample.
      Overrides:
      getQualityScores in class RobustLaterationSolver<com.irurueta.geometry.Point3D>
      Returns:
      quality scores corresponding to each sample.
    • setQualityScores

      public void setQualityScores(double[] qualityScores) throws LockedException
      Sets quality scores corresponding to each pair of positions and distances (i.e. sample). The larger the score value the better the quality of the sample.
      Overrides:
      setQualityScores in class RobustLaterationSolver<com.irurueta.geometry.Point3D>
      Parameters:
      qualityScores - quality scores corresponding to each pair of matched points.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than minimum required samples.
      LockedException - if robust solver is locked because an estimation is already in progress.
    • isReady

      public boolean isReady()
      Indicates whether solver is ready to find a solution.
      Overrides:
      isReady in class RobustLaterationSolver<com.irurueta.geometry.Point3D>
      Returns:
      true if solver is ready, false otherwise.
    • solve

      public com.irurueta.geometry.Point3D solve() throws LockedException, NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Solves the lateration problem.
      Specified by:
      solve in class RobustLaterationSolver<com.irurueta.geometry.Point3D>
      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.Point3D>
      Returns:
      method being used for robust estimation.
    • internalSetQualityScores

      private void internalSetQualityScores(double[] qualityScores)
      Sets quality scores corresponding to each provided sample. This method is used internally and does not check whether instance is locked or not.
      Parameters:
      qualityScores - quality scores to be set.
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than 3 samples.