@Test public void testDeltaNoMovement() { deadReckoning.delta[0] = 10.f; deadReckoning.delta[1] = 12.f; deadReckoning.moving = false; double x = deadReckoning.delta[0]; double y = deadReckoning.delta[1]; deadReckoning.calculateDeltaLoop(); assertTrue(x == deadReckoning.delta[0]); assertTrue(y == deadReckoning.delta[1]); }
void calculateDeltaLoop() { synchronized (mutex) { double distance; if (moving && (azimuth != null)) { distance = motionModel * timestep/100.f; delta[0] += distance * Math.sin(azimuth - baseAngle); delta[1] += distance * Math.cos(azimuth - baseAngle); } } }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { void calculateDeltaLoop() { synchronized (mutex) { double distance; if (moving && (azimuth != null)) { distance = motionModel * timestep/100.f; delta[0] += distance * Math.sin(azimuth - baseAngle); delta[1] += distance * Math.cos(azimuth - baseAngle); } } } }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { void calculateDeltaLoop() { synchronized (mutex) { double distance; if (moving && (azimuth != null)) { distance = motionModel * timestep/100.f; delta[0] += distance * Math.sin(azimuth - baseAngle); delta[1] += distance * Math.cos(azimuth - baseAngle); } } } DeadReckoning(final Activity activity); }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { void calculateDeltaLoop() { synchronized (mutex) { double distance; if (moving && (azimuth != null)) { distance = motionModel * timestep/100.f; delta[0] += distance * Math.sin(azimuth - baseAngle); delta[1] += distance * Math.cos(azimuth - baseAngle); } } } DeadReckoning(final Activity activity); void startSensors(); void stopSensors(); @Override void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data); @Override void onSensorChanged(final SensorEvent event); @Override void onAccuracyChanged(final Sensor sensor, final int accuracy); NicGeoPoint getDelta(); void setCompassFilterEnabled(boolean useLowPassFilter); void setBaseAngle(final double baseAngle); }
DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { void calculateDeltaLoop() { synchronized (mutex) { double distance; if (moving && (azimuth != null)) { distance = motionModel * timestep/100.f; delta[0] += distance * Math.sin(azimuth - baseAngle); delta[1] += distance * Math.cos(azimuth - baseAngle); } } } DeadReckoning(final Activity activity); void startSensors(); void stopSensors(); @Override void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data); @Override void onSensorChanged(final SensorEvent event); @Override void onAccuracyChanged(final Sensor sensor, final int accuracy); NicGeoPoint getDelta(); void setCompassFilterEnabled(boolean useLowPassFilter); void setBaseAngle(final double baseAngle);  }