/// <summary> /// Handle GPS GPGLL Notifications - Primary Position /// </summary> /// <param name="notification">GPGLL packet notification</param> private void GpGllHandler(gps.GpGllNotification notification) { /* * GLL - Geographic Latitude and Longitude is a holdover from Loran data and some old units may not send the time and data active information if they are emulating Loran data. * If a gps is emulating Loran data they may use the LC Loran prefix instead of GP. * * $GPGLL,4916.45,N,12311.12,W,225444,A,*1D * * Where: * GLL Geographic position, Latitude and Longitude * 4916.46,N Latitude 49 deg. 16.45 min. North * 12311.12,W Longitude 123 deg. 11.12 min. West * 225444 Fix taken at 22:54:44 UTC * A Data Active or V (void) * iD checksum data * * Note that, as of the 2.3 release of NMEA, there is a new field in the GLL sentence at the end just prior to the checksum. For more information on this field see here. */ if (!_mapperVicinity.robotState.ignoreGps) { if (!notification.Body.IsValid) { Tracer.Error("the GPS reported GPGGA with IsValid=false"); } else { if (traceGps) { Tracer.Trace(string.Format("the GPS reported GPGLL: {0} Lat: {1} Lon: {2}", notification.Body.LastUpdate, notification.Body.Latitude, notification.Body.Longitude)); } GpsState state = _state.gpsState; // Position Fix Indicator: state.GPGLL_MarginOfError = notification.Body.MarginOfError; // Altitude: state.GPGLL_Status = notification.Body.Status; // Coordinates: state.GPGLL_Latitude = notification.Body.Latitude; state.GPGLL_Longitude = notification.Body.Longitude; // Last Updated: state.GPGLL_LastUpdate = notification.Body.LastUpdate; if (!_testBumpMode && !_state.Dropping && !_doUnitTest) { Decide(SensorEventSource.Gps); } } } }
/// <summary> /// Handle GPS GPGLL Notifications - Primary Position /// </summary> /// <param name="notification">GPGLL packet notification</param> private void GpGllHandler(gps.GpGllNotification notification) { Tracer.Trace(string.Format("the GPS reported GPGLL: {0} Lat: {1} Lon: {2}", notification.Body.LastUpdate, notification.Body.Latitude, notification.Body.Longitude)); }