summaryrefslogtreecommitdiff
path: root/rtcm-104.xml
blob: 8118dcabbfa2a532f6315999eff2d56f1e92308d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC 
   "-//OASIS//DTD DocBook XML V4.1.2//EN"
   "docbook/docbookx.dtd">
<refentry id='rtcm104.5'>
<refmeta>
<refentrytitle>rtcm-104</refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class='date'>12 Jul 2005</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>rtcm-104</refname>
<refpurpose>RTCM-104 dump format emitted by GPSD tools</refpurpose>
</refnamediv>

<refsect1 id='overview'><title>OVERVIEW</title>

<para>RTCM-104 is a family of serial protocols used for broadcasting pseudorange
corrections from differential-GPS reference stations.  This manual
page describes some aspects of the RTCM protocol, mainly in order to
explain the RTCM-104 dump format emitted by
<citerefentry><refentrytitle>gpsdecode</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
It describes that dump format completely.</para>

<para>RTCM-104 comes in two major and incompatible flavors, 2.x and
3.x.  Each major flavor has minor (compatible) revisions.</para>

<para>The applicable standard for RTCM Version 2.x is <citetitle>RTCM
Recommended Standards for Differential NAVSTAR GPS Service</citetitle>
RTCM Paper 194-93/SC 104-STD. For RTCM 3.1 it is <citetitle>RTCM Paper
177-2006-SC104-STD</citetitle>.  Ordering instructions for both
standards are accessible from the website of the <ulink
url='http://www.rtcm.org/'>Radio Technical Commission for Maritime
Services</ulink> under "Publications".</para>

</refsect1>
<refsect1 id='wire-format'><title>RTCM WIRE TRANSMISSIONS</title>

<para>Differential-GPS correction stations consist of a GPS reference
receiver coupled to a low frequency (LF) transmitter.  The GPS
reference receiver is a survey-grade GPS that does GPS carrier
tracking and can work out its own position to a few millimeters.  It
generates range and range-rate corrections and encodes them into
RTCM104. It ships the RTCM104 to the LF transmitter over serial rs-232
signal at 100 baud or 200 baud depending on the requirements of the
transmitter.</para>

<para>The LF transmitter broadcasts the the approximately 300khz radio
signal that differential-GPS radio receivers pick up.  Transmitters
that are meant to have a higher range will need to transmit at the
slower rate.  The higher the data rate the harder it will be for the
remote radio receiver to receive with a good signal-to-noise ration.
(Higher data rate signals can't be averaged over as long a time frame,
hence they appear noisier.)</para>

</refsect1>
<refsect1 id='rtcm-wire-format'><title>RTCM WIRE FORMATS</title>

<para>An RTCM 2.x message consists of a sequence of up to 33 30-bit
words. The 24 most significant bits of each word are data and the six
least significant bits are parity. The parity algorithm used is the
same ISGPS-2000 as that used on GPS satellite downlinks.  Each RTCM
2.x message consists of two header words followed by zero or more data
words, depending upon message type.</para>

<para>An RTCM 3.x message begins with a fixed leader byte 0xD3.  That
is followed by six bits of version information and 10 bits of payload
length information.  Following that is the payload; following the 
payload is a 3-byte checksum of the payload using the Qualcomm CRC-24Q
algorithm.</para>

</refsect1>
<refsect1 id='dump-format2'><title>RTCM2 DUMP FORMAT</title>

<para>For each message, the header is listed first, followed by zero
or more lines containing the specific data for that message, followed
by a trailing sentinel line containing a single dot. The general format is a
line beginning with a capital letter, followed by a tab, followed by
the fields of the message separated by tabs, terminated by a
newline.</para>

<refsect2><title>Header message (H)</title>

<literallayout>
H &lt;message type&gt; &lt;reference station id&gt; &lt;modified z_count&gt; &lt;sequence no&gt;
  &lt;message length&gt; &lt;station health&gt; [T &lt;useful length&gt;]
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
H	9	268	249.6	1	5	0
S	13	0	3	249.6	-26.120	0.068
S	2	0	73	249.6	1.220	-0.080
S	8	0	22	249.6	23.760	0.030
.
</literallayout></informalexample>

