gpsprof
measures the various latencies between a GPS and its client. It emits to standard output a GNUPLOT program that draws an illustrative graph. It can also be told to emit the raw profile data. The information it provides can be useful for establishing an upper bound on latency, and thus on position accuracy of a GPS in motion.
gpsprof
uses instrumentation built into
gpsd.
To display the graph, use
gnuplot(1). Thus, for example, to display the default spatial scatter plot, do this:
-
gpsprof | gnuplot -persist
OPTIONS
The -f option sets the plot type. The X axis is samples (sentences with timestamps). The Y axis is normally latency in seconds. Currently the following plot types are defined:
space
-
Generate a scattergram of fixes and plot a probable-error circle. This data is only meaningful if the GPS is held stationary while
gpsprof
is running. This is the default.
uninstrumented
-
Plot total latency without instrumentation. Useful mainly as a check that the instrumentation is not producing significant distortion. It only plots times for sentences that contain fixes; staircase-like artifacts in the plot are created when elapsed time from sentences without fixes is lumped in.
raw
-
Plot raw data.
split
-
Each sentence has its RS232 latency time colored differently.
cycle
-
Report on the set of sentences or packets emitted by the GPS, their send intervals, and the basic cycle time. (This report is plain text rather than a gnuplot script.)
The instrumented time plot conveys the following information:
RS232 time
-
Minimum time required to send the sentence from the GPS to
gpsd. This is computed, not measured, and may be an underestimate.
Other line latency
-
The transmission latency between the GPS and
gpsd
not accounted for by RS232 time. Total line latency (the sum of this bar and RS232 time) is measured; it begins with the GPS sentence's timestamp and ends with a timestamp that
gpsd
generates at sentence-reading time, before it is decoded.
Decode time
-
Elapsed time between sentence reception and the moment that
gpsd
ships the resulting update to the profiling client.
TCP/IP latency
-
Elapsed time between the moment that
gpsd
ships the update to the profiling client and the moment it is decoded and timestamped.
Because of RS232 buffering effects, the profiler sometimes generates reports of ridiculously high latencies right at the beginning of a session. The -m option lets you set a latency threshold, in multiples of the cycle time, above which reports are discarded.
The -n option sets the number of packets to sample. The default is 100.
The -s option sets the baud rate. Note, this will only work if the chipset accepts a speed-change command (SiRFstarII and SiRFstarIII support this feature).
The -t option sets a text string to be included in the plot title.
The -h option makes
gpsprof
print a usage message and exit.
BUGS AND LIMITAIONS
Probably overestimates TCP/IP latency somewhat, as that includes the Python interpreter's decode time. A C client would be faster.
SEE ALSO
gpsd(8),
gps(1),
libgps(3),
libgpsd(3),
gpsfake(1),
gpsctl(1),
gpscat(1),
gnuplot(1).
AUTHOR
Eric S. Raymond
<esr@thyrsus.com>. There is a project page for
gpsd
here[1].
NOTES
- 1.
-
here
-
http://gpsd.berlios.de/