예제 #1
0
 private UTMData getFilteredData(UTMData n)
 {
     double dx = n.East - _state.Coords.East;
     double dy = n.North - _state.Coords.North;
     double dist = Math.Sqrt(dx * dx + dy * dy);
     dist /= FILTER_DIVISOR;
     if (dist > FILTER_CAP) dist = FILTER_CAP;
     dist *= FILTER_MULTIPLIER;
     dist += FILTER_OFFSET;
     n.North = _state.Coords.North + dist * dy;
     n.East = _state.Coords.East + dist*dx;
     _state.Coords = n;
     return n;
 }
예제 #2
0
        private void DataReceivedHandler(UTMData d)
        {
            Console.WriteLine("Received GPS data");
            _state.Coords = d;

            SendNotification(_subMgrPort, new UTMNotification(d)); 
        }
예제 #3
0
        private void DataReceivedHandler(UTMData d)
        {
            //Console.WriteLine("Received GPS data");

            /*Implements a simple filter that uses the DOP (Number of Satellites) 
             * information from the measurements to weight the GPS data */
            if (!first_coord)
            {
                /*float alpha = 2 * (float)d.NumSat / (float)MAX_SAT;
                d.East = (1 - alpha) * _state.Coords.East + d.East;
                d.North = (1 - alpha) * _state.Coords.North + d.North;
                _state.Coords = d;*/

                d = getFilteredData(d);
            }
            else
            {
                _state.Coords = d;
                first_coord = false;
            }
            SendNotification(_subMgrPort, new UTMNotification(_state.Coords)); 
        }