<para>&lt;message type&gt; is one of</para>

<variablelist>
<varlistentry>
<term>1</term>
<listitem><para>full corrections - one message containing corrections for
all satellites in view. This is not common.</para></listitem>
</varlistentry>

<varlistentry>
<term>3</term>
<listitem><para>reference station parameters - the position of the
reference station GPS antenna.</para></listitem>
</varlistentry>

<varlistentry>
<term>4</term>
<listitem><para>datum &mdash; the datum to which the DGPS data is
referred.</para></listitem>
</varlistentry>

<varlistentry>
<term>5</term>
<listitem><para>constellation health &mdash; information about the
satellites the beacon can see</para></listitem>
</varlistentry>

<varlistentry>
<term>6</term>
<listitem><para>null message &mdash; just a filler.</para></listitem>
</varlistentry>

<varlistentry>
<term>7</term>
<listitem><para>radio beacon almanac &mdash; information about this or other beacons.</para></listitem>
</varlistentry>

<varlistentry>
<term>9</term>
<listitem><para>subset corrections &mdash; a message containing corrections
for only a subset of the satellites in view.</para></listitem>
</varlistentry>

<varlistentry>
<term>16</term>
<listitem><para>special message &mdash; a text message from the beacon
operator.</para></listitem>
</varlistentry>
</variablelist>

<para>&lt;reference station id&gt; is the id of the GPS reference receiver. The
LF transmitters also have (different) id numbers.</para>

<para>&lt;modified z_count&gt; is the reference time of the
corrections in the message in seconds within the current hour. Note
that it is in GPS time, which is some seconds ahead of UTC (see the
U.S. Naval Observatory's <ulink
url="ftp://maia.usno.navy.mil/ser7/tai-utc.dat">table of leap second
corrections</ulink>).</para>

<para>&lt;sequence no&gt; is a number which increments, modulo 8, for each
message transmitted.</para>

<para>&lt;message length&gt; is the number of words after the header that
comprise the message.</para>

<para>&lt;station health&gt; indicates the health of the beacon as a
reference source.  Any nonzero value means the satellite is probably
transmitting bad data and should not be used in a fix. 6 means the
transmission is unmonitored. 7 means the station is not working
properly. Other values are defined by the beacon operator.
</para>

<para>If the message contains a parity error after the header but before
the end of the message, then the extra fields [T &lt;useful length&gt;]
are appended to indicate a truncated message.</para>

<para>Here is an example:</para>

<informalexample><literallayout>
H	9	687	331.8	1	5	0	T	4
</literallayout></informalexample>

<para>&lt;useful length&gt; indicates the number of useful words before the
parity error. Depending on the message type, useful information
may still be extracted.</para>

</refsect2>
<refsect2><title>Correction data (S)</title>

<para>One or more of these follow the header for type 1 or type 9
messages. Here is the format:</para>

<literallayout>
S &lt;satellite&gt; &lt;udre&gt; &lt;iod&gt; &lt;modified z_count&gt; &lt;range error&gt;
  &lt;range error rate&gt;
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
S	7	0	199	331.8	-12.160	0.288
</literallayout></informalexample>

<para>&lt;satellite&gt; is the PRN number of the satellite for which this is
correction data.</para>

<para>&lt;udre&gt; is User Differential Range Error with the following
values:</para>

<literallayout>
0	1-sigma error	&lt;= 1m
1	1-sigma error	&lt;= 4m
2	1-sigma error	&lt;= 8m
3	1-sigma error	&gt;  8m
</literallayout>

<para>&lt;iod&gt; is Issue Of Data, matching the IOD for the current
ephemeris of this satellite, as transmitted by the satellite.  The IOD
is a unique tag that identifies the ephemeris; the GPS using the DGPS
correction and the DGPS generating the data must use the same orbital
positions for the satellite.</para>

<para>&lt;modified z_count&gt; is just a copy of the same field from
the header.</para>

<para>&lt;range error&gt; is the pseudorange error in meters for this satellite
as measured by the beacon reference receiver at the epoch indicated
by &lt;modified z_count&gt;</para>

