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_SBP.h
Views: 1798
1
#pragma once
2
3
#include <AP_Logger/LogStructure.h>
4
#include "AP_GPS_config.h"
5
6
#define LOG_IDS_FROM_GPS_SBP \
7
LOG_MSG_SBPHEALTH, \
8
LOG_MSG_SBPRAWH, \
9
LOG_MSG_SBPRAWM, \
10
LOG_MSG_SBPEVENT
11
12
// @LoggerMessage: SBPH
13
// @Description: Swift Health Data
14
// @Field: TimeUS: Time since system startup
15
// @Field: CrcError: Number of packet CRC errors on serial connection
16
// @Field: LastInject: Timestamp of last raw data injection to GPS
17
// @Field: IARhyp: Current number of integer ambiguity hypotheses
18
19
struct PACKED log_SbpHealth {
20
LOG_PACKET_HEADER;
21
uint64_t time_us;
22
uint32_t crc_error_counter;
23
uint32_t last_injected_data_ms;
24
uint32_t last_iar_num_hypotheses;
25
};
26
27
// @LoggerMessage: SBRH
28
// @Description: Swift Raw Message Data
29
// @Field: TimeUS: Time since system startup
30
// @Field: msg_flag: Swift message type
31
// @Field: 1: Sender ID
32
// @Field: 2: index; always 1
33
// @Field: 3: pages; number of pages received
34
// @Field: 4: msg length; number of bytes received
35
// @Field: 5: unused; always zero
36
// @Field: 6: data received from device
37
38
struct PACKED log_SbpRAWH {
39
LOG_PACKET_HEADER;
40
uint64_t time_us;
41
uint16_t msg_type;
42
uint16_t sender_id;
43
uint8_t index;
44
uint8_t pages;
45
uint8_t msg_len;
46
uint8_t res;
47
uint8_t data[48];
48
};
49
50
struct PACKED log_SbpRAWM {
51
LOG_PACKET_HEADER;
52
uint64_t time_us;
53
uint16_t msg_type;
54
uint16_t sender_id;
55
uint8_t index;
56
uint8_t pages;
57
uint8_t msg_len;
58
uint8_t res;
59
uint8_t data[104];
60
};
61
62
struct PACKED log_SbpEvent {
63
LOG_PACKET_HEADER;
64
uint64_t time_us;
65
uint16_t wn;
66
uint32_t tow;
67
int32_t ns_residual;
68
uint8_t level;
69
uint8_t quality;
70
};
71
72
#if AP_GPS_SBP_ENABLED
73
#define LOG_STRUCTURE_FROM_GPS_SBP \
74
{ LOG_MSG_SBPHEALTH, sizeof(log_SbpHealth), \
75
"SBPH", "QIII", "TimeUS,CrcError,LastInject,IARhyp", "s---", "F---" , true }, \
76
{ LOG_MSG_SBPRAWH, sizeof(log_SbpRAWH), \
77
"SBRH", "QQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6", "s-------", "F-------" , true }, \
78
{ LOG_MSG_SBPRAWM, sizeof(log_SbpRAWM), \
79
"SBRM", "QQQQQQQQQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6,7,8,9,10,11,12,13", "s??????????????", "F??????????????" , true }, \
80
{ LOG_MSG_SBPEVENT, sizeof(log_SbpEvent), \
81
"SBRE", "QHIiBB", "TimeUS,GWk,GMS,ns_residual,level,quality", "s?????", "F?????" },
82
#else
83
#define LOG_STRUCTURE_FROM_GPS_SBP
84
#endif
85
86