This documentation was generated with the assistance of AI. Please report any inaccuracies.
The com.irurueta.navigation.indoor.position package also estimates a device’s position from ranging
readings — distances to Wi-Fi access points or beacons obtained directly through round-trip-time (RTT) protocols
such as Wi-Fi RTT (802.11mc), rather than derived from signal strength. Since ranging readings are already
distances, this hierarchy skips the path-loss distance conversion entirely and applies
classic multilateration directly.
Overview
Ranging measures distance the direct way: a protocol like
Wi-Fi RTT (802.11mc) times how long a signal takes to make
a round trip between the device and an access point and, since radio waves travel at a known, constant speed
(the speed of light), converts that time directly into a distance — no assumption about signal strength or how it
decays with distance is needed at all.
Once a distance to an access point is known, the same reasoning as
RSSI-based positioning applies: one distance narrows the device down to a
circle (2D) or sphere (3D) around that access point; distances to several access points narrow it down to where
those circles overlap — multilateration. Because ranging measures
distance directly instead of inferring it from a noisy, modeled quantity like signal strength, the resulting
distances are typically far more precise, so the circles tend to intersect much more tightly around the true
position.
3D robust classes mirror the 2D ones. A RangingReading carries a measured distance (meters), an optional
distanceStandardDeviation, and the number of attempted/successful RTT measurement exchanges. As with the RSSI
hierarchy, 2D estimators need a minimum of 3 sources and 3D estimators need 4; the indoor classes delegate the
actual math to the same com.irurueta.navigation.lateration solvers used by
RSSI position estimation — ranging estimators simply feed them measured distances
directly instead of distances derived from the path-loss model.
Linear estimation
Both linearizations start from the same per-source constraint \((\mathbf{x}-\mathbf{p}_i)\cdot(\mathbf{x}-\mathbf{p}_i)
= d_i^2\) and eliminate its quadratic term by subtracting the reference source’s ( ) equation from
every other one.
Inhomogeneous solver
giving the linear system in the shifted unknown \(\mathbf{y} =
\mathbf{x} - \mathbf{p}_1\):
solved by a direct linear solve, then . Based on Hereman &
Murphy’s trilateration derivation.
Homogeneous solver (default)
Substituting homogeneous coordinates into the same pairwise-differenced equations gives
(2D form shown):
solved via SVD (last column of ), then dehomogenized. LinearRangingPositionEstimator defaults to
this solver (useHomogeneousLinearSolver = true); both require nullity / a minimum of
sources or throw LaterationException.
Non-linear estimation
NonLinearRangingPositionEstimator wraps the same Levenberg-Marquardt solver used for RSSI, fitting measured
squared distance against the candidate’s squared distance to each source:
minimizing where weights come from
each reading’s distanceStandardDeviation (default m if unspecified), optionally combined in
quadrature with the source’s position uncertainty when useRadioSourcePositionCovariance is enabled:
. The initial position defaults to the
centroid of the known source positions unless initialPosition is set. The fit also yields a position covariance
and chi-squared value.
Robust estimation
RobustRangingPositionEstimator follows the identical sample-and-score structure described in
the RSSI hierarchy’s robust section — the residual formula, per-sample
scoring, and PROMedS default are the same:
with one notable default difference: useHomogeneousLinearSolver defaults to false for the robust
estimators' preliminary-solution step (versus true for the plain linear estimator above). The preliminary
solution is always attempted with the (inhomogeneous, by default) linear solver first and then refined with the
non-linear solver, seeded at the linear result — this is where linear and non-linear estimation are chained
together for every robust variant.
Variant
Scoring
Threshold / quality scores
RANSAC
Maximizes count of samples with threshold
Fixed threshold (default m)
MSAC
Minimizes a truncated sum of residuals (capped at threshold) instead of counting inliers
Fixed threshold, same default
LMedS
Minimizes the median residual across all samples; no fixed inlier cut
stopThreshold (default ) is an early-stop target only
PROSAC
Same inlier-count criterion as RANSAC, but samples highest-quality readings first
Fixed threshold; quality scores required
PROMedS
LMedS’s median-residual criterion with PROSAC’s quality-guided sampling order
stopThreshold; quality scores optional but recommended
Quality scores in the indoor layer are two separate arrays — sourceQualityScores (per radio source) and
fingerprintReadingsQualityScores (per reading) — summed per distance sample. When evenlyDistributeReadings
(default true) is enabled, ReadingSorter additionally re-orders sampling priority so that no single source’s
readings dominate PROSAC/PROMedS regardless of raw quality-score magnitude.
Usage parameters
sources, fingerprint (of RangingReading`s), `listener — common to all estimators.