Reply To: Getting Lat, lng from GPS at the occurrance of an event

Home Forums Forums General discussion Getting Lat, lng from GPS at the occurrance of an event Reply To: Getting Lat, lng from GPS at the occurrance of an event

#17645
djmaxwell
Participant

First, the timeout value is how long your read will block waiting for the data.

Moving on to the other part of your question, the GGA messages come at a fixed rate from the GPS.  This defaults to 1Hz, but many modules allow you to increase that. You want to be continually reading the data and potentially storing at least some amount of history.

If you are wanting to get the position at a specific time, you have a few options, depending on your velocity and accuracy needs.

1) The simplest approach would be to take the most recent GPS position as the requested position

2) Dead reckon to the requested time. This would use your data history to calculate where you will be at the requested time.

3) Wait for the next position message and interpolate between the two positions to the requested time.

Blip, blop, bloop…