summaryrefslogtreecommitdiff
path: root/RocketViewGpsNode.mdwn
blob: d921d3d84576ed10f7c547cce6d6603e74b07274 (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
# <a name="GPS Node Display in rocketview"></a> GPS Node Display in rocketview

Note: Message IDs are described in the form `DEFINED_MESSAGE_NAME = [16bit ID] = [11bit ID] [RTR] [length] [byte0] ... [byte7]`, where the 16bit ID is the 16 bit "packed value" of the ID (11 bits CAN ID + 1 bit RTR + 4 bits length).

If the data is unknown - for example, because no message has been received yet - then display a dash (-).

<table border=1>
  <tr>
    <td><pre>
GPS Node ([-|Safe|Armed])

Lat:  [-|xx deg xx.xxx&#39;]N
Lon:  [-|xxx deg xx.xxx&#39;]W
Alt:  [-|[xx,xxx]m (xx,xxxft)]

Sats: [-/-|0/0]

Locked:   [-|Yes|No]
Solution: [-|OK|Propated|Alt. used|PM]
Validity: [-|OK|Alt. used|Num sats|EHPE|EVPE]
</pre></td>
  </tr>
</table>

`sequencer`, running on the flight computer, takes the RAW binary GPS messages from the CAN bus and parses them into shorter messages for rocketview to display.

The GPS mode is set by `GPS_REPORT_MODE = 4B10 = 258 0 1 [mode]` where `mode` is:

- 0x34 = `Safe`
- 0x88 = `Armed`

`Solution` (the GPS solution type, or quality) is set by `FC_GPS_NAVSOL` byte 0 and byte 1 (which combine to make a 16 bit integer):

- if bit 0 = 1 then display `Propogated`
- if bit 1 = 1 then display `Alt. used`
- if bit 3 = 1 then display `PM`
- if bits 0, 1 and 3 are all 0 (we don't care about the other bits) then display `OK`

`Validity` (the validity of the solution) is set by `FC_GPS_NAVSOL` byte 2 and byte 3 (which combine to make a 16 bit integer):

- if bit 0 = 1 then display `Alt. used`
- if bit 2 = 1 then display `<4 sats`
- if bit 3 = 1 then display `EHPE`
- if bit 4 = 1 then display `EVPE`
- if bits 0,2,3 and 4 are all 0 (we don't care about the other bits) then display `OK`

`Locked` (a summary of the type and validity of the solution) is set by:

- If Solution is `OK` and validity is `OK` then display `Yes` else `No`

Is `FC_GPS_TIME` is used to display the time for the rocket in rocketview?

`Lat` is set by `FC_GPS_LATLON` (first 32 bits)

`Lon` is set by `FC_GPS_LATLON` (second 32 bits)

`Alt` is set by `FC_GPS_HEIGHT` (32 bits).

`Sats` (the number of satellites used over how many should be visible) is set by `FC_GPS_SATS_VIS byte 0 / FC_GPS_SATS_USED byte 0`