Add settings for kalman filter
This commit is contained in:
parent
fc6e2b51e5
commit
83984a1f4c
4 changed files with 10 additions and 2 deletions
|
@ -9,9 +9,12 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
|
||||
<string name="use_kalman_filter_compass_descr">Use Kalman filter to avoid compass aberrations</string>
|
||||
<string name="use_kalman_filter_compass">Use Kalman filter</string>
|
||||
<string name="access_mark_final_location_first">Accessibility mode : please select destination first</string>
|
||||
<string name="use_magnetic_sensor_descr">Use magnetic sensor to determine compass value instead of orientation sensor</string>
|
||||
<string name="use_magnetic_sensor">Use magnetic sensor (compass)</string>
|
||||
<string name="use_magnetic_sensor">Use magnetic sensor</string>
|
||||
<string name="other_location">Other</string>
|
||||
<string name="files_limit">%1$d files left</string>
|
||||
<string name="available_downloads_left">Available %1$d files to download</string>
|
||||
|
|
|
@ -92,12 +92,14 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
|||
private Listener gpsStatusListener;
|
||||
private float[] mRotationM = new float[9];
|
||||
private OsmandPreference<Boolean> USE_MAGNETIC_FIELD_SENSOR_COMPASS;
|
||||
private OsmandPreference<Boolean> uSE_FILTER_FOR_COMPASS;
|
||||
|
||||
public OsmAndLocationProvider(OsmandApplication app) {
|
||||
this.app = app;
|
||||
navigationInfo = new NavigationInfo(app);
|
||||
settings = app.getSettings();
|
||||
USE_MAGNETIC_FIELD_SENSOR_COMPASS = settings.USE_MAGNETIC_FIELD_SENSOR_COMPASS;
|
||||
uSE_FILTER_FOR_COMPASS = settings.USE_KALMAN_FILTER_FOR_COMPASS;
|
||||
currentPositionHelper = new CurrentPositionHelper(app);
|
||||
locationSimulation = new OsmAndLocationSimulation(app, this);
|
||||
}
|
||||
|
@ -307,7 +309,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
|||
lastValSin = (float) Math.sin(valRad);
|
||||
lastValCos = (float) Math.cos(valRad);
|
||||
// lastHeadingCalcTime = System.currentTimeMillis();
|
||||
boolean filter = true; //USE_MAGNETIC_FIELD_SENSOR_COMPASS.get();
|
||||
boolean filter = uSE_FILTER_FOR_COMPASS.get(); //USE_MAGNETIC_FIELD_SENSOR_COMPASS.get();
|
||||
if (filter) {
|
||||
filterCompassValue();
|
||||
} else {
|
||||
|
|
|
@ -604,6 +604,7 @@ public class OsmandSettings {
|
|||
public final OsmandPreference<Boolean> USE_HIGH_RES_MAPS = new BooleanPreference("use_high_res_maps", true).makeGlobal().cache();
|
||||
|
||||
public final OsmandPreference<Boolean> USE_MAGNETIC_FIELD_SENSOR_COMPASS = new BooleanPreference("use_magnetic_field_sensor_compass", true).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> USE_KALMAN_FILTER_FOR_COMPASS = new BooleanPreference("use_kalman_filter_compass", true).makeGlobal().cache();
|
||||
|
||||
// this value string is synchronized with settings_pref.xml preference name
|
||||
public final OsmandPreference<Float> MAP_TEXT_SIZE = new FloatPreference("map_text_size", 1.0f).makeProfile().cache();
|
||||
|
|
|
@ -23,6 +23,7 @@ import android.content.DialogInterface.OnClickListener;
|
|||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.hardware.SensorManager;
|
||||
import android.media.AudioManager;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
@ -114,6 +115,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
|||
}
|
||||
|
||||
screen.addPreference(createCheckBoxPreference(settings.USE_MAGNETIC_FIELD_SENSOR_COMPASS, R.string.use_magnetic_sensor, R.string.use_magnetic_sensor_descr));
|
||||
screen.addPreference(createCheckBoxPreference(settings.USE_KALMAN_FILTER_FOR_COMPASS, R.string.use_kalman_filter_compass, R.string.use_kalman_filter_compass_descr));
|
||||
|
||||
registerBooleanPreference(settings.USE_ENGLISH_NAMES, screen);
|
||||
registerBooleanPreference(settings.LEFT_SIDE_NAVIGATION, screen);
|
||||
|
|
Loading…
Reference in a new issue