/// <summary> /// Handle GPS GPRMC Notifications - Backup course, speed, and position (Sirf III sends this) - Time, date, position, course and speed data /// </summary> /// <param name="notification">GPRMC packet notification</param> private void GpRmcHandler(gps.GpRmcNotification notification) { /* * RMC - NMEA has its own version of essential gps pvt (position, velocity, time) data. It is called RMC, The Recommended Minimum, which will look similar to: * * $GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A * * Where: * RMC Recommended Minimum sentence C * 123519 Fix taken at 12:35:19 UTC * A Status A=active or V=Void. * 4807.038,N Latitude 48 deg 07.038' N * 01131.000,E Longitude 11 deg 31.000' E * 022.4 Speed over the ground in knots * 084.4 Track angle in degrees True * 230394 Date - 23rd of March 1994 * 003.1,W Magnetic Variation * 6A The checksum data, always begins with * * * Note that, as of the 2.3 release of NMEA, there is a new field in the RMC sentence at the end just prior to the checksum: * * The last version 2 iteration of the NMEA standard was 2.3. It added a mode indicator to several sentences which is used to indicate the kind of fix the receiver currently has. * This indication is part of the signal integrity information needed by the FAA. The value can be A=autonomous, D=differential, E=Estimated, N=not valid, S=Simulator. * Sometimes there can be a null value as well. Only the A and D values will correspond to an Active and reliable Sentence. * This mode character has been added to the RMC, RMB, VTG, and GLL, sentences and optionally some others including the BWC and XTE sentences. */ if (!_mapperVicinity.robotState.ignoreGps) { if (!notification.Body.IsValid) { Tracer.Error("the GPS reported GPRMC with IsValid=false"); } else { if (traceGps) { Tracer.Trace(string.Format("the GPS reported GPRMC: {0} Lat: {1} Lon: {2}", notification.Body.LastUpdate, notification.Body.Latitude, notification.Body.Longitude)); } GpsState state = _state.gpsState; // Status (like "A"): state.GPRMC_Status = notification.Body.Status; // Latitude state.GPRMC_Latitude = notification.Body.Latitude; // Longitude: state.GPRMC_Longitude = notification.Body.Longitude; // Last Updated: state.GPRMC_LastUpdate = notification.Body.LastUpdate; if (!_testBumpMode && !_state.Dropping && !_doUnitTest) { Decide(SensorEventSource.Gps); } } } }
/// <summary> /// Handle GPS GPRMC Notifications - Backup course, speed, and position (Sirf III sends this) /// </summary> /// <param name="notification">GPRMC packet notification</param> private void GpRmcHandler(gps.GpRmcNotification notification) { Tracer.Trace(string.Format("the GPS reported GPRMC: {0} Lat: {1} Lon: {2}", notification.Body.LastUpdate, notification.Body.Latitude, notification.Body.Longitude)); }