Ejemplo n.º 1
0
        /// <summary>
        /// Handle GPS GPGSV Notifications - Satellites In View
        /// </summary>
        /// <param name="notification">GPGSV packet notification</param>
        private void GpGsvHandler(gps.GpGsvNotification notification)
        {
            /*
             *  GSV - Satellites in View shows data about the satellites that the unit might be able to find based on its viewing mask and almanac data.
             *          It also shows current ability to track this data. Note that one GSV sentence only can provide data for up to 4 satellites and thus there may need to be 3 sentences for the full information.
             *          It is reasonable for the GSV sentence to contain more satellites than GGA might indicate since GSV may include satellites that are not used as part of the solution.
             *          It is not a requirment that the GSV sentences all appear in sequence.
             *          To avoid overloading the data bandwidth some receivers may place the various sentences in totally different samples since each sentence identifies which one it is.
             *
             *          The field called SNR (Signal to Noise Ratio) in the NMEA standard is often referred to as signal strength.
             *          SNR is an indirect but more useful value that raw signal strength.
             *          It can range from 0 to 99 and has units of dB according to the NMEA standard, but the various manufacturers send different ranges of numbers with different starting numbers
             *          so the values themselves cannot necessarily be used to evaluate different units. The range of working values in a given gps will usually show a difference of about 25 to 35 between the lowest and highest values,
             *          however 0 is a special case and may be shown on satellites that are in view but not being tracked.
             *
             *    $GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75
             *
             *  Where:
             *        GSV          Satellites in view
             *        2            Number of sentences for full data
             *        1            sentence 1 of 2
             *        08           Number of satellites in view
             *
             *        01           Satellite PRN number
             *        40           Elevation, degrees
             *        083          Azimuth, degrees
             *        46           SNR - higher is better
             *             for up to 4 satellites per sentence
             * 75          the checksum data, always begins with *
             */

            if (!_mapperVicinity.robotState.ignoreGps)
            {
                if (!notification.Body.IsValid)
                {
                    Tracer.Error("the GPS reported GPGSV with IsValid=false");
                }
                else
                {
                    if (traceGps)
                    {
                        Tracer.Trace(string.Format("the GPS reported GPGSV: {0} Satellites in View: {1}   {2}", notification.Body.LastUpdate, notification.Body.GsvSatellites.Count, notification.Body.SatellitesInView));
                    }

                    GpsState state = _state.gpsState;

                    // Number of Satellites In View
                    state.GPGSV_SatellitesInView = notification.Body.SatellitesInView;

                    // Last Updated:
                    state.GPGSV_LastUpdate = notification.Body.LastUpdate;

                    if (!_testBumpMode && !_state.Dropping && !_doUnitTest)
                    {
                        Decide(SensorEventSource.Gps);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Handle GPS GPGSV Notifications - Satellites
 /// </summary>
 /// <param name="notification">GPGSV packet notification</param>
 private void GpGsvHandler(gps.GpGsvNotification notification)
 {
     Tracer.Trace(string.Format("the GPS reported GPGSV: {0} Satellites in View: {1}   {2}", notification.Body.LastUpdate, notification.Body.GsvSatellites.Count, notification.Body.SatellitesInView));
 }