android module

Functions to process Android measurements.

Tested on Google Android’s GNSSLogger App v3.0.6.4

Includes functionality for:
  • Fix Measurements

  • Raw Measurements

  • Accel Measurements

  • Gyro Measurements

  • Mag Measurements

  • Bearing Measurements

class android.AndroidRawAccel(input_path, sensor_fields=('UncalAccel', 'Accel'))[source]

Bases: NavData

Class handling Accelerometer measurements from Android.

Inherits from NavData().

Parameters:
  • input_path (string or path-like) – File location of data file to read.

  • sensor_fields (tuple) – Names for the sensors to extract from the full log file.

_row_map()[source]

Map of row names from loaded to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

postprocess()[source]

Postprocess loaded data.

preprocess(input_path)[source]

Read Android raw file and produce Accel dataframe objects.

Parameters:

input_path (string or path-like) – File location of data file to read.

Returns:

measurements – Dataframe that contains the accel measurements from the log.

Return type:

pd.DataFrame

class android.AndroidRawFixes(input_path)[source]

Bases: NavData

Class handling location fix measurements from an Android log.

Inherits from NavData().

Parameters:

input_path (string or path-like) – Path to measurement csv or txt file.

static _provider_map()[source]

Map to more intuitive names for fix provider.

Returns:

provider_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

static _row_map()[source]

Map of row names from loaded to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

postprocess()[source]

Postprocess loaded data.

preprocess(input_path)[source]

Read Android raw file and produce location fix dataframe objects

Parameters:

input_path (string or path-like) – File location of data file to read.

Returns:

fix_df – Dataframe that contains the location fixes from the log.

Return type:

pd.DataFrame

class android.AndroidRawGnss(input_path, filter_measurements=True, measurement_filters={'adr_uncertainty': 15.0, 'adr_valid': True, 'arrival_time': True, 'bias_uncertainty': 40.0, 'bias_valid': True, 'state_decoded': True, 'sv_time_uncertainty': 500.0, 'time_valid': True, 'unknown_constellations': True}, remove_rx_b_from_pr=False, verbose=False)[source]

Bases: NavData

Handles Raw GNSS measurements from Android.

Data types in the Android’s GNSSStatus messages are documented on their website [1].

Parameters:
  • input_path (string or path-like) – Path to measurement csv or txt file.

  • filter_measurements (bool) – Filter noisy measurements based on known conditions.

  • measurement_filters (dict) – Conditions under which measurements should be filtered. An emptry dictionary passed into measurement_filters is equivalent to setting filter_measurements to False. See the docstring for filter_raw_measurements for details.

  • remove_rx_b_from_pr (bool) – If true, removes the estimated initial receiver clock bias from the pseudorange values.

  • verbose (bool) – If true, prints extra debugging statements.

References

static _row_map()[source]

Map of row names from loaded to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

filter_raw_measurements(t_rx_secs)[source]

Filter noisy measurements.

Filter conditions are set in the AndroidRawGnss() initialization with the measurement_filters variable. The general framework for measurement filters is taken from Google’s ION GNSS+ 2023 workshop presentation [4]. Google’s gps-measurement-tools opensource software shows a couple of their implementations with example values [5] [6].

The possible keys to include in the measurement_filters dictionary variable include:

  • bias_valid : If true, measurements where FullBiasNanos is greater or equal to zero will be removed.

  • bias_uncertainty : Any measurements will be re where BiasUncertaintyNanos is greater than the set value.

  • arrival_time : If true, measurements where the arrival time (t_rx_secs) is negative or unrealistically large will be removed.

  • unknown_constellations : If true, measurements with an unknown_constellation will be removed.

  • time_valid : If true, measurements with where TimeNanos is empty will be removed.

  • state_decoded : If true, will filter measurements that don’t have the time-of-week decoded [7].

  • sv_time_uncertainty : Any measurements will be removed where ReceivedSvTimeUncertaintyNanos is greater than the set value.

  • adr_valid : If true, measurements where AccumulatedDeltaRangeState is not valid will be removed.

  • adr_uncertainty : Any measurements will be removed where ReceivedSvTimeUncertaintyNanos is greater than the set value.

Only keys present in the measurement_filters dictionary will be used for the filter. For example if ``measurement_filters = {``bias_valid : True}, then only measurements will invalid FullBiasNanos will be filtered and no other measurements will be filtered.

Parameters:

t_rx_secs (np.ndarray) – arrival time computed in AndroidRawGnss.postprocess().

References

postprocess()[source]

Postprocess loaded NavData.

Strategy for computing the arrival time was taken from an EUSPA white paper [2] and Google’s source code Arrival time taken from [3].

References

preprocess(input_path)[source]

Extract Raw measurements.

Built on the first parts of make_gnss_dataframe and correct_log

Parameters:

input_path (string or path-like) – Path to measurement csv or txt file.

Returns:

measurements – Subset of “Raw” measurements.

Return type:

pd.DataFrame

class android.AndroidRawGyro(input_path)[source]

Bases: AndroidRawAccel

Class handling Gyro measurements from Android.

Parameters:

input_path (string or path-like) – File location of data file to read.

_row_map()[source]

Map of row names from loaded to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

class android.AndroidRawMag(input_path)[source]

Bases: AndroidRawAccel

Class handling Magnetometer measurements from Android.

Parameters:

input_path (string or path-like) – File location of data file to read.

_row_map()[source]

Map of row names from loaded to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict

class android.AndroidRawOrientation(input_path)[source]

Bases: AndroidRawAccel

Class handling Orientation measurements from Android.

Parameters:

input_path (string or path-like) – File location of data file to read.

_row_map()[source]

Map of row names from loaded to gnss_lib_py standard

Returns:

row_map – Dictionary of the form {old_name : new_name}

Return type:

Dict