Class RANSACRobustLateration3DSolver
java.lang.Object
com.irurueta.navigation.lateration.RobustLaterationSolver<com.irurueta.geometry.Point3D>
com.irurueta.navigation.lateration.RobustLateration3DSolver
com.irurueta.navigation.lateration.RANSACRobustLateration3DSolver
Robustly solves the lateration problem by finding the best pairs of 3D
positions and distances among the provided ones using RANSAC algorithm to
discard outliers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Indicates whether inliers must be computed and kept.private boolean
Indicates whether residuals must be computed and kept.static final boolean
Indicates that by default inliers will only be computed but not kept.static final boolean
Indicates that by default residuals will only be computed but not kept.static final double
Constant defining default threshold to determine whether samples are inliers or not.static final double
Minimum value that can be set as threshold.private double
Threshold to determine whether samples are inliers or not when testing possible solutions.Fields inherited from class com.irurueta.navigation.lateration.RobustLateration3DSolver
homogeneousLinearSolver, inhomogeneousLinearSolver, innerDistances, innerDistanceStandardDeviations, innerPositions, nonLinearSolver
Fields inherited from class com.irurueta.navigation.lateration.RobustLaterationSolver
confidence, covariance, DEFAULT_CONFIDENCE, DEFAULT_KEEP_COVARIANCE, DEFAULT_MAX_ITERATIONS, DEFAULT_PROGRESS_DELTA, DEFAULT_REFINE_PRELIMINARY_SOLUTIONS, DEFAULT_REFINE_RESULT, DEFAULT_ROBUST_METHOD, DEFAULT_USE_HOMOGENEOUS_LINEAR_SOLVER, distances, distanceStandardDeviations, EPSILON, estimatedPosition, initialPosition, inliersData, keepCovariance, listener, locked, MAX_CONFIDENCE, MAX_PROGRESS_DELTA, maxIterations, MIN_CONFIDENCE, MIN_ITERATIONS, MIN_PROGRESS_DELTA, positions, preliminarySubsetSize, progressDelta, refinePreliminarySolutions, refineResult, useHomogeneousLinearSolver, useLinearSolver
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Point3D[] positions, double[] distances) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Point3D[] positions, double[] distances, double[] distanceStandardDeviations) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Point3D[] positions, double[] distances, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Point3D[] positions, double[] distances, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Sphere[] spheres) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Sphere[] spheres, double[] distanceStandardDeviations) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Sphere[] spheres, double[] distanceStandardDeviations, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener) Constructor.RANSACRobustLateration3DSolver
(com.irurueta.geometry.Sphere[] spheres, RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener) Constructor.RANSACRobustLateration3DSolver
(RobustLaterationSolverListener<com.irurueta.geometry.Point3D> listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.irurueta.numerical.robust.RobustEstimatorMethod
Returns method being used for robust estimation.double
Gets threshold to determine whether samples are inliers or not when testing possible solutions.boolean
Indicates whether inliers must be computed and kept.boolean
Indicates whether residuals must be computed and kept.void
setComputeAndKeepInliersEnabled
(boolean computeAndKeepInliers) Specifies whether inliers must be computed and kept.void
setComputeAndKeepResidualsEnabled
(boolean computeAndKeepResiduals) Specifies whether residuals must be computed and kept.void
setThreshold
(double threshold) Sets threshold to determine whether samples are inliers or not when testing possible solutions.com.irurueta.geometry.Point3D
solve()
Solves the lateration problem.Methods inherited from class com.irurueta.navigation.lateration.RobustLateration3DSolver
attemptRefine, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, getMinRequiredPositionsAndDistances, getNumberOfDimensions, getSpheres, setPreliminarySubsetSize, setSpheres, setSpheresAndStandardDeviations, solvePreliminarySolutions
Methods inherited from class com.irurueta.navigation.lateration.RobustLaterationSolver
getConfidence, getCovariance, getDistances, getDistanceStandardDeviations, getEstimatedPosition, getInitialPosition, getInliersData, getListener, getMaxIterations, getPositions, getPreliminarySubsetSize, getProgressDelta, getQualityScores, internalSetPositionsAndDistances, internalSetPositionsDistancesAndStandardDeviations, isCovarianceKept, isHomogeneousLinearSolverUsed, isLinearSolverUsed, isLocked, isPreliminarySolutionRefined, isReady, isResultRefined, setConfidence, setCovarianceKept, setHomogeneousLinearSolverUsed, setInitialPosition, setLinearSolverUsed, setListener, setMaxIterations, setPositionsAndDistances, setPositionsDistancesAndStandardDeviations, setPreliminarySolutionRefined, setProgressDelta, setQualityScores, setResultRefined
-
Field Details
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDConstant defining default threshold to determine whether samples are inliers or not.- See Also:
-
MIN_THRESHOLD
public static final double MIN_THRESHOLDMinimum value that can be set as threshold. Threshold must be strictly greater than 0.0.- See Also:
-
DEFAULT_COMPUTE_AND_KEEP_INLIERS
public static final boolean DEFAULT_COMPUTE_AND_KEEP_INLIERSIndicates that by default inliers will only be computed but not kept.- See Also:
-
DEFAULT_COMPUTE_AND_KEEP_RESIDUALS
public static final boolean DEFAULT_COMPUTE_AND_KEEP_RESIDUALSIndicates that by default residuals will only be computed but not kept.- See Also:
-
threshold
private double thresholdThreshold to determine whether samples are inliers or not when testing possible solutions. The threshold refers to the amount of error on distance between estimated position and distances provided for each sample. -
computeAndKeepInliers
private boolean computeAndKeepInliersIndicates whether inliers must be computed and kept. -
computeAndKeepResiduals
private boolean computeAndKeepResidualsIndicates whether residuals must be computed and kept.
-
-
Constructor Details
-
RANSACRobustLateration3DSolver
public RANSACRobustLateration3DSolver()Constructor. -
RANSACRobustLateration3DSolver
public RANSACRobustLateration3DSolver(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 or their length is smaller than required (4 points).
-
RANSACRobustLateration3DSolver
public RANSACRobustLateration3DSolver(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).
-
RANSACRobustLateration3DSolver
public RANSACRobustLateration3DSolver(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).
-
RANSACRobustLateration3DSolver
public RANSACRobustLateration3DSolver(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.
-
-
Method Details
-
getThreshold
public double getThreshold()Gets threshold to determine whether samples are inliers or not when testing possible solutions. The threshold refers to the amount of error on distance between estimated position and distances provided for each sample.- Returns:
- threshold to determine whether samples are inliers or not.
-
setThreshold
Sets threshold to determine whether samples are inliers or not when testing possible solutions. The threshold refers to the amount of error on distance between estimated position and distances provided for each sample.- Parameters:
threshold
- threshold to determine whether samples are inliers or not.- Throws:
IllegalArgumentException
- if provided value is equal or less than zero.LockedException
- if this solver is locked.
-
isComputeAndKeepInliersEnabled
public boolean isComputeAndKeepInliersEnabled()Indicates whether inliers must be computed and kept.- Returns:
- true if inliers must be computed and kept, false if inliers only need to be computed but not kept.
-
setComputeAndKeepInliersEnabled
Specifies whether inliers must be computed and kept.- Parameters:
computeAndKeepInliers
- true if inliers must be computed and kept, false if inliers only need to be computed but not kept.- Throws:
LockedException
- if this solver is locked.
-
isComputeAndKeepResiduals
public boolean isComputeAndKeepResiduals()Indicates whether residuals must be computed and kept.- Returns:
- true if residuals must be computed and kept, false if residuals only need to be computed but not kept.
-
setComputeAndKeepResidualsEnabled
public void setComputeAndKeepResidualsEnabled(boolean computeAndKeepResiduals) throws LockedException Specifies whether residuals must be computed and kept.- Parameters:
computeAndKeepResiduals
- true if residuals must be computed and kept, false if residuals only need to be computed but not kept.- Throws:
LockedException
- if this solver is locked.
-
solve
public com.irurueta.geometry.Point3D solve() throws LockedException, NotReadyException, com.irurueta.numerical.robust.RobustEstimatorExceptionSolves the lateration problem.- Specified by:
solve
in classRobustLaterationSolver<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 classRobustLaterationSolver<com.irurueta.geometry.Point3D>
- Returns:
- method being used for robust estimation.
-