CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_GPS/LogStructure.h
Views: 1798
1
#pragma once
2
3
#include <AP_Logger/LogStructure.h>
4
#include "LogStructure_SBP.h"
5
6
#define LOG_IDS_FROM_GPS \
7
LOG_GPS_MSG, \
8
LOG_GPA_MSG, \
9
LOG_GPS_RAW_MSG, \
10
LOG_GPS_RAWH_MSG, \
11
LOG_GPS_RAWS_MSG, \
12
LOG_GPS_UBX1_MSG, \
13
LOG_GPS_UBX2_MSG, \
14
LOG_IDS_FROM_GPS_SBP
15
16
17
// @LoggerMessage: GPS
18
// @Description: Information received from GNSS systems attached to the autopilot
19
// @Field: TimeUS: Time since system startup
20
// @Field: I: GPS instance number
21
// @Field: Status: GPS Fix type; 2D fix, 3D fix etc.
22
// @FieldValueEnum: Status: AP_GPS::GPS_Status
23
// @Field: GMS: milliseconds since start of GPS Week
24
// @Field: GWk: weeks since 5 Jan 1980
25
// @Field: NSats: number of satellites visible
26
// @Field: HDop: horizontal dilution of precision
27
// @Field: Lat: latitude
28
// @Field: Lng: longitude
29
// @Field: Alt: altitude
30
// @Field: Spd: ground speed
31
// @Field: GCrs: ground course
32
// @Field: VZ: vertical speed
33
// @Field: Yaw: vehicle yaw
34
// @Field: U: boolean value indicating whether this GPS is in use
35
struct PACKED log_GPS {
36
LOG_PACKET_HEADER;
37
uint64_t time_us;
38
uint8_t instance;
39
uint8_t status;
40
uint32_t gps_week_ms;
41
uint16_t gps_week;
42
uint8_t num_sats;
43
uint16_t hdop;
44
int32_t latitude;
45
int32_t longitude;
46
int32_t altitude;
47
float ground_speed;
48
float ground_course;
49
float vel_z;
50
float yaw;
51
uint8_t used;
52
};
53
54
// @LoggerMessage: GPA
55
// @Description: GPS accuracy information
56
// @Field: I: GPS instance number
57
// @Field: TimeUS: Time since system startup
58
// @Field: VDop: vertical dilution of precision
59
// @Field: HAcc: horizontal position accuracy
60
// @Field: VAcc: vertical position accuracy
61
// @Field: SAcc: speed accuracy
62
// @Field: YAcc: yaw accuracy
63
// @Field: VV: true if vertical velocity is available
64
// @Field: SMS: time since system startup this sample was taken
65
// @Field: Delta: system time delta between the last two reported positions
66
// @Field: Und: Undulation
67
// @Field: RTCMFU: RTCM fragments used
68
// @Field: RTCMFD: RTCM fragments discarded
69
struct PACKED log_GPA {
70
LOG_PACKET_HEADER;
71
uint64_t time_us;
72
uint8_t instance;
73
uint16_t vdop;
74
uint16_t hacc;
75
uint16_t vacc;
76
uint16_t sacc;
77
float yaw_accuracy;
78
uint8_t have_vv;
79
uint32_t sample_ms;
80
uint16_t delta_ms;
81
float undulation;
82
uint16_t rtcm_fragments_used;
83
uint16_t rtcm_fragments_discarded;
84
};
85
86
/*
87
UBlox logging
88
*/
89
90
// @LoggerMessage: UBX1
91
// @Description: uBlox-specific GPS information (part 1)
92
// @Field: TimeUS: Time since system startup
93
// @Field: Instance: GPS instance number
94
// @Field: noisePerMS: noise level as measured by GPS
95
// @Field: jamInd: jamming indicator; higher is more likely jammed
96
// @Field: aPower: antenna power indicator; 2 is don't know
97
// @Field: agcCnt: automatic gain control monitor
98
// @Field: config: bitmask for messages which haven't been seen
99
struct PACKED log_Ubx1 {
100
LOG_PACKET_HEADER;
101
uint64_t time_us;
102
uint8_t instance;
103
uint16_t noisePerMS;
104
uint8_t jamInd;
105
uint8_t aPower;
106
uint16_t agcCnt;
107
uint32_t config;
108
};
109
110
// @LoggerMessage: UBX2
111
// @Description: uBlox-specific GPS information (part 2)
112
// @Field: TimeUS: Time since system startup
113
// @Field: Instance: GPS instance number
114
// @Field: ofsI: imbalance of I part of complex signal
115
// @Field: magI: magnitude of I part of complex signal
116
// @Field: ofsQ: imbalance of Q part of complex signal
117
// @Field: magQ: magnitude of Q part of complex signal
118
struct PACKED log_Ubx2 {
119
LOG_PACKET_HEADER;
120
uint64_t time_us;
121
uint8_t instance;
122
int8_t ofsI;
123
uint8_t magI;
124
int8_t ofsQ;
125
uint8_t magQ;
126
};
127
128
// @LoggerMessage: GRAW
129
// @Description: Raw uBlox data
130
// @Field: TimeUS: Time since system startup
131
// @Field: WkMS: receiver TimeOfWeek measurement
132
// @Field: Week: GPS week
133
// @Field: numSV: number of space vehicles seen
134
// @Field: sv: space vehicle number of first vehicle
135
// @Field: cpMes: carrier phase measurement
136
// @Field: prMes: pseudorange measurement
137
// @Field: doMes: Doppler measurement
138
// @Field: mesQI: measurement quality index
139
// @Field: cno: carrier-to-noise density ratio
140
// @Field: lli: loss of lock indicator
141
struct PACKED log_GPS_RAW {
142
LOG_PACKET_HEADER;
143
uint64_t time_us;
144
int32_t iTOW;
145
int16_t week;
146
uint8_t numSV;
147
uint8_t sv;
148
double cpMes;
149
double prMes;
150
float doMes;
151
int8_t mesQI;
152
int8_t cno;
153
uint8_t lli;
154
};
155
156
// @LoggerMessage: GRXH
157
// @Description: Raw uBlox data - header
158
// @Field: TimeUS: Time since system startup
159
// @Field: rcvTime: receiver TimeOfWeek measurement
160
// @Field: week: GPS week
161
// @Field: leapS: GPS leap seconds
162
// @Field: numMeas: number of space-vehicle measurements to follow
163
// @Field: recStat: receiver tracking status bitfield
164
struct PACKED log_GPS_RAWH {
165
LOG_PACKET_HEADER;
166
uint64_t time_us;
167
double rcvTow;
168
uint16_t week;
169
int8_t leapS;
170
uint8_t numMeas;
171
uint8_t recStat;
172
};
173
174
// @LoggerMessage: GRXS
175
// @Description: Raw uBlox data - space-vehicle data
176
// @Field: TimeUS: Time since system startup
177
// @Field: prMes: Pseudorange measurement
178
// @Field: cpMes: Carrier phase measurement
179
// @Field: doMes: Doppler measurement
180
// @Field: gnss: GNSS identifier
181
// @Field: sv: Satellite identifier
182
// @Field: freq: GLONASS frequency slot
183
// @Field: lock: carrier phase locktime counter
184
// @Field: cno: carrier-to-noise density ratio
185
// @Field: prD: estimated pseudorange measurement standard deviation
186
// @Field: cpD: estimated carrier phase measurement standard deviation
187
// @Field: doD: estimated Doppler measurement standard deviation
188
// @Field: trk: tracking status bitfield
189
struct PACKED log_GPS_RAWS {
190
LOG_PACKET_HEADER;
191
uint64_t time_us;
192
double prMes;
193
double cpMes;
194
float doMes;
195
uint8_t gnssId;
196
uint8_t svId;
197
uint8_t freqId;
198
uint16_t locktime;
199
uint8_t cno;
200
uint8_t prStdev;
201
uint8_t cpStdev;
202
uint8_t doStdev;
203
uint8_t trkStat;
204
};
205
206
#define LOG_STRUCTURE_FROM_GPS \
207
{ LOG_GPS_MSG, sizeof(log_GPS), \
208
"GPS", "QBBIHBcLLeffffB", "TimeUS,I,Status,GMS,GWk,NSats,HDop,Lat,Lng,Alt,Spd,GCrs,VZ,Yaw,U", "s#-s-S-DUmnhnh-", "F--C-0BGGB000--" , true }, \
209
{ LOG_GPA_MSG, sizeof(log_GPA), \
210
"GPA", "QBCCCCfBIHfHH", "TimeUS,I,VDop,HAcc,VAcc,SAcc,YAcc,VV,SMS,Delta,Und,RTCMFU,RTCMFD", "s#-mmnd-ssm--", "F-BBBB0-CC0--" , true }, \
211
{ LOG_GPS_UBX1_MSG, sizeof(log_Ubx1), \
212
"UBX1", "QBHBBHI", "TimeUS,Instance,noisePerMS,jamInd,aPower,agcCnt,config", "s#-----", "F------" , true }, \
213
{ LOG_GPS_UBX2_MSG, sizeof(log_Ubx2), \
214
"UBX2", "QBbBbB", "TimeUS,Instance,ofsI,magI,ofsQ,magQ", "s#----", "F-----" , true }, \
215
{ LOG_GPS_RAW_MSG, sizeof(log_GPS_RAW), \
216
"GRAW", "QIHBBddfBbB", "TimeUS,WkMS,Week,numSV,sv,cpMes,prMes,doMes,mesQI,cno,lli", "ss-S-------", "FC-0-------" , true }, \
217
{ LOG_GPS_RAWH_MSG, sizeof(log_GPS_RAWH), \
218
"GRXH", "QdHbBB", "TimeUS,rcvTime,week,leapS,numMeas,recStat", "s-----", "F-----" , true }, \
219
{ LOG_GPS_RAWS_MSG, sizeof(log_GPS_RAWS), \
220
"GRXS", "QddfBBBHBBBBB", "TimeUS,prMes,cpMes,doMes,gnss,sv,freq,lock,cno,prD,cpD,doD,trk", "s------------", "F------------" , true }, \
221
LOG_STRUCTURE_FROM_GPS_SBP
222
223