This challenge provides data from a variety of instruments useful for determining a phone's position: signals from GPS satellites, accelerometer readings, gyroscope readings, and more.

As this challenge’s design is focused on post-processing applications such as lane-level mapping, future data along a route will be available to generate positions as precisely as possible. You may also make use of information from neighboring phones to aid your estimation, as many routes may be represented by multiple phones. In order to encourage the development of a general GNSS positioning algorithm, in-phone GPS chipset locations will not be provided, as they are derived from a manufacturer proprietary algorithm that varies by phone model and other factors.

A detailed explanation of the data collection process can be found in [this paper](https://www.kaggle.com/google/android-smartphones-high-accuracy-datasets?select=ION+GNSS+2020+Android+Raw+GNSS+Measurement+Datasets+for+Precise+Positioning.pdf). If publishing work based on this dataset/challenge, please ensure proper citation per the [Competition Rules](https://www.kaggle.com/c/google-smartphone-decimeter-challenge/rules).

## Files

**[train]/[drive_id]/[phone_name]/ground_truth.csv** - Only provided for the training set. Reference locations at expected timestamps.
**[train/test]/[drive_id]/[phone_name]/supplemental/[phone_name][.20o/.21o/.nmea]** - Equivalent data to the gnss logs in other formats used by the GPS community.
**baseline_locations_[train/test].csv** - Estimated coordinates generated using a simple approach.
**ground_truth.csv** - Reference locations at expected timestamps.

* `millisSinceGpsEpoch` - An integer number of milliseconds since the GPS epoch (1980/1/6
midnight UTC). Its value equals

   ([Raw::TimeNanos](https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()) - [Raw::FullBiasNanos](https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos())) / 1000000.0

 for each unique epoch described in the Raw sentences.

* `latDeg, lngDeg` - The [WGS84](https://en.wikipedia.org/w/index.php?title=World_Geodetic_System&oldid=1013033380)
latitude, longitude (in decimal degrees) estimated by the reference
GNSS receiver (NovAtel SPAN). Linear interpolation has been applied where necessary to align the
location to the expected non-integer timestamps.

* `heightAboveWgs84EllipsoidM` - The height above the WGS84 ellipsoid (in meters) estimated by the
reference GNSS receiver.

* `timeSinceFirstFixSeconds` - The elapsed time (in seconds) since the first location fix.

* `hDop` - Horizontal dilution of precision
[DOP](https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)),
from the
[GGA](https://www.trimble.com/OEM_ReceiverHelp/V4.44/en/NMEA-0183messages_GGA.html)
sentence, describes how errors in the measurements affect the final
horizontal position estimation.

* `vDop` - Vertical dilution of precision
[DOP](https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)),
from the
[GSA](https://www.trimble.com/OEM_ReceiverHelp/V4.44/en/NMEA-0183messages_GSA.html)
sentence, describes how errors in the measurements affect the final
vertical position estimation.

* `speedMps` - The speed over ground in meters per second.

* `courseDegree` - The course angle clockwise with respect to the truth north over ground
(in degrees).
**[train/test]/[drive_id]/[phone_name]/[phone_name]_derived.csv** -  GNSS intermediate values derived from raw GNSS measurements, provided for convenience.

With these derived values, a corrected pseudorange (i.e. a closer approximation to the geometric range from the phone to the satellite)
can be computed as: correctedPrM = rawPrM + satClkBiasM - isrbM - ionoDelayM - tropoDelayM. The baseline locations
are computed using correctedPrM and the satellite positions, using a standard Weighted Least Squares (WLS) solver, with the phone's position
(x, y, z), clock bias (t), and isrbM for each unique signal type as states for each epoch.

* `collectionName` - The name of the "grand" parent folder.

* `phoneName` - The name of the parent folder.

* `millisSinceGpsEpoch` - An integer number of milliseconds since the GPS epoch (1980/1/6 midnight UTC).

* [`constellationType`](https://developer.android.com/reference/android/location/GnssMeasurement#getConstellationType()):
     GNSS constellation type. An integer number, whose mapping  string value is provided in **constellation_type_mapping.csv**.

* [`svid`](https://developer.android.com/reference/android/location/GnssMeasurement#getSvid()) - The satellite ID.

* `signalType` - The GNSS signal type is a combination of the constellation name and the frequency band. Common signal types
     measured by smartphones include: GPS_L1, GPS_L5, GAL_E1, GAL_E5A, GLO_G1, BDS_B1I, BDS_B1C, BDS_B2A, QZS_J1, and QZS_J5.

* `receivedSvTimeInGpsNanos` - The signal transmission time received by the chipset, in the numbers of nanoseconds since the GPS epoch.
     Converted from
     [ReceivedSvTimeNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos()),
     this derived value is in a unified time scale for all
     constellations, while
     [ReceivedSvTimeNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos())
     refers to the time of day for GLONASS and the time of week for
     non-GLONASS constellations.

* `[x/y/z]SatPosM` - The satellite position (meters) in an [ECEF coordinate frame](https://en.wikipedia.org/wiki/ECEF) at best estimate of “true signal transmission time” defined as ttx = receivedSvTimeInGpsNanos - satClkBiasNanos (defined below). They are computed with the satellite broadcast [ephemeris](https://novatel.com/support/known-solutions/gnss-ephemerides-and-almanacs), and have ~1-meter error with respect to the true satellite position. 

* `[x/y/z]SatVelMps` - The satellite velocity (meters
     per second) in an ECEF coordinate frame at the signal transmission
     time (receivedSvTimeInGpsNanos). They are computed with the
     satellite broadcast ephemeris, with this
     [algorithm](https://fenrir.naruoka.org/download/autopilot/note/080205_gps/gps_velocity.pdf).


* `satClkBiasM` - The satellite time correction combined with hardware delay in meters at the signal transmission time (receivedSvTimeInGpsNanos). Its time equivalent is termed as satClkBiasNanos.
    * satClkBiasNanos equals the satelliteTimeCorrection minus the satelliteHardwareDelay. 
    * As defined in IS-GPS-200H Section 20.3.3.3.3.1, satelliteTimeCorrection is calculated from ∆tsv = af0 + af1(t - toc) + af2(t - toc)2 + ∆tr, while satelliteHardwareDelay is a term defined in Section 20.3.3.3.3.2. 
    * Parameters in equations above are provided on the satellite broadcast ephemeris.


* `satClkDriftMps` - The satellite clock drift in meters per second
     at the signal transmission time (receivedSvTimeInGpsNanos). It
     equals the difference of the satellite clock biases at t+0.5s and
     t-0.5s.

* `rawPrM` - Raw pseudorange in meters. It is the product between the
     speed of light and the time difference from the signal
     transmission time (receivedSvTimeInGpsNanos) to the signal arrival
     time
     ([Raw::TimeNanos](https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()) -
     [Raw::FullBiasNanos](https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos()) -
     [Raw::BiasNanos](https://developer.android.com/reference/android/location/GnssClock#getBiasNanos())).

* `rawPrUncM` - Raw pseudorange uncertainty in meters. It is the product between the speed of light and the
     [ReceivedSvTimeUncertaintyNanos](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeUncertaintyNanos()).

* `isrbM` - The Inter-Signal Range Bias (ISRB) in meters from a
     non-GPS-L1 signal to GPS-L1 signals. For example, when the isrbM
     of GPS L5 is 1000m, it implies that a GPS L5 pseudorange is 1000m
     longer than the GPS L1 pseudorange transmitted by the same GPS
     satellite. It's zero for GPS-L1 signals. ISRB is introduced in
     the GPS chipset level and estimated as a state in the Weighted
     Least Squares engine.

* `ionoDelayM` - The ionospheric delay in meters, estimated with the
     [Klobuchar](http://www.navipedia.net/index.php/Klobuchar_Ionospheric_Model)
     model.

* `tropoDelayM` - The tropospheric delay in meters, estimated with [the EGNOS
     model](https://www.cambridge.org/core/journals/journal-of-navigation/article/abs/assessment-of-egnos-tropospheric-correction-model/1F187CB66A815FE22B75A1C2BFB728E2)
     by Nigel Penna, Alan Dodson and W. Chen (2001).
**[train/test]/[drive_id]/[phone_name]/[phone_name]_GnssLog.txt** - The phone's logs as generated by the [GnssLogger
App](https://play.google.com/store/apps/details?id=com.google.android.apps.location.gps.gnsslogger&hl=en_US≷=US). [This notebook](https://www.kaggle.com/sohier/loading-gnss-logs/) demonstrates how to parse the logs.
Each gnss file contains several sub-datasets, each of which is detailed below:
Raw - The raw GNSS measurements of one GNSS signal (each satellite may have 1-2 signals for L5-enabled smartphones), collected
from the Android API [GnssMeasurement](https://developer.android.com/reference/android/location/GnssMeasurement).

* `utcTimeMillis` - Milliseconds since UTC epoch (1970/1/1), converted from
    [GnssClock](https://developer.android.com/reference/android/location/GnssClock)

-   [`TimeNanos`](https://developer.android.com/reference/android/location/GnssClock#getTimeNanos()) -
    The GNSS receiver internal hardware clock value in nanoseconds.

-   [`LeapSecond`](https://developer.android.com/reference/android/location/GnssClock#getLeapSecond()) -
    The leap second associated with the clock's time.

-   [`TimeUncertaintyNanos`](https://developer.android.com/reference/android/location/GnssClock#getTimeUncertaintyNanos()) -
    The clock's time uncertainty (1-sigma) in nanoseconds.

-   [`FullBiasNanos`](https://developer.android.com/reference/android/location/GnssClock#getFullBiasNanos()) -
    The difference between hardware clock
    [getTimeNanos()](https://developer.android.com/reference/android/location/GnssClock#getTimeNanos())
    inside GPS receiver and the true GPS time since 0000Z, January 6,
    1980, in nanoseconds.

-   [`BiasNanos`](https://developer.android.com/reference/android/location/GnssClock#getBiasNanos()) -
    The clock's sub-nanosecond bias.

-   [`BiasUncertaintyNanos`](https://developer.android.com/reference/android/location/GnssClock#getBiasUncertaintyNanos()) -
    The clock's bias uncertainty (1-sigma) in nanoseconds.

-   [`DriftNanosPerSecond`](https://developer.android.com/reference/android/location/GnssClock#getDriftNanosPerSecond()) -
    The clock's drift in nanoseconds per second.

-   [`DriftUncertaintyNanosPerSecond`](https://developer.android.com/reference/android/location/GnssClock#getDriftUncertaintyNanosPerSecond()) -
    The clock's drift uncertainty (1-sigma) in nanoseconds per second.

-   [`HardwareClockDiscontinuityCount`](https://developer.android.com/reference/android/location/GnssClock#getHardwareClockDiscontinuityCount()) -
    Count of hardware clock discontinuities.

-   [`Svid`](https://developer.android.com/reference/android/location/GnssMeasurement#getSvid()) -
    The satellite ID. More info can be found
    [here](https://developer.android.com/reference/android/location/GnssMeasurement#getSvid()).

-   [`TimeOffsetNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getTimeOffsetNanos()) -
    The time offset at which the measurement was taken in nanoseconds.

-   [`State`](https://developer.android.com/reference/android/location/GnssMeasurement#getState()) -
    Integer signifying sync state of the satellite. Each bit in the
    integer attributes to a particular state information of the
    measurement. See the **metadata/raw_state_bit_map.json** file for the mapping between bits and states.

-   [`ReceivedSvTimeNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeNanos()) -
    The received GNSS satellite time, at the measurement time, in
    nanoseconds.

-   [`ReceivedSvTimeUncertaintyNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getReceivedSvTimeUncertaintyNanos()) -
    The error estimate (1-sigma) for the received GNSS time, in
    nanoseconds.

-   [`Cn0DbHz`](https://developer.android.com/reference/android/location/GnssMeasurement#getCn0DbHz()) -
    The carrier-to-noise density in dB-Hz.

-   [`PseudorangeRateMetersPerSecond`](https://developer.android.com/reference/android/location/GnssMeasurement#getPseudorangeRateMetersPerSecond()) -
    The pseudorange rate at the timestamp in m/s.

-   [`PseudorangeRateUncertaintyMetersPerSecond`](https://developer.android.com/reference/android/location/GnssMeasurement#getPseudorangeRateUncertaintyMetersPerSecond()) -
    The pseudorange's rate uncertainty (1-sigma) in m/s.

-   [`AccumulatedDeltaRangeState`](https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeState()) -
    This indicates the state of the 'Accumulated Delta Range'
    measurement. Each bit in the integer attributes to state of the measurement. See the **metadata/accumulated_delta_range_state_bit_map.json** file for the mapping between bits and states.

-   [`AccumulatedDeltaRangeMeters`](https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeMeters()) -
    The accumulated delta range since the last channel reset, in
    meters.

-   [`AccumulatedDeltaRangeUncertaintyMeters`](https://developer.android.com/reference/android/location/GnssMeasurement#getAccumulatedDeltaRangeUncertaintyMeters()) -
    The accumulated delta range's uncertainty (1-sigma) in meters.

-   [`CarrierFrequencyHz`](https://developer.android.com/reference/android/location/GnssMeasurement#getCarrierFrequencyHz()) -
    The carrier frequency of the tracked signal.

-   [`CarrierCycles`](https://developer.android.com/reference/android/location/GnssMeasurement#getCarrierCycles()) -
    The number of full carrier cycles between the satellite and the
    receiver. Null in these datasets.

-   [`CarrierPhase`](https://developer.android.com/reference/android/location/GnssMeasurement#getCarrierPhase()) -
    The RF phase detected by the receiver. Null in these datasets.

-   [`CarrierPhaseUncertainty`](https://developer.android.com/reference/android/location/GnssMeasurement#getCarrierPhaseUncertainty()) -
    The carrier-phase's uncertainty (1-sigma). Null in these
    datasets.

-   [`MultipathIndicator`](https://developer.android.com/reference/android/location/GnssMeasurement#getMultipathIndicator()) -
    A value indicating the 'multipath' state of the event.

-   [`SnrInDb`](https://developer.android.com/reference/android/location/GnssMeasurement#getSnrInDb()) -
    The (post-correlation & integration) Signal-to-Noise ratio (SNR)
    in dB.

-   [`ConstellationType`](https://developer.android.com/reference/android/location/GnssMeasurement#getConstellationType()) -
    GNSS constellation type. It's an integer number, whose mapping to string value is provided in the constellation_type_mapping.csv file.

-   [`AgcDb`](https://developer.android.com/reference/android/location/GnssMeasurement#getAutomaticGainControlLevelDb()) -
    The Automatic Gain Control level in dB.

-   [`BasebandCn0DbHz`](https://developer.android.com/reference/android/location/GnssMeasurement#getBasebandCn0DbHz()) -
    The baseband carrier-to-noise density in dB-Hz. Only available in Android 11.

-   [`FullInterSignalBiasNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getFullInterSignalBiasNanos()) -
    The GNSS measurement's inter-signal bias in nanoseconds with
    sub-nanosecond accuracy. Only available in Pixel 5 logs in 2021.
    Only available in Android 11.

-   [`FullInterSignalBiasUncertaintyNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getFullInterSignalBiasUncertaintyNanos()) -
    The GNSS measurement's inter-signal bias uncertainty (1 sigma) in
    nanoseconds with sub-nanosecond accuracy. Only available in Android 11.

-   [`SatelliteInterSignalBiasNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getSatelliteInterSignalBiasNanos()) -
    The GNSS measurement's satellite inter-signal bias in nanoseconds
    with sub-nanosecond accuracy. Only available in Android 11.

-   [`SatelliteInterSignalBiasUncertaintyNanos`](https://developer.android.com/reference/android/location/GnssMeasurement#getSatelliteInterSignalBiasUncertaintyNanos()) -
    The GNSS measurement's satellite inter-signal bias uncertainty (1
    sigma) in nanoseconds with sub-nanosecond accuracy. Only available
    in Android 11.

-   [`CodeType`](https://developer.android.com/reference/android/location/GnssMeasurement#getCodeType()) -
    The GNSS measurement's code type. Only available in recent logs.

-   [`ChipsetElapsedRealtimeNanos`](https://developer.android.com/reference/android/location/GnssClock#getElapsedRealtimeNanos()) -
    The elapsed real-time of this clock since system boot, in
    nanoseconds. Only available in recent logs.
Status - The status of a GNSS signal, as collected from the Android API [GnssStatus](https://developer.android.com/reference/android/location/GnssStatus.Callback).

* `UnixTimeMillis` - Milliseconds since UTC epoch (1970/1/1),
    reported from the last location changed by [GPS](https://developer.android.com/reference/android/location/LocationManager#GPS_PROVIDER)
    provider.

* [`SignalCount`](https://developer.android.com/reference/android/location/GnssStatus#getSatelliteCount()) -
    The total number of satellites in the satellite list.

* `SignalIndex` - The index of current signal.

* [`ConstellationType`](https://developer.android.com/reference/android/location/GnssStatus#getConstellationType(int)):
    The constellation type of the satellite at the specified index.

* [`Svid`](https://developer.android.com/reference/android/location/GnssStatus#getSvid(int)):
    The satellite ID.

* [`CarrierFrequencyHz`](https://developer.android.com/reference/android/location/GnssStatus#getCarrierFrequencyHz(int)):
    The carrier frequency of the signal tracked.

* [`Cn0DbHz`](https://developer.android.com/reference/android/location/GnssStatus#getCn0DbHz(int)):
    The carrier-to-noise density at the antenna of the satellite at
    the specified index in dB-Hz.

* [`AzimuthDegrees`](https://developer.android.com/reference/android/location/GnssStatus#getAzimuthDegrees(int)):
    The azimuth the satellite at the specified index.

* [`ElevationDegrees`](https://developer.android.com/reference/android/location/GnssStatus#getElevationDegrees(int)):
    The elevation of the satellite at the specified index.

* [`UsedInFix`](https://developer.android.com/reference/android/location/GnssStatus#usedInFix(int)):
    Whether the satellite at the specified index was used in the calculation of the most recent position fix.

* [`HasAlmanacData`](https://developer.android.com/reference/android/location/GnssStatus#hasAlmanacData(int)):
    Whether the satellite at the specified index has almanac data.

* [`HasEphemerisData`](https://developer.android.com/reference/android/location/GnssStatus#hasEphemerisData(int)):
    Whether the satellite at the specified index has ephemeris data.

* [`BasebandCn0DbHz`](https://developer.android.com/reference/android/location/GnssStatus#getBasebandCn0DbHz(int)):
    The baseband carrier-to-noise density of the satellite at the specified index in dB-Hz.
UncalAccel - Readings from the uncalibrated accelerometer, as collected from the Android API [Sensor\#TYPE_ACCELEROMETER_UNCALIBRATED](https://developer.android.com/reference/android/hardware/Sensor#TYPE_ACCELEROMETER_UNCALIBRATED).

* `utcTimeMillis` - The sum of `elapsedRealtimeNanos` below and the
    estimated device boot time at UTC, after a recent NTP (Network Time Protocol) sync.

* [`elapsedRealtimeNanos`](https://developer.android.com/reference/android/hardware/SensorEvent#timestamp):
    The time in nanoseconds at which the event happened.

* `UncalAccel[X/Y/Z]Mps2` - [x/y/z]_uncalib without bias compensation.

* `Bias[X/Y/Z]Mps2` - Estimated [x/y/z]_bias. Null in datasets collected in
    earlier dates.
UncalGyro - Readings from the uncalibrated gyroscope, as collected from the Android API
[Sensor\#TYPE_GYROSCOPE_UNCALIBRATED](https://developer.android.com/reference/android/hardware/Sensor#TYPE_GYROSCOPE_UNCALIBRATED).

* `utcTimeMillis` - The sum of `elapsedRealtimeNanos` below and the
    estimated device boot time at UTC, after a recent NTP (Network Time Protocol) sync.

* [`elapsedRealtimeNanos`](https://developer.android.com/reference/android/hardware/SensorEvent#timestamp):
    The time in nanoseconds at which the event happened.

* `UncalGyro[X/Y/Z]RadPerSec` - Angular speed (w/o drift compensation) around the [X/Y/Z] axis in rad/s.

* `Drift[X/Y/Z]RadPerSec` - Estimated drift around [X/Y/Z] axis in rad/s. Null in datasets collected in earlier dates.
UncalMag - Readings from the uncalibrated magnetometer as collected from the Android API [Sensor\#STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED](https://developer.android.com/reference/android/hardware/Sensor#STRING_TYPE_MAGNETIC_FIELD_UNCALIBRATED).


* `utcTimeMillis` - The sum of `elapsedRealtimeNanos` below and the
    estimated device boot time at UTC, after a recent NTP (Network Time Protocol) sync.

* [`elapsedRealtimeNanos`](https://developer.android.com/reference/android/hardware/SensorEvent#timestamp):
    The time in nanoseconds at which the event happened.

* `UncalMag[X/Y/Z]MicroT` - [x/y/z]_uncalib without bias compensation.

* `Bias[X/Y/Z]MicroT` - Estimated [x/y/z]_bias. Null in datasets collected in earlier dates.
OrientationDeg - Each row represents an estimated device orientation, collected from Android API [SensorManager\#getOrientation](https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float%5B%5D,%20float%5B%5D)).
This message is only available in logs collected since March 2021.

* `utcTimeMillis` - The sum of `elapsedRealtimeNanos` below and the
    estimated device boot time at UTC, after a recent NTP (Network Time Protocol) sync.

* [`elapsedRealtimeNanos`](https://developer.android.com/reference/android/hardware/SensorEvent#timestamp) - The time in nanoseconds at which the event happened.

* `yawDeg` - If the screen is in portrait mode, this value equals the
    Azimuth degree (modulus to 0°~360°). If the screen is in
    landscape mode, it equals the sum (modulus to 0°~360°) of the
    screen rotation angle (either 90° or 270°) and the Azimuth degree.
    *Azimuth*, refers to the angle of rotation about the -z axis. This
    value represents the angle between the device's y axis and the
    magnetic north pole.

* `rollDeg` - *Roll*, angle of rotation about the y axis. This value
    represents the angle between a plane perpendicular to the
    device's screen and a plane perpendicular to the ground.

* `pitchDeg` - *Pitch*, angle of rotation about the x axis. This
    value represents the angle between a plane parallel to the
    device's screen and a plane parallel to the ground.