<para>&lt;range error rate&gt; is the rate of change of pseudorange error in
meters/sec for this satellite as measured by the beacon reference
receiver at the epoch indicated by &lt;modified z_count&gt;. This is
used to calculate pseudorange errors at other epochs, if
required by the GPS receiver.</para>

</refsect2>
<refsect2><title>Reference Station Parameters (R)</title>

<para>Here is the format:</para>

<literallayout>
R &lt;X-coordinate&gt; &lt;Y-coordinate&gt; &lt;Z-coordinate&gt;
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
R	3746729.40	-5086.23	5144450.67
</literallayout></informalexample>

<para>The coordinates are the position of the station, in meters to two
decimal places, in Earth Centred Earth Fixed coordinates.
These are usually referred to the WGS84 reference frame, but may
be referred to NAD83 in the US (essentially identical to WGS84 for
all except geodesists), or to some other reference frame in other
parts of the world.</para>

</refsect2>
<refsect2><title>Datum (D)</title>

<para>Here is the format:</para>

<literallayout>
D &lt;dgnss type&gt; &lt;dat&gt; &lt;datum name&gt; [ &lt;dx&gt; &lt;dy&gt; &lt;dz&gt; ]
</literallayout>

<para>Here is an (artificial) example:</para>

<informalexample><literallayout>
D	GPS	0	ABC12	25.8	30.5	33.0
</literallayout></informalexample>

<para>&lt;dgnss type&gt; is either GPS or GLONASS.</para>

<para>&lt;dat&gt; is 0 or 1 and indicates the sense of the offset
shift given by dx, dy, dz. dat = 0 means that the station coordinates
(in the reference message) are referred to a local datum and that
adding dx, dy, dz to that position will render it in GNSS coordinates
(WGS84 for GPS). If dat = 1 then the ref station position is in GNSS
coordinates and adding dx, dy, dz will give it referred to the local
datum.</para>

<para>&lt;datum name&gt; is a standard name for the datum.</para>

<para>&lt;dx&gt; &lt;dy&gt; &lt;dz&gt; are offsets to convert from
local datum to GNSS datum or vice versa. These fields are
optional.</para>

</refsect2>
<refsect2><title>Constellation Health (C)</title>

<para>One or more of these follow the header for type 5 messages &mdash; one
for each satellite.</para>

<para>Here is the format:</para>

<literallayout>
C &lt;sat&gt; &lt;iodl&gt; &lt;health&gt; &lt;snr&gt; &lt;hlth en&gt; &lt;new data&gt; &lt;los warning&gt;
  &lt;time to unhealthy&gt;
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
C	29	0  0	53	0  0  0	 0
</literallayout></informalexample>

<para>&lt;sat&gt; is the PRN number of the satellite.</para>

<para>&lt;iodl&gt; is 1 bit. 0 indicates that this information relates to the
satellite information in an accompanying type 1 or type 9 message.</para>

<para>&lt;health&gt; 0 indicates that the satellite is healthy. Any other value
indicates a problem (coding is not known).</para>

<para>&lt;snr&gt; gives the carrier/noise ratio of the received signal in the
range 25 to 55 dB(Hz).</para>

<para>&lt;health en&gt; is 1 bit. If set to 1 it indicates that the
satellite is healthy even if the satellite navigation data says it is
unhealthy.</para>

<para>&lt;new data&gt; is 1 bit. a 1 indicates that the IOD for this
satellite will soon be updated in type 1 or 9 messages.</para>

<para>&lt;los warning&gt; is 1 bit. a 1 indicates that the satellite
will shortly go unhealthy. The healthy time remaining is given in the
&lt;time to unhealthy&gt; field.</para>

</refsect2>
<refsect2><title>Radio Beacon Almanac (A)</title>

<para>Here is the format:</para>

<literallayout>
A &lt;latitude&gt; &lt;longitude&gt; &lt;range&gt; &lt;frequency&gt; &lt;health&gt; &lt;station id&gt;
  &lt;bitrate&gt;
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
A	54.1176	-0.0714	100	302.5	0	447	2
</literallayout></informalexample>

