Class PositionEstimator<P extends com.irurueta.geometry.Point<?>,R extends Reading<? extends RadioSource>,L extends PositionEstimatorListener<? extends PositionEstimator<?,?,?>>>
java.lang.Object
com.irurueta.navigation.indoor.position.PositionEstimator<P,R,L>
- Type Parameters:
P- aPointtype.R- aReadingtype.L- aPositionEstimatorListenertype.
- Direct Known Subclasses:
MixedPositionEstimator,RangingAndRssiPositionEstimator,RangingPositionEstimator,RssiPositionEstimator
public abstract class PositionEstimator<P extends com.irurueta.geometry.Point<?>,R extends Reading<? extends RadioSource>,L extends PositionEstimatorListener<? extends PositionEstimator<?,?,?>>>
extends Object
Base class for position estimators using located radio sources and their readings at
an unknown location (i.e. a non located fingerprint).
These kind of estimators can be used to determine the position of a given device by
getting readings at an unknown location of different radio sources whose locations
are known.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]Estimated inhomogeneous position coordinates.protected Fingerprint<? extends RadioSource, ? extends R> Fingerprint containing readings at an unknown location for provided located radio sources.protected LListener to be notified of events raised by this instance.protected List<? extends RadioSourceLocated<P>> Located radio sources used for lateration. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedPositionEstimator(L listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidestimate()Estimates position based on provided located radio sources and readings of such radio sources at an unknown location.abstract double[]Gets Euclidean distances from known located radio sources to the location of provided readings in a fingerprint.abstract PGets estimated position.voidgetEstimatedPosition(P estimatedPosition) Gets estimated position and stores result into provided instance.double[]Gets estimated inhomogeneous position coordinates.Gets fingerprint containing readings at an unknown location for provided located radio sources.Gets listener to be notified of events raised by this instance.abstract intGets minimum required number of located radio sources to perform lateration.abstract P[]Gets known positions of radio sources used internally to solve lateration.Gets located radio sources used for lateration.protected voidinternalSetFingerprint(Fingerprint<? extends RadioSource, ? extends R> fingerprint) Internally sets fingerprint containing readings at an unknown location for provided located radio sources.protected voidinternalSetSources(List<? extends RadioSourceLocated<P>> sources) Internally sets located radio sources used for lateration.abstract booleanisLocked()Returns boolean indicating whether this estimator is locked because an estimation is already in progress.abstract booleanisReady()Indicates whether estimator is ready to find a solution.voidsetFingerprint(Fingerprint<? extends RadioSource, ? extends R> fingerprint) Sets fingerprint containing readings at an unknown location for provided located radio sources.voidsetListener(L listener) Sets listener to be notified of events raised by this instance.voidsetSources(List<? extends RadioSourceLocated<P>> sources) Sets located radio sources used for lateration.
-
Field Details
-
sources
Located radio sources used for lateration. -
fingerprint
protected Fingerprint<? extends RadioSource,? extends R extends Reading<? extends RadioSource>> fingerprintFingerprint containing readings at an unknown location for provided located radio sources. -
listener
Listener to be notified of events raised by this instance. -
estimatedPositionCoordinates
protected double[] estimatedPositionCoordinatesEstimated inhomogeneous position coordinates.
-
-
Constructor Details
-
PositionEstimator
protected PositionEstimator()Constructor. -
PositionEstimator
Constructor.- Parameters:
listener- listener in charge of handling events.
-
-
Method Details
-
getSources
Gets located radio sources used for lateration.- Returns:
- located radio sources used for lateration.
-
setSources
public void setSources(List<? extends RadioSourceLocated<P>> sources) throws com.irurueta.navigation.LockedException Sets located radio sources used for lateration.- Parameters:
sources- located radio sources used for lateration.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.IllegalArgumentException- if provided value is null or the number of provided sources is less than the required minimum.
-
getFingerprint
Gets fingerprint containing readings at an unknown location for provided located radio sources.- Returns:
- fingerprint containing readings at an unknown location for provided located radio sources.
-
getListener
Gets listener to be notified of events raised by this instance.- Returns:
- listener to be notified of events raised by this instance.
-
setListener
Sets listener to be notified of events raised by this instance.- Parameters:
listener- listener to be notified of events raised by this instance.- Throws:
com.irurueta.navigation.LockedException- if estimator is locked.
-
getEstimatedPositionCoordinates
public double[] getEstimatedPositionCoordinates()Gets estimated inhomogeneous position coordinates.- Returns:
- estimated inhomogeneous position coordinates.
-
getEstimatedPosition
Gets estimated position and stores result into provided instance.- Parameters:
estimatedPosition- instance where estimated position will be stored.
-
getMinRequiredSources
public abstract int getMinRequiredSources()Gets minimum required number of located radio sources to perform lateration.- Returns:
- minimum required number of located radio sources to perform lateration.
-
isReady
public abstract boolean isReady()Indicates whether estimator is ready to find a solution.- Returns:
- true if estimator is ready, false otherwise.
-
isLocked
public abstract boolean isLocked()Returns boolean indicating whether this estimator is locked because an estimation is already in progress.- Returns:
- true if estimator is locked, false otherwise.
-
estimate
public abstract void estimate() throws com.irurueta.navigation.LockedException, com.irurueta.navigation.NotReadyException, PositionEstimationExceptionEstimates position based on provided located radio sources and readings of such radio sources at an unknown location.- 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.
-
getEstimatedPosition
Gets estimated position.- Returns:
- estimated position.
-
getPositions
Gets known positions of radio sources used internally to solve lateration.- Returns:
- known positions used internally.
-
getDistances
public abstract 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.- Returns:
- Euclidean distances used internally.
-
internalSetSources
Internally sets located radio sources used for lateration.- 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.
-