UserLocator implements HistogramConsumer { NicGeoPoint addDelta(NicGeoPoint currentPoint, NicGeoPoint normDelta) { final double x = currentPoint.getX() + normDelta.getX() * scale / 1000f; final double y = currentPoint.getY() + normDelta.getY() * scale / 1000f; currentPoint.setXY(x, y); return currentPoint; } UserLocator(final Context ctx,
                       final FingerprintManager fingerprintManager,
                       final UserPositionManager userPositionManager,
                       final WayManager wayManager);  UserLocator(final Context ctx,
                       final FingerprintManager fingerprintManager,
                       final UserPositionManager userPositionManager,
                       final WayManager wayManager,
                       final History history); static void setScale(float scale); ParticleFilter getParticleFilter(); void resetParticleFilter(); void addSensorCollector(SensorCollector collector); void removeSensorCollector(SensorCollector collector); void startTracking(); void stopTracking(); void localisationLoop(); @Override void addHistogram(final Histogram histogram); void disablePosition(); void setOutlierMode(final int outlierMode); void setStatisticFilterMode(final int statisticFilterMode); void setMapMatchingMode(final int mapMatchingMode); void setCompassFilterEnabled(final boolean enabled); void setLocalizationMethod(final int localizationMode); static final String TAG; static final int OUTLIER_MODE_NO_DETECTION; static final int OUTLIER_MODE_CME; static final int OUTLIER_MODE_PLASMONA; static final int STATISTIC_FILTER_MODE_NO_FILTER; static final int STATISTIC_FILTER_MODE_MEDIAN; static final int STATISTIC_FILTER_MODE_AVERAGE; static final int MAP_MATCHING_MODE_NONE; static final int MAP_MATCHING_MODE_SIMPLE_WAY_SNAP; static final int LOCALIZATION_MODE_PARTICLEFILTER; static final int LOCALIZATION_MODE_WIFI; static final int LOCALIZATION_MODE_DEADRECKONING; }
@Test public void testAddDelta() { NicGeoPoint current = new NicGeoPointImpl(); NicGeoPoint delta = new NicGeoPointImpl(); current.setXY(0.f, 0.f); delta.setXY(0.3f * 1000f, 0.86f * 1000f); userLocator.setScale(1.8f); userLocator.addDelta(current, delta); assertEquals(0.54f, current.getX(), 0.25f); assertEquals(1.548f, current.getY(), 0.25f); }