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_AHRS/LogStructure.h
Views: 1798
1
#pragma once
2
3
#include <AP_Logger/LogStructure.h>
4
5
#define LOG_IDS_FROM_AHRS \
6
LOG_AHR2_MSG, \
7
LOG_AOA_SSA_MSG, \
8
LOG_ATTITUDE_MSG, \
9
LOG_ORGN_MSG, \
10
LOG_POS_MSG, \
11
LOG_RATE_MSG, \
12
LOG_ATSC_MSG
13
14
// @LoggerMessage: AHR2
15
// @Description: Backup AHRS data
16
// @Field: TimeUS: Time since system startup
17
// @Field: Roll: Estimated roll
18
// @Field: Pitch: Estimated pitch
19
// @Field: Yaw: Estimated yaw
20
// @Field: Alt: Estimated altitude
21
// @Field: Lat: Estimated latitude
22
// @Field: Lng: Estimated longitude
23
// @Field: Q1: Estimated attitude quaternion component 1
24
// @Field: Q2: Estimated attitude quaternion component 2
25
// @Field: Q3: Estimated attitude quaternion component 3
26
// @Field: Q4: Estimated attitude quaternion component 4
27
struct PACKED log_AHRS {
28
LOG_PACKET_HEADER;
29
uint64_t time_us;
30
int16_t roll;
31
int16_t pitch;
32
uint16_t yaw;
33
float alt;
34
int32_t lat;
35
int32_t lng;
36
float q1, q2, q3, q4;
37
};
38
39
// @LoggerMessage: AOA
40
// @Description: Angle of attack and Side Slip Angle values
41
// @Field: TimeUS: Time since system startup
42
// @Field: AOA: Angle of Attack calculated from airspeed, wind vector,velocity vector
43
// @Field: SSA: Side Slip Angle calculated from airspeed, wind vector,velocity vector
44
struct PACKED log_AOA_SSA {
45
LOG_PACKET_HEADER;
46
uint64_t time_us;
47
float AOA;
48
float SSA;
49
};
50
51
// @LoggerMessage: ATT
52
// @Description: Canonical vehicle attitude
53
// @Field: TimeUS: Time since system startup
54
// @Field: DesRoll: vehicle desired roll
55
// @Field: Roll: achieved vehicle roll
56
// @Field: DesPitch: vehicle desired pitch
57
// @Field: Pitch: achieved vehicle pitch
58
// @Field: DesYaw: vehicle desired yaw
59
// @Field: Yaw: achieved vehicle yaw
60
// @Field: AEKF: active EKF type
61
struct PACKED log_Attitude {
62
LOG_PACKET_HEADER;
63
uint64_t time_us;
64
float control_roll;
65
float roll;
66
float control_pitch;
67
float pitch;
68
float control_yaw;
69
float yaw;
70
uint8_t active;
71
};
72
73
// @LoggerMessage: ORGN
74
// @Description: Vehicle navigation origin or other notable position
75
// @Field: TimeUS: Time since system startup
76
// @Field: Type: Position type
77
// @FieldValueEnum: Type: AP_AHRS::LogOriginType
78
// @Field: Lat: Position latitude
79
// @Field: Lng: Position longitude
80
// @Field: Alt: Position altitude
81
struct PACKED log_ORGN {
82
LOG_PACKET_HEADER;
83
uint64_t time_us;
84
uint8_t origin_type;
85
int32_t latitude;
86
int32_t longitude;
87
int32_t altitude;
88
};
89
90
// @LoggerMessage: POS
91
// @Description: Canonical vehicle position
92
// @Field: TimeUS: Time since system startup
93
// @Field: Lat: Canonical vehicle latitude
94
// @Field: Lng: Canonical vehicle longitude
95
// @Field: Alt: Canonical vehicle altitude
96
// @Field: RelHomeAlt: Canonical vehicle altitude relative to home
97
// @Field: RelOriginAlt: Canonical vehicle altitude relative to navigation origin
98
struct PACKED log_POS {
99
LOG_PACKET_HEADER;
100
uint64_t time_us;
101
int32_t lat;
102
int32_t lng;
103
float alt;
104
float rel_home_alt;
105
float rel_origin_alt;
106
};
107
108
// @LoggerMessage: VSTB
109
// @Description: Log message for video stabilisation software such as Gyroflow
110
// @Field: TimeUS: Time since system startup
111
// @Field: GyrX: measured rotation rate about X axis
112
// @Field: GyrY: measured rotation rate about Y axis
113
// @Field: GyrZ: measured rotation rate about Z axis
114
// @Field: AccX: acceleration along X axis
115
// @Field: AccY: acceleration along Y axis
116
// @Field: AccZ: acceleration along Z axis
117
// @Field: Q1: Estimated attitude quaternion component 1
118
// @Field: Q2: Estimated attitude quaternion component 2
119
// @Field: Q3: Estimated attitude quaternion component 3
120
// @Field: Q4: Estimated attitude quaternion component 4
121
122
struct PACKED log_Video_Stabilisation {
123
LOG_PACKET_HEADER;
124
uint64_t time_us;
125
float gyro_x;
126
float gyro_y;
127
float gyro_z;
128
float accel_x;
129
float accel_y;
130
float accel_z;
131
float Q1;
132
float Q2;
133
float Q3;
134
float Q4;
135
};
136
137
// @LoggerMessage: ATSC
138
// @Description: Scale factors for attitude controller
139
// @Field: TimeUS: Time since system startup
140
// @Field: AngPScX: Angle P scale X
141
// @Field: AngPScY: Angle P scale Y
142
// @Field: AngPScZ: Angle P scale Z
143
// @Field: PDScX: PD scale X
144
// @Field: PDScY: PD scale Y
145
// @Field: PDScZ: PD scale Z
146
struct PACKED log_ATSC {
147
LOG_PACKET_HEADER;
148
uint64_t time_us;
149
float scaleP_x;
150
float scaleP_y;
151
float scaleP_z;
152
float scalePD_x;
153
float scalePD_y;
154
float scalePD_z;
155
};
156
157
158
#define LOG_STRUCTURE_FROM_AHRS \
159
{ LOG_AHR2_MSG, sizeof(log_AHRS), \
160
"AHR2","QccCfLLffff","TimeUS,Roll,Pitch,Yaw,Alt,Lat,Lng,Q1,Q2,Q3,Q4","sddhmDU----", "FBBB0GG----" , true }, \
161
{ LOG_AOA_SSA_MSG, sizeof(log_AOA_SSA), \
162
"AOA", "Qff", "TimeUS,AOA,SSA", "sdd", "F00" , true }, \
163
{ LOG_ATTITUDE_MSG, sizeof(log_Attitude),\
164
"ATT", "QffffffB", "TimeUS,DesRoll,Roll,DesPitch,Pitch,DesYaw,Yaw,AEKF", "sddddhh-", "F000000-" , true }, \
165
{ LOG_ORGN_MSG, sizeof(log_ORGN), \
166
"ORGN","QBLLe","TimeUS,Type,Lat,Lng,Alt", "s#DUm", "F-GGB" }, \
167
{ LOG_POS_MSG, sizeof(log_POS), \
168
"POS","QLLfff","TimeUS,Lat,Lng,Alt,RelHomeAlt,RelOriginAlt", "sDUmmm", "FGG000" , true }, \
169
{ LOG_ATSC_MSG, sizeof(log_ATSC), \
170
"ATSC", "Qffffff", "TimeUS,AngPScX,AngPScY,AngPScZ,PDScX,PDScY,PDScZ", "s------", "F000000" , true }, \
171
{ LOG_VIDEO_STABILISATION_MSG, sizeof(log_Video_Stabilisation), \
172
"VSTB", "Qffffffffff", "TimeUS,GyrX,GyrY,GyrZ,AccX,AccY,AccZ,Q1,Q2,Q3,Q4", "sEEEooo----", "F0000000000" },
173
174
175