Installation Alignment Packet
Installation Alignment Packet | ||||
---|---|---|---|---|
Packet ID | 185 | |||
Length | 73 | |||
Read / Write | Read / Write | |||
Field # | Bytes Offset | Data Type | Size | Description |
1 | 0 | u8 | 1 | Permanent |
2 | 1 | fp32 | 4 | Alignment DCM[0][0] |
3 | 5 | fp32 | 4 | Alignment DCM[0][1] |
4 | 9 | fp32 | 4 | Alignment DCM[0][2] |
5 | 13 | fp32 | 4 | Alignment DCM[1][0] |
6 | 17 | fp32 | 4 | Alignment DCM[1][1] |
7 | 21 | fp32 | 4 | Alignment DCM[1][2] |
8 | 25 | fp32 | 4 | Alignment DCM[2][0] |
9 | 29 | fp32 | 4 | Alignment DCM[2][1] |
10 | 33 | fp32 | 4 | Alignment DCM[2][2] |
11 | 37 | fp32 | 4 |
|
12 | 41 | fp32 | 4 |
|
13 | 45 | fp32 | 4 | Reserved (set to 0) |
14 | 49 | fp32 | 4 | Reserved (set to 0) |
15 | 53 | fp32 | 4 | Reserved (set to 0) |
16 | 57 | fp32 | 4 | Reserved (set to 0) |
17 | 61 | fp32 | 4 | Reserved (set to 0) |
18 | 65 | fp32 | 4 | Reserved (set to 0) |
19 | 69 | fp32 | 4 | Reserved (set to 0) |
Installation Alignment Packet
Alignment DCM
The alignment DCM (Direction Cosine Matrix) is used to represent an alignment offset of Subsonus from its standard alignment. A DCM is used rather than Euler angles for accuracy reasons. To convert Euler angles to DCM, use the formula below with angles in radians.
DCM[0][0] = cos(heading) * cos(pitch)
DCM[0][1] = sin(heading) * cos(pitch)
DCM[0][2] = -sin(pitch)
DCM[1][0] = -sin(heading) * cos(roll) + cos(heading) * sin(pitch) * sin(roll)
DCM[1][1] = cos(heading) * cos(roll) + sin(heading) * sin(pitch) * sin(roll)
DCM[1][2] = cos(pitch) * sin(roll)
DCM[2][0] = sin(heading) * sin(roll) + cos(heading) * sin(pitch) * cos(roll)
DCM[2][1] = -cos(heading) * sin(roll) + sin(heading) * sin(pitch) * cos(roll)
DCM[2][2] = cos(pitch) * cos(roll)