@Test public void testCalculationDelta() { deadReckoning.moving = true; deadReckoning.azimuth = 1.57f; deadReckoning.motionModel = 1.f; deadReckoning.timestep = 100; deadReckoning.baseAngle = 1.57f; deadReckoning.calculateDeltaLoop(); assertEquals(0.f, deadReckoning.delta[0], 0.02f); assertEquals(1.f, deadReckoning.delta[1], 0.02f); }
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);  }