<para>&lt;latitude&gt; and &lt;longitude&gt; give the position, in
degrees, of the LF transmitter antenna for the station for which this
is an almanac.  North and East are positive.</para>

<para>&lt;range&gt; is the published range of the station in km.</para>

<para>&lt;frequency&gt; is the broadcast frequency in kHz.</para>

<para>&lt;health&gt; is the health of the station for which this is an
almanac. If it is non-zero, the station is issuing suspect data and
should not be used for fixes.  The ITU and RTCM104 standards differ
about the mode detailed interpretation of
the &lt;health&gt; field and even about its bit width.
<!--
From itu p.9 just under the type7 msg figure:
 
    *** Radiobeacon health:
                  00     (0) Radiobeacon operation normal
                  01     (1) No integrity monitor operating
                  10     (2) No information available
                  11     (3) Do not use this radiobeacon
RTCM104, in the other hand, makes it 3 bits wide.

The Sager documentation said health has the same meaning as in the header.
but this cannot be true unless the field is 3 bits wide.
-->
</para>

<para>&lt;station id&gt; is the id of the transmitter. This is not the same
as the reference id in the header, the latter being the id of
the reference receiver. 
<!-- John Sager noted: "However I know of at least one station
that gets it wrong." --></para>

<para>&lt;bitrate&gt; indicates the transmitted bitrate.</para>

</refsect2>
<refsect2><title>Special Message (T)</title>

<para>Here is the format:</para>

<literallayout>
T &lt;text&gt;
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
T	THLS TRIAL SERVICE
</literallayout></informalexample>

<para>&lt;text&gt; is just a text message sent by the beacon operator.</para>

</refsect2>
<refsect2><title>Null (N)</title>

<para>This just indicates a null message. There are no fields.</para>
</refsect2>
<refsect2><title>Unknown message (U)</title>
<!-- The Sager decoder didn't have this -->

<para>This is used to dump message words in hexadecimal when the
message type field doesn't match any of the known ones.</para>

<para>Here is the format:</para>

<literallayout>
U &lt;hex-literal&gt;
</literallayout>

<para>Here is an example:</para>

<informalexample><literallayout>
U	0x76423055
</literallayout></informalexample>

<para>The &lt;hex-literal&gt; will represent 32 bits of information,
after parity checks and inversion.  The high two bits should be
ignored.</para>

</refsect2>
<refsect2><title>Null (N)</title>

<para>This just indicates a null message. There are no fields.</para>
</refsect2>

<!--
Decoder Status Messages (M)

format:

M &lt;type&gt;: &lt;information&gt;

examples:

M	state change: NO_SYNC -&gt; WORD_SYNCING
M	sync_bit: 5

&lt;type&gt; indicates textually the type of message. There are
only the two types shown above.

&lt;information&gt;
For &lt;type&gt; = state change it describes the internal state
transition of the decoder when it changes state as a result
of the incoming data.

For &lt;type&gt; = sync_bit this indicates the bit position in the
serial data stream which is a word boundary.
-->

</refsect1>
<refsect1 id='dump-format3'><title>RTCM3 DUMP FORMAT</title>

<para>RTCM104v3 messages are too complex to be dumped in a fully 
invertible form without a structural markup at least as complex as
XML or YAML.  Accordingly, the dump format has been designed to be
its own documentation at the expense of reparsability, and is
not described here.</para>

</refsect1>
<refsect1 id='see_also'><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsprof</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsect1>

<refsect1 id='compatibility'><title>COMPATIBILITY NOTE</title> 

<para>In versions of the RTCM2 dump format prior to gpsd 2.28, there was
no trailing sentinel line after each stanza of the dump.</para>

</refsect1>
<refsect1 id='maintainer'><title>AUTHOR</title> 

<para>Much of the portion of this text describing RTCM2 was originally
written by John Sager <email>john.sager@btinternet.com</email> in
association with his RTCM decoder. Other material comes from the GPSD
project.  There is a project page for <application>gpsd</application>
<ulink url="http://gpsd.berlios.de/">here</ulink>.</para>

</refsect1>

</refentry>