LogStructure.h 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782
  1. #pragma once
  2. // if you add any new types, units or multipliers, please update README.md
  3. /*
  4. Format characters in the format string for binary log messages
  5. a : int16_t[32]
  6. b : int8_t
  7. B : uint8_t
  8. h : int16_t
  9. H : uint16_t
  10. i : int32_t
  11. I : uint32_t
  12. f : float
  13. d : double
  14. n : char[4]
  15. N : char[16]
  16. Z : char[64]
  17. c : int16_t * 100
  18. C : uint16_t * 100
  19. e : int32_t * 100
  20. E : uint32_t * 100
  21. L : int32_t latitude/longitude
  22. M : uint8_t flight mode
  23. q : int64_t
  24. Q : uint64_t
  25. */
  26. struct UnitStructure {
  27. const char ID;
  28. const char *unit;
  29. };
  30. struct MultiplierStructure {
  31. const char ID;
  32. const double multiplier;
  33. };
  34. // all units here should be base units
  35. // This does mean battery capacity is here as "amp*second"
  36. // Please keep the names consistent with Tools/autotest/param_metadata/param.py:33
  37. const struct UnitStructure log_Units[] = {
  38. { '-', "" }, // no units e.g. Pi, or a string
  39. { '?', "UNKNOWN" }, // Units which haven't been worked out yet....
  40. { 'A', "A" }, // Ampere
  41. { 'd', "deg" }, // of the angular variety, -180 to 180
  42. { 'b', "B" }, // bytes
  43. { 'k', "deg/s" }, // degrees per second. Degrees are NOT SI, but is some situations more user-friendly than radians
  44. { 'D', "deglatitude" }, // degrees of latitude
  45. { 'e', "deg/s/s" }, // degrees per second per second. Degrees are NOT SI, but is some situations more user-friendly than radians
  46. { 'E', "rad/s" }, // radians per second
  47. { 'G', "Gauss" }, // Gauss is not an SI unit, but 1 tesla = 10000 gauss so a simple replacement is not possible here
  48. { 'h', "degheading" }, // 0.? to 359.?
  49. { 'i', "A.s" }, // Ampere second
  50. { 'J', "W.s" }, // Joule (Watt second)
  51. // { 'l', "l" }, // litres
  52. { 'L', "rad/s/s" }, // radians per second per second
  53. { 'm', "m" }, // metres
  54. { 'n', "m/s" }, // metres per second
  55. // { 'N', "N" }, // Newton
  56. { 'o', "m/s/s" }, // metres per second per second
  57. { 'O', "degC" }, // degrees Celsius. Not SI, but Kelvin is too cumbersome for most users
  58. { '%', "%" }, // percent
  59. { 'S', "satellites" }, // number of satellites
  60. { 's', "s" }, // seconds
  61. { 'q', "rpm" }, // rounds per minute. Not SI, but sometimes more intuitive than Hertz
  62. { 'r', "rad" }, // radians
  63. { 'U', "deglongitude" }, // degrees of longitude
  64. { 'u', "ppm" }, // pulses per minute
  65. { 'v', "V" }, // Volt
  66. { 'P', "Pa" }, // Pascal
  67. { 'w', "Ohm" }, // Ohm
  68. // { 'W', "Watt" }, // Watt
  69. { 'Y', "us" }, // pulse width modulation in microseconds
  70. { 'z', "Hz" }, // Hertz
  71. { '#', "instance" } // (e.g.)Sensor instance number
  72. };
  73. // this multiplier information applies to the raw value present in the
  74. // log. Any adjustment implied by the format field (e.g. the "centi"
  75. // in "centidegrees" is *IGNORED* for the purposes of scaling.
  76. // Essentially "format" simply tells you the C-type, and format-type h
  77. // (int16_t) is equivalent to format-type c (int16_t*100)
  78. // tl;dr a GCS shouldn't/mustn't infer any scaling from the unit name
  79. const struct MultiplierStructure log_Multipliers[] = {
  80. { '-', 0 }, // no multiplier e.g. a string
  81. { '?', 1 }, // multipliers which haven't been worked out yet....
  82. // <leave a gap here, just in case....>
  83. { '2', 1e2 },
  84. { '1', 1e1 },
  85. { '0', 1e0 },
  86. { 'A', 1e-1 },
  87. { 'B', 1e-2 },
  88. { 'C', 1e-3 },
  89. { 'D', 1e-4 },
  90. { 'E', 1e-5 },
  91. { 'F', 1e-6 },
  92. { 'G', 1e-7 },
  93. // <leave a gap here, just in case....>
  94. { '!', 3.6 }, // (ampere*second => milliampere*hour) and (km/h => m/s)
  95. { '/', 3600 }, // (ampere*second => ampere*hour)
  96. };
  97. /*
  98. unfortunately these need to be macros because of a limitation of
  99. named member structure initialisation in g++
  100. */
  101. #define LOG_PACKET_HEADER uint8_t head1, head2, msgid;
  102. #define LOG_PACKET_HEADER_INIT(id) head1 : HEAD_BYTE1, head2 : HEAD_BYTE2, msgid : id
  103. #define LOG_PACKET_HEADER_LEN 3 // bytes required for LOG_PACKET_HEADER
  104. // once the logging code is all converted we will remove these from
  105. // this header
  106. #define HEAD_BYTE1 0xA3 // Decimal 163
  107. #define HEAD_BYTE2 0x95 // Decimal 149
  108. // structure used to define logging format
  109. struct LogStructure {
  110. uint8_t msg_type;
  111. uint8_t msg_len;
  112. const char *name;
  113. const char *format;
  114. const char *labels;
  115. const char *units;
  116. const char *multipliers;
  117. };
  118. // maximum lengths of fields in LogStructure, including trailing nulls
  119. static const uint8_t LS_NAME_SIZE = 5;
  120. static const uint8_t LS_FORMAT_SIZE = 17;
  121. static const uint8_t LS_LABELS_SIZE = 65;
  122. static const uint8_t LS_UNITS_SIZE = 17;
  123. static const uint8_t LS_MULTIPLIERS_SIZE = 17;
  124. /*
  125. log structures common to all vehicle types
  126. */
  127. struct PACKED log_Format {
  128. LOG_PACKET_HEADER;
  129. uint8_t type;
  130. uint8_t length;
  131. char name[4];
  132. char format[16];
  133. char labels[64];
  134. };
  135. struct PACKED log_Unit {
  136. LOG_PACKET_HEADER;
  137. uint64_t time_us;
  138. char type;
  139. char unit[64]; // you know, this might be overkill...
  140. };
  141. struct PACKED log_Format_Multiplier {
  142. LOG_PACKET_HEADER;
  143. uint64_t time_us;
  144. char type;
  145. double multiplier;
  146. };
  147. struct PACKED log_Format_Units {
  148. LOG_PACKET_HEADER;
  149. uint64_t time_us;
  150. uint8_t format_type;
  151. char units[16];
  152. char multipliers[16];
  153. };
  154. struct PACKED log_Parameter {
  155. LOG_PACKET_HEADER;
  156. uint64_t time_us;
  157. char name[16];
  158. float value;
  159. };
  160. struct PACKED log_DSF {
  161. LOG_PACKET_HEADER;
  162. uint64_t time_us;
  163. uint32_t dropped;
  164. uint16_t blocks;
  165. uint32_t bytes;
  166. uint32_t buf_space_min;
  167. uint32_t buf_space_max;
  168. uint32_t buf_space_avg;
  169. };
  170. struct PACKED log_Event {
  171. LOG_PACKET_HEADER;
  172. uint64_t time_us;
  173. uint8_t id;
  174. };
  175. struct PACKED log_Error {
  176. LOG_PACKET_HEADER;
  177. uint64_t time_us;
  178. uint8_t sub_system;
  179. uint8_t error_code;
  180. };
  181. struct PACKED log_GPS {
  182. LOG_PACKET_HEADER;
  183. uint64_t time_us;
  184. uint8_t status;
  185. uint32_t gps_week_ms;
  186. uint16_t gps_week;
  187. uint8_t num_sats;
  188. uint16_t hdop;
  189. int32_t latitude;
  190. int32_t longitude;
  191. int32_t altitude;
  192. float ground_speed;
  193. float ground_course;
  194. float vel_z;
  195. float yaw;
  196. uint8_t used;
  197. };
  198. struct PACKED log_GPA {
  199. LOG_PACKET_HEADER;
  200. uint64_t time_us;
  201. uint16_t vdop;
  202. uint16_t hacc;
  203. uint16_t vacc;
  204. uint16_t sacc;
  205. uint8_t have_vv;
  206. uint32_t sample_ms;
  207. uint16_t delta_ms;
  208. };
  209. struct PACKED log_Message {
  210. LOG_PACKET_HEADER;
  211. uint64_t time_us;
  212. char msg[64];
  213. };
  214. struct PACKED log_IMU {
  215. LOG_PACKET_HEADER;
  216. uint64_t time_us;
  217. float gyro_x, gyro_y, gyro_z;
  218. float accel_x, accel_y, accel_z;
  219. uint32_t gyro_error, accel_error;
  220. float temperature;
  221. uint8_t gyro_health, accel_health;
  222. uint16_t gyro_rate, accel_rate;
  223. };
  224. struct PACKED log_IMUDT {
  225. LOG_PACKET_HEADER;
  226. uint64_t time_us;
  227. float delta_time, delta_vel_dt, delta_ang_dt;
  228. float delta_ang_x, delta_ang_y, delta_ang_z;
  229. float delta_vel_x, delta_vel_y, delta_vel_z;
  230. };
  231. struct PACKED log_ISBH {
  232. LOG_PACKET_HEADER;
  233. uint64_t time_us;
  234. uint16_t seqno;
  235. uint8_t sensor_type; // e.g. GYRO or ACCEL
  236. uint8_t instance;
  237. uint16_t multiplier;
  238. uint16_t sample_count;
  239. uint64_t sample_us;
  240. float sample_rate_hz;
  241. };
  242. static_assert(sizeof(log_ISBH) < 256, "log_ISBH is over-size");
  243. struct PACKED log_ISBD {
  244. LOG_PACKET_HEADER;
  245. uint64_t time_us;
  246. uint16_t isb_seqno;
  247. uint16_t seqno; // seqno within isb_seqno
  248. int16_t x[32];
  249. int16_t y[32];
  250. int16_t z[32];
  251. };
  252. static_assert(sizeof(log_ISBD) < 256, "log_ISBD is over-size");
  253. struct PACKED log_Vibe {
  254. LOG_PACKET_HEADER;
  255. uint64_t time_us;
  256. float vibe_x, vibe_y, vibe_z;
  257. uint32_t clipping_0, clipping_1, clipping_2;
  258. };
  259. struct PACKED log_Gimbal1 {
  260. LOG_PACKET_HEADER;
  261. uint32_t time_ms;
  262. float delta_time;
  263. float delta_angles_x;
  264. float delta_angles_y;
  265. float delta_angles_z;
  266. float delta_velocity_x;
  267. float delta_velocity_y;
  268. float delta_velocity_z;
  269. float joint_angles_x;
  270. float joint_angles_y;
  271. float joint_angles_z;
  272. };
  273. struct PACKED log_Gimbal2 {
  274. LOG_PACKET_HEADER;
  275. uint32_t time_ms;
  276. uint8_t est_sta;
  277. float est_x;
  278. float est_y;
  279. float est_z;
  280. float rate_x;
  281. float rate_y;
  282. float rate_z;
  283. float target_x;
  284. float target_y;
  285. float target_z;
  286. };
  287. struct PACKED log_Gimbal3 {
  288. LOG_PACKET_HEADER;
  289. uint32_t time_ms;
  290. int16_t rl_torque_cmd;
  291. int16_t el_torque_cmd;
  292. int16_t az_torque_cmd;
  293. };
  294. struct PACKED log_RCIN {
  295. LOG_PACKET_HEADER;
  296. uint64_t time_us;
  297. uint16_t chan1;
  298. uint16_t chan2;
  299. uint16_t chan3;
  300. uint16_t chan4;
  301. uint16_t chan5;
  302. uint16_t chan6;
  303. uint16_t chan7;
  304. uint16_t chan8;
  305. uint16_t chan9;
  306. uint16_t chan10;
  307. uint16_t chan11;
  308. uint16_t chan12;
  309. uint16_t chan13;
  310. uint16_t chan14;
  311. };
  312. struct PACKED log_RCOUT {
  313. LOG_PACKET_HEADER;
  314. uint64_t time_us;
  315. uint16_t chan1;
  316. uint16_t chan2;
  317. uint16_t chan3;
  318. uint16_t chan4;
  319. uint16_t chan5;
  320. uint16_t chan6;
  321. uint16_t chan7;
  322. uint16_t chan8;
  323. uint16_t chan9;
  324. uint16_t chan10;
  325. uint16_t chan11;
  326. uint16_t chan12;
  327. uint16_t chan13;
  328. uint16_t chan14;
  329. };
  330. struct PACKED log_MAV {
  331. LOG_PACKET_HEADER;
  332. uint64_t time_us;
  333. uint8_t chan;
  334. uint16_t packet_tx_count;
  335. uint16_t packet_rx_success_count;
  336. uint16_t packet_rx_drop_count;
  337. };
  338. struct PACKED log_RSSI {
  339. LOG_PACKET_HEADER;
  340. uint64_t time_us;
  341. float RXRSSI;
  342. };
  343. struct PACKED log_BARO {
  344. LOG_PACKET_HEADER;
  345. uint64_t time_us;
  346. float altitude;
  347. float pressure;
  348. int16_t temperature;
  349. float climbrate;
  350. uint32_t sample_time_ms;
  351. float drift_offset;
  352. float ground_temp;
  353. uint8_t healthy;
  354. };
  355. struct PACKED log_Optflow {
  356. LOG_PACKET_HEADER;
  357. uint64_t time_us;
  358. uint8_t surface_quality;
  359. float flow_x;
  360. float flow_y;
  361. float body_x;
  362. float body_y;
  363. };
  364. struct PACKED log_AHRS {
  365. LOG_PACKET_HEADER;
  366. uint64_t time_us;
  367. int16_t roll;
  368. int16_t pitch;
  369. uint16_t yaw;
  370. float alt;
  371. int32_t lat;
  372. int32_t lng;
  373. float q1, q2, q3, q4;
  374. };
  375. struct PACKED log_POS {
  376. LOG_PACKET_HEADER;
  377. uint64_t time_us;
  378. int32_t lat;
  379. int32_t lng;
  380. float alt;
  381. float rel_home_alt;
  382. float rel_origin_alt;
  383. };
  384. struct PACKED log_POWR {
  385. LOG_PACKET_HEADER;
  386. uint64_t time_us;
  387. float Vcc;
  388. float Vservo;
  389. uint16_t flags;
  390. uint8_t safety_and_arm;
  391. };
  392. struct PACKED log_EKF1 {
  393. LOG_PACKET_HEADER;
  394. uint64_t time_us;
  395. int16_t roll;
  396. int16_t pitch;
  397. uint16_t yaw;
  398. float velN;
  399. float velE;
  400. float velD;
  401. float posD_dot;
  402. float posN;
  403. float posE;
  404. float posD;
  405. int16_t gyrX;
  406. int16_t gyrY;
  407. int16_t gyrZ;
  408. int32_t originHgt;
  409. };
  410. struct PACKED log_EKF2 {
  411. LOG_PACKET_HEADER;
  412. uint64_t time_us;
  413. int8_t Ratio;
  414. int8_t AZ1bias;
  415. int8_t AZ2bias;
  416. int16_t windN;
  417. int16_t windE;
  418. int16_t magN;
  419. int16_t magE;
  420. int16_t magD;
  421. int16_t magX;
  422. int16_t magY;
  423. int16_t magZ;
  424. };
  425. struct PACKED log_NKF2 {
  426. LOG_PACKET_HEADER;
  427. uint64_t time_us;
  428. int8_t AZbias;
  429. int16_t scaleX;
  430. int16_t scaleY;
  431. int16_t scaleZ;
  432. int16_t windN;
  433. int16_t windE;
  434. int16_t magN;
  435. int16_t magE;
  436. int16_t magD;
  437. int16_t magX;
  438. int16_t magY;
  439. int16_t magZ;
  440. uint8_t index;
  441. };
  442. struct PACKED log_NKF2a {
  443. LOG_PACKET_HEADER;
  444. uint64_t time_us;
  445. int16_t accBiasX;
  446. int16_t accBiasY;
  447. int16_t accBiasZ;
  448. int16_t windN;
  449. int16_t windE;
  450. int16_t magN;
  451. int16_t magE;
  452. int16_t magD;
  453. int16_t magX;
  454. int16_t magY;
  455. int16_t magZ;
  456. uint8_t index;
  457. };
  458. struct PACKED log_EKF3 {
  459. LOG_PACKET_HEADER;
  460. uint64_t time_us;
  461. int16_t innovVN;
  462. int16_t innovVE;
  463. int16_t innovVD;
  464. int16_t innovPN;
  465. int16_t innovPE;
  466. int16_t innovPD;
  467. int16_t innovMX;
  468. int16_t innovMY;
  469. int16_t innovMZ;
  470. int16_t innovVT;
  471. };
  472. struct PACKED log_NKF3 {
  473. LOG_PACKET_HEADER;
  474. uint64_t time_us;
  475. int16_t innovVN;
  476. int16_t innovVE;
  477. int16_t innovVD;
  478. int16_t innovPN;
  479. int16_t innovPE;
  480. int16_t innovPD;
  481. int16_t innovMX;
  482. int16_t innovMY;
  483. int16_t innovMZ;
  484. int16_t innovYaw;
  485. int16_t innovVT;
  486. };
  487. struct PACKED log_EKF4 {
  488. LOG_PACKET_HEADER;
  489. uint64_t time_us;
  490. int16_t sqrtvarV;
  491. int16_t sqrtvarP;
  492. int16_t sqrtvarH;
  493. int16_t sqrtvarMX;
  494. int16_t sqrtvarMY;
  495. int16_t sqrtvarMZ;
  496. int16_t sqrtvarVT;
  497. int8_t offsetNorth;
  498. int8_t offsetEast;
  499. uint16_t faults;
  500. uint8_t timeouts;
  501. uint16_t solution;
  502. uint16_t gps;
  503. };
  504. struct PACKED log_NKF4 {
  505. LOG_PACKET_HEADER;
  506. uint64_t time_us;
  507. int16_t sqrtvarV;
  508. int16_t sqrtvarP;
  509. int16_t sqrtvarH;
  510. int16_t sqrtvarM;
  511. int16_t sqrtvarVT;
  512. float tiltErr;
  513. int8_t offsetNorth;
  514. int8_t offsetEast;
  515. uint16_t faults;
  516. uint8_t timeouts;
  517. uint16_t solution;
  518. uint16_t gps;
  519. int8_t primary;
  520. };
  521. struct PACKED log_EKF5 {
  522. LOG_PACKET_HEADER;
  523. uint64_t time_us;
  524. uint8_t normInnov;
  525. int16_t FIX;
  526. int16_t FIY;
  527. int16_t AFI;
  528. int16_t HAGL;
  529. int16_t offset;
  530. int16_t RI;
  531. uint16_t meaRng;
  532. uint16_t errHAGL;
  533. };
  534. struct PACKED log_NKF5 {
  535. LOG_PACKET_HEADER;
  536. uint64_t time_us;
  537. uint8_t normInnov;
  538. int16_t FIX;
  539. int16_t FIY;
  540. int16_t AFI;
  541. int16_t HAGL;
  542. int16_t offset;
  543. int16_t RI;
  544. uint16_t meaRng;
  545. uint16_t errHAGL;
  546. float angErr;
  547. float velErr;
  548. float posErr;
  549. };
  550. struct PACKED log_Quaternion {
  551. LOG_PACKET_HEADER;
  552. uint64_t time_us;
  553. float q1;
  554. float q2;
  555. float q3;
  556. float q4;
  557. };
  558. struct PACKED log_RngBcnDebug {
  559. LOG_PACKET_HEADER;
  560. uint64_t time_us;
  561. uint8_t ID; // beacon identifier
  562. int16_t rng; // beacon range (cm)
  563. int16_t innov; // beacon range innovation (cm)
  564. uint16_t sqrtInnovVar; // sqrt of beacon range innovation variance (cm)
  565. uint16_t testRatio; // beacon range innovation consistency test ratio *100
  566. int16_t beaconPosN; // beacon north position (cm)
  567. int16_t beaconPosE; // beacon east position (cm)
  568. int16_t beaconPosD; // beacon down position (cm)
  569. int16_t offsetHigh; // high estimate of vertical position offset of beacons rel to EKF origin (cm)
  570. int16_t offsetLow; // low estimate of vertical position offset of beacons rel to EKF origin (cm)
  571. int16_t posN; // North position of receiver rel to EKF origin (cm)
  572. int16_t posE; // East position of receiver rel to EKF origin (cm)
  573. int16_t posD; // Down position of receiver rel to EKF origin (cm)
  574. };
  575. // visual odometry sensor data
  576. struct PACKED log_VisualOdom {
  577. LOG_PACKET_HEADER;
  578. uint64_t time_us;
  579. float time_delta;
  580. float angle_delta_x;
  581. float angle_delta_y;
  582. float angle_delta_z;
  583. float position_delta_x;
  584. float position_delta_y;
  585. float position_delta_z;
  586. float confidence;
  587. };
  588. struct PACKED log_ekfBodyOdomDebug {
  589. LOG_PACKET_HEADER;
  590. uint64_t time_us;
  591. float velInnovX;
  592. float velInnovY;
  593. float velInnovZ;
  594. float velInnovVarX;
  595. float velInnovVarY;
  596. float velInnovVarZ;
  597. };
  598. struct PACKED log_ekfStateVar {
  599. LOG_PACKET_HEADER;
  600. uint64_t time_us;
  601. float v00;
  602. float v01;
  603. float v02;
  604. float v03;
  605. float v04;
  606. float v05;
  607. float v06;
  608. float v07;
  609. float v08;
  610. float v09;
  611. float v10;
  612. float v11;
  613. };
  614. struct PACKED log_Cmd {
  615. LOG_PACKET_HEADER;
  616. uint64_t time_us;
  617. uint16_t command_total;
  618. uint16_t sequence;
  619. uint16_t command;
  620. float param1;
  621. float param2;
  622. float param3;
  623. float param4;
  624. int32_t latitude;
  625. int32_t longitude;
  626. float altitude;
  627. uint8_t frame;
  628. };
  629. struct PACKED log_MAVLink_Command {
  630. LOG_PACKET_HEADER;
  631. uint64_t time_us;
  632. uint8_t target_system;
  633. uint8_t target_component;
  634. uint8_t frame;
  635. uint16_t command;
  636. uint8_t current;
  637. uint8_t autocontinue;
  638. float param1;
  639. float param2;
  640. float param3;
  641. float param4;
  642. int32_t x;
  643. int32_t y;
  644. float z;
  645. uint8_t result;
  646. bool was_command_long;
  647. };
  648. struct PACKED log_Radio {
  649. LOG_PACKET_HEADER;
  650. uint64_t time_us;
  651. uint8_t rssi;
  652. uint8_t remrssi;
  653. uint8_t txbuf;
  654. uint8_t noise;
  655. uint8_t remnoise;
  656. uint16_t rxerrors;
  657. uint16_t fixed;
  658. };
  659. struct PACKED log_Camera {
  660. LOG_PACKET_HEADER;
  661. uint64_t time_us;
  662. uint32_t gps_time;
  663. uint16_t gps_week;
  664. int32_t latitude;
  665. int32_t longitude;
  666. int32_t altitude;
  667. int32_t altitude_rel;
  668. int32_t altitude_gps;
  669. int16_t roll;
  670. int16_t pitch;
  671. uint16_t yaw;
  672. };
  673. struct PACKED log_Attitude {
  674. LOG_PACKET_HEADER;
  675. uint64_t time_us;
  676. int16_t control_roll;
  677. int16_t roll;
  678. int16_t control_pitch;
  679. int16_t pitch;
  680. uint16_t control_yaw;
  681. uint16_t yaw;
  682. uint16_t error_rp;
  683. uint16_t error_yaw;
  684. };
  685. struct PACKED log_PID {
  686. LOG_PACKET_HEADER;
  687. uint64_t time_us;
  688. float target;
  689. float actual;
  690. float error;
  691. float P;
  692. float I;
  693. float D;
  694. float FF;
  695. };
  696. struct PACKED log_Current {
  697. LOG_PACKET_HEADER;
  698. uint64_t time_us;
  699. float voltage;
  700. float voltage_resting;
  701. float current_amps;
  702. float current_total;
  703. float consumed_wh;
  704. int16_t temperature; // degrees C * 100
  705. float resistance;
  706. };
  707. struct PACKED log_WheelEncoder {
  708. LOG_PACKET_HEADER;
  709. uint64_t time_us;
  710. float distance_0;
  711. uint8_t quality_0;
  712. float distance_1;
  713. uint8_t quality_1;
  714. };
  715. struct PACKED log_ADSB {
  716. LOG_PACKET_HEADER;
  717. uint64_t time_us;
  718. uint32_t ICAO_address;
  719. int32_t lat;
  720. int32_t lng;
  721. int32_t alt;
  722. uint16_t heading;
  723. uint16_t hor_velocity;
  724. int16_t ver_velocity;
  725. uint16_t squawk;
  726. };
  727. struct PACKED log_Current_Cells {
  728. LOG_PACKET_HEADER;
  729. uint64_t time_us;
  730. float voltage;
  731. uint16_t cell_voltages[10];
  732. };
  733. struct PACKED log_Compass {
  734. LOG_PACKET_HEADER;
  735. uint64_t time_us;
  736. int16_t mag_x;
  737. int16_t mag_y;
  738. int16_t mag_z;
  739. int16_t offset_x;
  740. int16_t offset_y;
  741. int16_t offset_z;
  742. int16_t motor_offset_x;
  743. int16_t motor_offset_y;
  744. int16_t motor_offset_z;
  745. uint8_t health;
  746. uint32_t SUS;
  747. };
  748. struct PACKED log_Mode {
  749. LOG_PACKET_HEADER;
  750. uint64_t time_us;
  751. uint8_t mode;
  752. uint8_t mode_num;
  753. uint8_t mode_reason;
  754. };
  755. /*
  756. rangefinder - support for 4 sensors
  757. */
  758. struct PACKED log_RFND {
  759. LOG_PACKET_HEADER;
  760. uint64_t time_us;
  761. uint8_t instance;
  762. uint16_t dist;
  763. uint8_t status;
  764. uint8_t orient;
  765. };
  766. /*
  767. terrain log structure
  768. */
  769. struct PACKED log_TERRAIN {
  770. LOG_PACKET_HEADER;
  771. uint64_t time_us;
  772. uint8_t status;
  773. int32_t lat;
  774. int32_t lng;
  775. uint16_t spacing;
  776. float terrain_height;
  777. float current_height;
  778. uint16_t pending;
  779. uint16_t loaded;
  780. };
  781. /*
  782. UBlox logging
  783. */
  784. struct PACKED log_Ubx1 {
  785. LOG_PACKET_HEADER;
  786. uint64_t time_us;
  787. uint8_t instance;
  788. uint16_t noisePerMS;
  789. uint8_t jamInd;
  790. uint8_t aPower;
  791. uint16_t agcCnt;
  792. uint32_t config;
  793. };
  794. struct PACKED log_Ubx2 {
  795. LOG_PACKET_HEADER;
  796. uint64_t time_us;
  797. uint8_t instance;
  798. int8_t ofsI;
  799. uint8_t magI;
  800. int8_t ofsQ;
  801. uint8_t magQ;
  802. };
  803. struct PACKED log_GPS_RAW {
  804. LOG_PACKET_HEADER;
  805. uint64_t time_us;
  806. int32_t iTOW;
  807. int16_t week;
  808. uint8_t numSV;
  809. uint8_t sv;
  810. double cpMes;
  811. double prMes;
  812. float doMes;
  813. int8_t mesQI;
  814. int8_t cno;
  815. uint8_t lli;
  816. };
  817. struct PACKED log_GPS_RAWH {
  818. LOG_PACKET_HEADER;
  819. uint64_t time_us;
  820. double rcvTow;
  821. uint16_t week;
  822. int8_t leapS;
  823. uint8_t numMeas;
  824. uint8_t recStat;
  825. };
  826. struct PACKED log_GPS_RAWS {
  827. LOG_PACKET_HEADER;
  828. uint64_t time_us;
  829. double prMes;
  830. double cpMes;
  831. float doMes;
  832. uint8_t gnssId;
  833. uint8_t svId;
  834. uint8_t freqId;
  835. uint16_t locktime;
  836. uint8_t cno;
  837. uint8_t prStdev;
  838. uint8_t cpStdev;
  839. uint8_t doStdev;
  840. uint8_t trkStat;
  841. };
  842. struct PACKED log_GPS_SBF_EVENT {
  843. LOG_PACKET_HEADER;
  844. uint64_t time_us;
  845. uint32_t TOW;
  846. uint16_t WNc;
  847. uint8_t Mode;
  848. uint8_t Error;
  849. double Latitude;
  850. double Longitude;
  851. double Height;
  852. float Undulation;
  853. float Vn;
  854. float Ve;
  855. float Vu;
  856. float COG;
  857. };
  858. struct PACKED log_Esc {
  859. LOG_PACKET_HEADER;
  860. uint64_t time_us;
  861. int32_t rpm;
  862. uint16_t voltage;
  863. uint16_t current;
  864. int16_t temperature;
  865. uint16_t current_tot;
  866. };
  867. struct PACKED log_AIRSPEED {
  868. LOG_PACKET_HEADER;
  869. uint64_t time_us;
  870. float airspeed;
  871. float diffpressure;
  872. int16_t temperature;
  873. float rawpressure;
  874. float offset;
  875. bool use;
  876. bool healthy;
  877. float health_prob;
  878. uint8_t primary;
  879. };
  880. struct PACKED log_ACCEL {
  881. LOG_PACKET_HEADER;
  882. uint64_t time_us;
  883. uint64_t sample_us;
  884. float AccX, AccY, AccZ;
  885. };
  886. struct PACKED log_GYRO {
  887. LOG_PACKET_HEADER;
  888. uint64_t time_us;
  889. uint64_t sample_us;
  890. float GyrX, GyrY, GyrZ;
  891. };
  892. struct PACKED log_MAV_Stats {
  893. LOG_PACKET_HEADER;
  894. uint32_t timestamp;
  895. uint32_t seqno;
  896. uint32_t dropped;
  897. uint32_t retries;
  898. uint32_t resends;
  899. uint8_t state_free_avg;
  900. uint8_t state_free_min;
  901. uint8_t state_free_max;
  902. uint8_t state_pending_avg;
  903. uint8_t state_pending_min;
  904. uint8_t state_pending_max;
  905. uint8_t state_sent_avg;
  906. uint8_t state_sent_min;
  907. uint8_t state_sent_max;
  908. // uint8_t state_retry_avg;
  909. // uint8_t state_retry_min;
  910. // uint8_t state_retry_max;
  911. };
  912. struct PACKED log_ORGN {
  913. LOG_PACKET_HEADER;
  914. uint64_t time_us;
  915. uint8_t origin_type;
  916. int32_t latitude;
  917. int32_t longitude;
  918. int32_t altitude;
  919. };
  920. struct PACKED log_RPM {
  921. LOG_PACKET_HEADER;
  922. uint64_t time_us;
  923. float rpm1;
  924. float rpm2;
  925. };
  926. struct PACKED log_Rate {
  927. LOG_PACKET_HEADER;
  928. uint64_t time_us;
  929. float control_roll;
  930. float roll;
  931. float roll_out;
  932. float control_pitch;
  933. float pitch;
  934. float pitch_out;
  935. float control_yaw;
  936. float yaw;
  937. float yaw_out;
  938. float control_accel;
  939. float accel;
  940. float accel_out;
  941. };
  942. struct PACKED log_SbpLLH {
  943. LOG_PACKET_HEADER;
  944. uint64_t time_us;
  945. uint32_t tow;
  946. int32_t lat;
  947. int32_t lon;
  948. int32_t alt;
  949. uint8_t n_sats;
  950. uint8_t flags;
  951. };
  952. struct PACKED log_SbpHealth {
  953. LOG_PACKET_HEADER;
  954. uint64_t time_us;
  955. uint32_t crc_error_counter;
  956. uint32_t last_injected_data_ms;
  957. uint32_t last_iar_num_hypotheses;
  958. };
  959. struct PACKED log_SbpRAWH {
  960. LOG_PACKET_HEADER;
  961. uint64_t time_us;
  962. uint16_t msg_type;
  963. uint16_t sender_id;
  964. uint8_t index;
  965. uint8_t pages;
  966. uint8_t msg_len;
  967. uint8_t res;
  968. uint8_t data[48];
  969. };
  970. struct PACKED log_SbpRAWM {
  971. LOG_PACKET_HEADER;
  972. uint64_t time_us;
  973. uint16_t msg_type;
  974. uint16_t sender_id;
  975. uint8_t index;
  976. uint8_t pages;
  977. uint8_t msg_len;
  978. uint8_t res;
  979. uint8_t data[104];
  980. };
  981. struct PACKED log_SbpEvent {
  982. LOG_PACKET_HEADER;
  983. uint64_t time_us;
  984. uint16_t wn;
  985. uint32_t tow;
  986. int32_t ns_residual;
  987. uint8_t level;
  988. uint8_t quality;
  989. };
  990. struct PACKED log_Rally {
  991. LOG_PACKET_HEADER;
  992. uint64_t time_us;
  993. uint8_t total;
  994. uint8_t sequence;
  995. int32_t latitude;
  996. int32_t longitude;
  997. int16_t altitude;
  998. };
  999. struct PACKED log_AOA_SSA {
  1000. LOG_PACKET_HEADER;
  1001. uint64_t time_us;
  1002. float AOA;
  1003. float SSA;
  1004. };
  1005. struct PACKED log_Beacon {
  1006. LOG_PACKET_HEADER;
  1007. uint64_t time_us;
  1008. uint8_t health;
  1009. uint8_t count;
  1010. float dist0;
  1011. float dist1;
  1012. float dist2;
  1013. float dist3;
  1014. float posx;
  1015. float posy;
  1016. float posz;
  1017. };
  1018. // proximity sensor logging
  1019. struct PACKED log_Proximity {
  1020. LOG_PACKET_HEADER;
  1021. uint64_t time_us;
  1022. uint8_t health;
  1023. float dist0;
  1024. float dist45;
  1025. float dist90;
  1026. float dist135;
  1027. float dist180;
  1028. float dist225;
  1029. float dist270;
  1030. float dist315;
  1031. float distup;
  1032. float closest_angle;
  1033. float closest_dist;
  1034. };
  1035. struct PACKED log_Performance {
  1036. LOG_PACKET_HEADER;
  1037. uint64_t time_us;
  1038. uint16_t num_long_running;
  1039. uint16_t num_loops;
  1040. uint32_t max_time;
  1041. uint32_t mem_avail;
  1042. uint16_t load;
  1043. uint32_t internal_errors;
  1044. uint32_t internal_error_count;
  1045. uint32_t spi_count;
  1046. uint32_t i2c_count;
  1047. uint32_t i2c_isr_count;
  1048. uint32_t extra_loop_us;
  1049. };
  1050. struct PACKED log_SRTL {
  1051. LOG_PACKET_HEADER;
  1052. uint64_t time_us;
  1053. uint8_t active;
  1054. uint16_t num_points;
  1055. uint16_t max_points;
  1056. uint8_t action;
  1057. float N;
  1058. float E;
  1059. float D;
  1060. };
  1061. struct PACKED log_OABendyRuler {
  1062. LOG_PACKET_HEADER;
  1063. uint64_t time_us;
  1064. uint8_t active;
  1065. uint16_t target_yaw;
  1066. uint16_t yaw;
  1067. float margin;
  1068. int32_t final_lat;
  1069. int32_t final_lng;
  1070. int32_t oa_lat;
  1071. int32_t oa_lng;
  1072. };
  1073. struct PACKED log_OADijkstra {
  1074. LOG_PACKET_HEADER;
  1075. uint64_t time_us;
  1076. uint8_t state;
  1077. uint8_t curr_point;
  1078. uint8_t tot_points;
  1079. int32_t final_lat;
  1080. int32_t final_lng;
  1081. int32_t oa_lat;
  1082. int32_t oa_lng;
  1083. };
  1084. struct PACKED log_DSTL {
  1085. LOG_PACKET_HEADER;
  1086. uint64_t time_us;
  1087. uint8_t stage;
  1088. float target_heading;
  1089. int32_t target_lat;
  1090. int32_t target_lng;
  1091. int32_t target_alt;
  1092. int16_t crosstrack_error;
  1093. int16_t travel_distance;
  1094. float l1_i;
  1095. int32_t loiter_sum_cd;
  1096. float desired;
  1097. float P;
  1098. float I;
  1099. float D;
  1100. };
  1101. struct PACKED log_Arm_Disarm {
  1102. LOG_PACKET_HEADER;
  1103. uint64_t time_us;
  1104. uint8_t arm_state;
  1105. uint16_t arm_checks;
  1106. };
  1107. // FMT messages define all message formats other than FMT
  1108. // UNIT messages define units which can be referenced by FMTU messages
  1109. // FMTU messages associate types (e.g. centimeters/second/second) to FMT message fields
  1110. #define ACC_LABELS "TimeUS,SampleUS,AccX,AccY,AccZ"
  1111. #define ACC_FMT "QQfff"
  1112. #define ACC_UNITS "ssnnn"
  1113. #define ACC_MULTS "FF000"
  1114. // see "struct sensor" in AP_Baro.h and "Write_Baro":
  1115. #define BARO_LABELS "TimeUS,Alt,Press,Temp,CRt,SMS,Offset,GndTemp,Health"
  1116. #define BARO_FMT "QffcfIffB"
  1117. #define BARO_UNITS "smPOnsmO-"
  1118. #define BARO_MULTS "F00B0C?0-"
  1119. #define ESC_LABELS "TimeUS,RPM,Volt,Curr,Temp,CTot"
  1120. #define ESC_FMT "QeCCcH"
  1121. #define ESC_UNITS "sqvAO-"
  1122. #define ESC_MULTS "FBBBB-"
  1123. #define GPA_LABELS "TimeUS,VDop,HAcc,VAcc,SAcc,VV,SMS,Delta"
  1124. #define GPA_FMT "QCCCCBIH"
  1125. #define GPA_UNITS "smmmn-ss"
  1126. #define GPA_MULTS "FBBBB-CC"
  1127. // see "struct GPS_State" and "Write_GPS":
  1128. #define GPS_LABELS "TimeUS,Status,GMS,GWk,NSats,HDop,Lat,Lng,Alt,Spd,GCrs,VZ,Yaw,U"
  1129. #define GPS_FMT "QBIHBcLLeffffB"
  1130. #define GPS_UNITS "s---SmDUmnhnh-"
  1131. #define GPS_MULTS "F---0BGGB000--"
  1132. #define GYR_LABELS "TimeUS,SampleUS,GyrX,GyrY,GyrZ"
  1133. #define GYR_FMT "QQfff"
  1134. #define GYR_UNITS "ssEEE"
  1135. #define GYR_MULTS "FF000"
  1136. #define IMT_LABELS "TimeUS,DelT,DelvT,DelaT,DelAX,DelAY,DelAZ,DelVX,DelVY,DelVZ"
  1137. #define IMT_FMT "Qfffffffff"
  1138. #define IMT_UNITS "ssssrrrnnn"
  1139. #define IMT_MULTS "FF00000000"
  1140. #define ISBH_LABELS "TimeUS,N,type,instance,mul,smp_cnt,SampleUS,smp_rate"
  1141. #define ISBH_FMT "QHBBHHQf"
  1142. #define ISBH_UNITS "s-----sz"
  1143. #define ISBH_MULTS "F-----F-"
  1144. #define ISBD_LABELS "TimeUS,N,seqno,x,y,z"
  1145. #define ISBD_FMT "QHHaaa"
  1146. #define ISBD_UNITS "s--ooo"
  1147. #define ISBD_MULTS "F--???"
  1148. #define IMU_LABELS "TimeUS,GyrX,GyrY,GyrZ,AccX,AccY,AccZ,EG,EA,T,GH,AH,GHz,AHz"
  1149. #define IMU_FMT "QffffffIIfBBHH"
  1150. #define IMU_UNITS "sEEEooo--O--zz"
  1151. #define IMU_MULTS "F000000-----00"
  1152. #define MAG_LABELS "TimeUS,MagX,MagY,MagZ,OfsX,OfsY,OfsZ,MOfsX,MOfsY,MOfsZ,Health,S"
  1153. #define MAG_FMT "QhhhhhhhhhBI"
  1154. #define MAG_UNITS "sGGGGGGGGG-s"
  1155. #define MAG_MULTS "FCCCCCCCCC-F"
  1156. #define PID_LABELS "TimeUS,Tar,Act,Err,P,I,D,FF"
  1157. #define PID_FMT "Qfffffff"
  1158. #define PID_UNITS "s-------"
  1159. #define PID_MULTS "F-------"
  1160. #define QUAT_LABELS "TimeUS,Q1,Q2,Q3,Q4"
  1161. #define QUAT_FMT "Qffff"
  1162. #define QUAT_UNITS "s????"
  1163. #define QUAT_MULTS "F????"
  1164. #define CURR_LABELS "TimeUS,Volt,VoltR,Curr,CurrTot,EnrgTot,Temp,Res"
  1165. #define CURR_FMT "Qfffffcf"
  1166. #define CURR_UNITS "svvA?JOw"
  1167. #define CURR_MULTS "F000?/?0"
  1168. #define CURR_CELL_LABELS "TimeUS,Volt,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10"
  1169. #define CURR_CELL_FMT "QfHHHHHHHHHH"
  1170. #define CURR_CELL_UNITS "svvvvvvvvvvv"
  1171. #define CURR_CELL_MULTS "F00000000000"
  1172. #define ARSP_LABELS "TimeUS,Airspeed,DiffPress,Temp,RawPress,Offset,U,Health,Hfp,Pri"
  1173. #define ARSP_FMT "QffcffBBfB"
  1174. #define ARSP_UNITS "snPOPP----"
  1175. #define ARSP_MULTS "F00B00----"
  1176. // messages for all boards
  1177. #define LOG_BASE_STRUCTURES \
  1178. { LOG_FORMAT_MSG, sizeof(log_Format), \
  1179. "FMT", "BBnNZ", "Type,Length,Name,Format,Columns", "-b---", "-----" }, \
  1180. { LOG_UNIT_MSG, sizeof(log_Unit), \
  1181. "UNIT", "QbZ", "TimeUS,Id,Label", "s--","F--" }, \
  1182. { LOG_FORMAT_UNITS_MSG, sizeof(log_Format_Units), \
  1183. "FMTU", "QBNN", "TimeUS,FmtType,UnitIds,MultIds","s---", "F---" }, \
  1184. { LOG_MULT_MSG, sizeof(log_Format_Multiplier), \
  1185. "MULT", "Qbd", "TimeUS,Id,Mult", "s--","F--" }, \
  1186. { LOG_PARAMETER_MSG, sizeof(log_Parameter), \
  1187. "PARM", "QNf", "TimeUS,Name,Value", "s--", "F--" }, \
  1188. { LOG_GPS_MSG, sizeof(log_GPS), \
  1189. "GPS", GPS_FMT, GPS_LABELS, GPS_UNITS, GPS_MULTS }, \
  1190. { LOG_GPS2_MSG, sizeof(log_GPS), \
  1191. "GPS2", GPS_FMT, GPS_LABELS, GPS_UNITS, GPS_MULTS }, \
  1192. { LOG_GPSB_MSG, sizeof(log_GPS), \
  1193. "GPSB", GPS_FMT, GPS_LABELS, GPS_UNITS, GPS_MULTS }, \
  1194. { LOG_GPA_MSG, sizeof(log_GPA), \
  1195. "GPA", GPA_FMT, GPA_LABELS, GPA_UNITS, GPA_MULTS }, \
  1196. { LOG_GPA2_MSG, sizeof(log_GPA), \
  1197. "GPA2", GPA_FMT, GPA_LABELS, GPA_UNITS, GPA_MULTS }, \
  1198. { LOG_GPAB_MSG, sizeof(log_GPA), \
  1199. "GPAB", GPA_FMT, GPA_LABELS, GPA_UNITS, GPA_MULTS }, \
  1200. { LOG_IMU_MSG, sizeof(log_IMU), \
  1201. "IMU", IMU_FMT, IMU_LABELS, IMU_UNITS, IMU_MULTS }, \
  1202. { LOG_MESSAGE_MSG, sizeof(log_Message), \
  1203. "MSG", "QZ", "TimeUS,Message", "s-", "F-"}, \
  1204. { LOG_RCIN_MSG, sizeof(log_RCIN), \
  1205. "RCIN", "QHHHHHHHHHHHHHH", "TimeUS,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14", "sYYYYYYYYYYYYYY", "F--------------" }, \
  1206. { LOG_RCOUT_MSG, sizeof(log_RCOUT), \
  1207. "RCOU", "QHHHHHHHHHHHHHH", "TimeUS,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14", "sYYYYYYYYYYYYYY", "F--------------" }, \
  1208. { LOG_RSSI_MSG, sizeof(log_RSSI), \
  1209. "RSSI", "Qf", "TimeUS,RXRSSI", "s-", "F-" }, \
  1210. { LOG_BARO_MSG, sizeof(log_BARO), \
  1211. "BARO", BARO_FMT, BARO_LABELS, BARO_UNITS, BARO_MULTS }, \
  1212. { LOG_POWR_MSG, sizeof(log_POWR), \
  1213. "POWR","QffHB","TimeUS,Vcc,VServo,Flags,Safety", "svv--", "F00--" }, \
  1214. { LOG_CMD_MSG, sizeof(log_Cmd), \
  1215. "CMD", "QHHHffffLLfB","TimeUS,CTot,CNum,CId,Prm1,Prm2,Prm3,Prm4,Lat,Lng,Alt,Frame", "s-------DUm-", "F-------GG0-" }, \
  1216. { LOG_MAVLINK_COMMAND_MSG, sizeof(log_MAVLink_Command), \
  1217. "MAVC", "QBBBHBBffffiifBB","TimeUS,TS,TC,Fr,Cmd,Cur,AC,P1,P2,P3,P4,X,Y,Z,Res,WL", "s---------------", "F---------------" }, \
  1218. { LOG_RADIO_MSG, sizeof(log_Radio), \
  1219. "RAD", "QBBBBBHH", "TimeUS,RSSI,RemRSSI,TxBuf,Noise,RemNoise,RxErrors,Fixed", "s-------", "F-------" }, \
  1220. { LOG_CAMERA_MSG, sizeof(log_Camera), \
  1221. "CAM", "QIHLLeeeccC","TimeUS,GPSTime,GPSWeek,Lat,Lng,Alt,RelAlt,GPSAlt,Roll,Pitch,Yaw", "s--DUmmmddd", "F--GGBBBBBB" }, \
  1222. { LOG_TRIGGER_MSG, sizeof(log_Camera), \
  1223. "TRIG", "QIHLLeeeccC","TimeUS,GPSTime,GPSWeek,Lat,Lng,Alt,RelAlt,GPSAlt,Roll,Pitch,Yaw", "s--DUmmmddd", "F--GGBBBBBB" }, \
  1224. { LOG_ARSP_MSG, sizeof(log_AIRSPEED), "ARSP", ARSP_FMT, ARSP_LABELS, ARSP_UNITS, ARSP_MULTS }, \
  1225. { LOG_ASP2_MSG, sizeof(log_AIRSPEED), "ASP2", ARSP_FMT, ARSP_LABELS, ARSP_UNITS, ARSP_MULTS }, \
  1226. { LOG_CURRENT_MSG, sizeof(log_Current), \
  1227. "BAT", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1228. { LOG_CURRENT2_MSG, sizeof(log_Current), \
  1229. "BAT2", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1230. { LOG_CURRENT3_MSG, sizeof(log_Current), \
  1231. "BAT3", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1232. { LOG_CURRENT4_MSG, sizeof(log_Current), \
  1233. "BAT4", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1234. { LOG_CURRENT5_MSG, sizeof(log_Current), \
  1235. "BAT5", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1236. { LOG_CURRENT6_MSG, sizeof(log_Current), \
  1237. "BAT6", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1238. { LOG_CURRENT7_MSG, sizeof(log_Current), \
  1239. "BAT7", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1240. { LOG_CURRENT8_MSG, sizeof(log_Current), \
  1241. "BAT8", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1242. { LOG_CURRENT9_MSG, sizeof(log_Current), \
  1243. "BAT9", CURR_FMT,CURR_LABELS,CURR_UNITS,CURR_MULTS }, \
  1244. { LOG_CURRENT_CELLS_MSG, sizeof(log_Current_Cells), \
  1245. "BCL", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1246. { LOG_CURRENT_CELLS2_MSG, sizeof(log_Current_Cells), \
  1247. "BCL2", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1248. { LOG_CURRENT_CELLS3_MSG, sizeof(log_Current_Cells), \
  1249. "BCL3", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1250. { LOG_CURRENT_CELLS4_MSG, sizeof(log_Current_Cells), \
  1251. "BCL4", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1252. { LOG_CURRENT_CELLS5_MSG, sizeof(log_Current_Cells), \
  1253. "BCL5", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1254. { LOG_CURRENT_CELLS6_MSG, sizeof(log_Current_Cells), \
  1255. "BCL6", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1256. { LOG_CURRENT_CELLS7_MSG, sizeof(log_Current_Cells), \
  1257. "BCL7", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1258. { LOG_CURRENT_CELLS8_MSG, sizeof(log_Current_Cells), \
  1259. "BCL8", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1260. { LOG_CURRENT_CELLS9_MSG, sizeof(log_Current_Cells), \
  1261. "BCL9", CURR_CELL_FMT, CURR_CELL_LABELS, CURR_CELL_UNITS, CURR_CELL_MULTS }, \
  1262. { LOG_ATTITUDE_MSG, sizeof(log_Attitude),\
  1263. "ATT", "QccccCCCC", "TimeUS,DesRoll,Roll,DesPitch,Pitch,DesYaw,Yaw,ErrRP,ErrYaw", "sddddhhdh", "FBBBBBBBB" }, \
  1264. { LOG_COMPASS_MSG, sizeof(log_Compass), \
  1265. "MAG", MAG_FMT, MAG_LABELS, MAG_UNITS, MAG_MULTS }, \
  1266. { LOG_MODE_MSG, sizeof(log_Mode), \
  1267. "MODE", "QMBB", "TimeUS,Mode,ModeNum,Rsn", "s---", "F---" }, \
  1268. { LOG_RFND_MSG, sizeof(log_RFND), \
  1269. "RFND", "QBCBB", "TimeUS,Instance,Dist,Stat,Orient", "s#m--", "F-B--" }, \
  1270. { LOG_MAV_STATS, sizeof(log_MAV_Stats), \
  1271. "DMS", "IIIIIBBBBBBBBB", "TimeMS,N,Dp,RT,RS,Fa,Fmn,Fmx,Pa,Pmn,Pmx,Sa,Smn,Smx", "s-------------", "C-------------" }, \
  1272. { LOG_BEACON_MSG, sizeof(log_Beacon), \
  1273. "BCN", "QBBfffffff", "TimeUS,Health,Cnt,D0,D1,D2,D3,PosX,PosY,PosZ", "s--mmmmmmm", "F--BBBBBBB" }, \
  1274. { LOG_PROXIMITY_MSG, sizeof(log_Proximity), \
  1275. "PRX", "QBfffffffffff", "TimeUS,Health,D0,D45,D90,D135,D180,D225,D270,D315,DUp,CAn,CDis", "s-mmmmmmmmmhm", "F-00000000000" }, \
  1276. { LOG_PERFORMANCE_MSG, sizeof(log_Performance), \
  1277. "PM", "QHHIIHIIIIII", "TimeUS,NLon,NLoop,MaxT,Mem,Load,IntE,IntEC,SPIC,I2CC,I2CI,ExUS", "s---b%-----s", "F---0A-----F" }, \
  1278. { LOG_SRTL_MSG, sizeof(log_SRTL), \
  1279. "SRTL", "QBHHBfff", "TimeUS,Active,NumPts,MaxPts,Action,N,E,D", "s----mmm", "F----000" }, \
  1280. { LOG_OA_BENDYRULER_MSG, sizeof(log_OABendyRuler), \
  1281. "OABR","QBHHfLLLL","TimeUS,Active,DesYaw,Yaw,Mar,DLat,DLng,OALat,OALng", "sbddmDUDU", "F----GGGG" }, \
  1282. { LOG_OA_DIJKSTRA_MSG, sizeof(log_OADijkstra), \
  1283. "OADJ","QBBBLLLL","TimeUS,State,CurrPoint,TotPoints,DLat,DLng,OALat,OALng", "sbbbDUDU", "F---GGGG" }
  1284. // messages for more advanced boards
  1285. #define LOG_EXTRA_STRUCTURES \
  1286. { LOG_IMU2_MSG, sizeof(log_IMU), \
  1287. "IMU2", IMU_FMT, IMU_LABELS, IMU_UNITS, IMU_MULTS }, \
  1288. { LOG_IMU3_MSG, sizeof(log_IMU), \
  1289. "IMU3", IMU_FMT, IMU_LABELS, IMU_UNITS, IMU_MULTS }, \
  1290. { LOG_AHR2_MSG, sizeof(log_AHRS), \
  1291. "AHR2","QccCfLLffff","TimeUS,Roll,Pitch,Yaw,Alt,Lat,Lng,Q1,Q2,Q3,Q4","sddhmDU????", "FBBB0GG????" }, \
  1292. { LOG_POS_MSG, sizeof(log_POS), \
  1293. "POS","QLLfff","TimeUS,Lat,Lng,Alt,RelHomeAlt,RelOriginAlt", "sDUmmm", "FGG000" }, \
  1294. { LOG_SIMSTATE_MSG, sizeof(log_AHRS), \
  1295. "SIM","QccCfLLffff","TimeUS,Roll,Pitch,Yaw,Alt,Lat,Lng,Q1,Q2,Q3,Q4", "sddhmDU????", "FBBB0GG????" }, \
  1296. { LOG_NKF1_MSG, sizeof(log_EKF1), \
  1297. "NKF1","QccCfffffffccce","TimeUS,Roll,Pitch,Yaw,VN,VE,VD,dPD,PN,PE,PD,GX,GY,GZ,OH", "sddhnnnnmmmkkkm", "FBBB0000000BBBB" }, \
  1298. { LOG_NKF2_MSG, sizeof(log_NKF2), \
  1299. "NKF2","QbccccchhhhhhB","TimeUS,AZbias,GSX,GSY,GSZ,VWN,VWE,MN,ME,MD,MX,MY,MZ,MI", "s----nnGGGGGG-", "F----BBCCCCCC-" }, \
  1300. { LOG_NKF3_MSG, sizeof(log_NKF3), \
  1301. "NKF3","Qcccccchhhcc","TimeUS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IYAW,IVT", "snnnmmmGGG??", "FBBBBBBCCCBB" }, \
  1302. { LOG_NKF4_MSG, sizeof(log_NKF4), \
  1303. "NKF4","QcccccfbbHBHHb","TimeUS,SV,SP,SH,SM,SVT,errRP,OFN,OFE,FS,TS,SS,GPS,PI", "s------??-----", "F------??-----" }, \
  1304. { LOG_NKF5_MSG, sizeof(log_NKF5), \
  1305. "NKF5","QBhhhcccCCfff","TimeUS,NI,FIX,FIY,AFI,HAGL,offset,RI,rng,Herr,eAng,eVel,ePos", "s----m???mrnm", "F----BBBBB000" }, \
  1306. { LOG_NKF6_MSG, sizeof(log_EKF1), \
  1307. "NKF6","QccCfffffffccce","TimeUS,Roll,Pitch,Yaw,VN,VE,VD,dPD,PN,PE,PD,GX,GY,GZ,OH", "sddhnnn-mmmkkkm", "FBBB000-000BBBB" }, \
  1308. { LOG_NKF7_MSG, sizeof(log_NKF2), \
  1309. "NKF7","QbccccchhhhhhB","TimeUS,AZbias,GSX,GSY,GSZ,VWN,VWE,MN,ME,MD,MX,MY,MZ,MI", "s----nnGGGGGG-", "F----BBCCCCCC-" }, \
  1310. { LOG_NKF8_MSG, sizeof(log_NKF3), \
  1311. "NKF8","Qcccccchhhcc","TimeUS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IYAW,IVT", "snnnmmmGGGd?", "FBBBBBBCCCBB" }, \
  1312. { LOG_NKF9_MSG, sizeof(log_NKF4), \
  1313. "NKF9","QcccccfbbHBHHb","TimeUS,SV,SP,SH,SM,SVT,errRP,OFN,OFE,FS,TS,SS,GPS,PI", "s-----???-----", "F-----???-----" }, \
  1314. { LOG_NKF10_MSG, sizeof(log_RngBcnDebug), \
  1315. "NKF0","QBccCCcccccccc","TimeUS,ID,rng,innov,SIV,TR,BPN,BPE,BPD,OFH,OFL,OFN,OFE,OFD", "s-m---mmmmmmmm", "F-B---BBBBBBBB" }, \
  1316. { LOG_NKF11_MSG, sizeof(log_EKF1), \
  1317. "NK11","QccCfffffffccce","TimeUS,Roll,Pitch,Yaw,VN,VE,VD,dPD,PN,PE,PD,GX,GY,GZ,OH", "sddhnnn-mmmkkkm", "FBBB000-000BBBB" }, \
  1318. { LOG_NKF12_MSG, sizeof(log_NKF2), \
  1319. "NK12","QbccccchhhhhhB","TimeUS,AZbias,GSX,GSY,GSZ,VWN,VWE,MN,ME,MD,MX,MY,MZ,MI", "s----nnGGGGGG-", "F----BBCCCCCC-" }, \
  1320. { LOG_NKF13_MSG, sizeof(log_NKF3), \
  1321. "NK13","Qcccccchhhcc","TimeUS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IYAW,IVT", "snnnmmmGGGd?", "FBBBBBBCCCBB" }, \
  1322. { LOG_NKF14_MSG, sizeof(log_NKF4), \
  1323. "NK14","QcccccfbbHBHHb","TimeUS,SV,SP,SH,SM,SVT,errRP,OFN,OFE,FS,TS,SS,GPS,PI", "s-----???-----", "F-----???-----" }, \
  1324. { LOG_NKQ1_MSG, sizeof(log_Quaternion), "NKQ1", QUAT_FMT, QUAT_LABELS, QUAT_UNITS, QUAT_MULTS }, \
  1325. { LOG_NKQ2_MSG, sizeof(log_Quaternion), "NKQ2", QUAT_FMT, QUAT_LABELS, QUAT_UNITS, QUAT_MULTS }, \
  1326. { LOG_NKQ3_MSG, sizeof(log_Quaternion), "NKQ3", QUAT_FMT, QUAT_LABELS, QUAT_UNITS, QUAT_MULTS }, \
  1327. { LOG_XKF1_MSG, sizeof(log_EKF1), \
  1328. "XKF1","QccCfffffffccce","TimeUS,Roll,Pitch,Yaw,VN,VE,VD,dPD,PN,PE,PD,GX,GY,GZ,OH", "sddhnnnnmmmkkkm", "FBBB0000000BBBB" }, \
  1329. { LOG_XKF2_MSG, sizeof(log_NKF2a), \
  1330. "XKF2","QccccchhhhhhB","TimeUS,AX,AY,AZ,VWN,VWE,MN,ME,MD,MX,MY,MZ,MI", "s---nnGGGGGG-", "F---BBCCCCCC-" }, \
  1331. { LOG_XKF3_MSG, sizeof(log_NKF3), \
  1332. "XKF3","Qcccccchhhcc","TimeUS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IYAW,IVT", "snnnmmmGGG??", "FBBBBBBCCCBB" }, \
  1333. { LOG_XKF4_MSG, sizeof(log_NKF4), \
  1334. "XKF4","QcccccfbbHBHHb","TimeUS,SV,SP,SH,SM,SVT,errRP,OFN,OFE,FS,TS,SS,GPS,PI", "s------??-----", "F------??-----" }, \
  1335. { LOG_XKF5_MSG, sizeof(log_NKF5), \
  1336. "XKF5","QBhhhcccCCfff","TimeUS,NI,FIX,FIY,AFI,HAGL,offset,RI,rng,Herr,eAng,eVel,ePos", "s----m???mrnm", "F----BBBBB000" }, \
  1337. { LOG_XKF6_MSG, sizeof(log_EKF1), \
  1338. "XKF6","QccCfffffffccce","TimeUS,Roll,Pitch,Yaw,VN,VE,VD,dPD,PN,PE,PD,GX,GY,GZ,OH", "sddhnnn-mmmkkkm", "FBBB000-000BBBB" }, \
  1339. { LOG_XKF7_MSG, sizeof(log_NKF2a), \
  1340. "XKF7","QccccchhhhhhB","TimeUS,AX,AY,AZ,VWN,VWE,MN,ME,MD,MX,MY,MZ,MI", "s---nnGGGGGG-", "F---BBCCCCCC-" }, \
  1341. { LOG_XKF8_MSG, sizeof(log_NKF3), \
  1342. "XKF8","Qcccccchhhcc","TimeUS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IYAW,IVT", "snnnmmmGGGd?", "FBBBBBBCCCBB" }, \
  1343. { LOG_XKF9_MSG, sizeof(log_NKF4), \
  1344. "XKF9","QcccccfbbHBHHb","TimeUS,SV,SP,SH,SM,SVT,errRP,OFN,OFE,FS,TS,SS,GPS,PI", "s-----???-----", "F-----???-----" }, \
  1345. { LOG_XKF10_MSG, sizeof(log_RngBcnDebug), \
  1346. "XKF0","QBccCCcccccccc","TimeUS,ID,rng,innov,SIV,TR,BPN,BPE,BPD,OFH,OFL,OFN,OFE,OFD", "s-m---mmmmmmmm", "F-B---BBBBBBBB" }, \
  1347. { LOG_XKF11_MSG, sizeof(log_EKF1), \
  1348. "XK11","QccCfffffffccce","TimeUS,Roll,Pitch,Yaw,VN,VE,VD,dPD,PN,PE,PD,GX,GY,GZ,OH", "sddhnnn-mmmkkkm", "FBBB000-000BBBB" }, \
  1349. { LOG_XKF12_MSG, sizeof(log_NKF2a), \
  1350. "XK12","QccccchhhhhhB","TimeUS,AX,AY,AZ,VWN,VWE,MN,ME,MD,MX,MY,MZ,MI", "s---nnGGGGGG-", "F---BBCCCCCC-" }, \
  1351. { LOG_XKF13_MSG, sizeof(log_NKF3), \
  1352. "XK13","Qcccccchhhcc","TimeUS,IVN,IVE,IVD,IPN,IPE,IPD,IMX,IMY,IMZ,IYAW,IVT", "snnnmmmGGGd?", "FBBBBBBCCCBB" }, \
  1353. { LOG_XKF14_MSG, sizeof(log_NKF4), \
  1354. "XK14","QcccccfbbHBHHb","TimeUS,SV,SP,SH,SM,SVT,errRP,OFN,OFE,FS,TS,SS,GPS,PI", "s-----???-----", "F-----???-----" }, \
  1355. { LOG_XKQ1_MSG, sizeof(log_Quaternion), "XKQ1", QUAT_FMT, QUAT_LABELS, QUAT_UNITS, QUAT_MULTS }, \
  1356. { LOG_XKQ2_MSG, sizeof(log_Quaternion), "XKQ2", QUAT_FMT, QUAT_LABELS, QUAT_UNITS, QUAT_MULTS }, \
  1357. { LOG_XKQ3_MSG, sizeof(log_Quaternion), "XKQ3", QUAT_FMT, QUAT_LABELS, QUAT_UNITS, QUAT_MULTS }, \
  1358. { LOG_XKFD_MSG, sizeof(log_ekfBodyOdomDebug), \
  1359. "XKFD","Qffffff","TimeUS,IX,IY,IZ,IVX,IVY,IVZ", "s------", "F------" }, \
  1360. { LOG_XKV1_MSG, sizeof(log_ekfStateVar), \
  1361. "XKV1","Qffffffffffff","TimeUS,V00,V01,V02,V03,V04,V05,V06,V07,V08,V09,V10,V11", "s------------", "F------------" }, \
  1362. { LOG_XKV2_MSG, sizeof(log_ekfStateVar), \
  1363. "XKV2","Qffffffffffff","TimeUS,V12,V13,V14,V15,V16,V17,V18,V19,V20,V21,V22,V23", "s------------", "F------------" }, \
  1364. { LOG_TERRAIN_MSG, sizeof(log_TERRAIN), \
  1365. "TERR","QBLLHffHH","TimeUS,Status,Lat,Lng,Spacing,TerrH,CHeight,Pending,Loaded", "s-DU-mm--", "F-GG-00--" }, \
  1366. { LOG_GPS_UBX1_MSG, sizeof(log_Ubx1), \
  1367. "UBX1", "QBHBBHI", "TimeUS,Instance,noisePerMS,jamInd,aPower,agcCnt,config", "s------", "F------" }, \
  1368. { LOG_GPS_UBX2_MSG, sizeof(log_Ubx2), \
  1369. "UBX2", "QBbBbB", "TimeUS,Instance,ofsI,magI,ofsQ,magQ", "s-----", "F-----" }, \
  1370. { LOG_GPS2_UBX1_MSG, sizeof(log_Ubx1), \
  1371. "UBY1", "QBHBBHI", "TimeUS,Instance,noisePerMS,jamInd,aPower,agcCnt,config", "s------", "F------" }, \
  1372. { LOG_GPS2_UBX2_MSG, sizeof(log_Ubx2), \
  1373. "UBY2", "QBbBbB", "TimeUS,Instance,ofsI,magI,ofsQ,magQ", "s-----", "F-----" }, \
  1374. { LOG_GPS_RAW_MSG, sizeof(log_GPS_RAW), \
  1375. "GRAW", "QIHBBddfBbB", "TimeUS,WkMS,Week,numSV,sv,cpMes,prMes,doMes,mesQI,cno,lli", "s--S-------", "F--0-------" }, \
  1376. { LOG_GPS_RAWH_MSG, sizeof(log_GPS_RAWH), \
  1377. "GRXH", "QdHbBB", "TimeUS,rcvTime,week,leapS,numMeas,recStat", "s-----", "F-----" }, \
  1378. { LOG_GPS_RAWS_MSG, sizeof(log_GPS_RAWS), \
  1379. "GRXS", "QddfBBBHBBBBB", "TimeUS,prMes,cpMes,doMes,gnss,sv,freq,lock,cno,prD,cpD,doD,trk", "s------------", "F------------" }, \
  1380. { LOG_GPS_SBF_EVENT_MSG, sizeof(log_GPS_SBF_EVENT), \
  1381. "SBFE", "QIHBBdddfffff", "TimeUS,TOW,WN,Mode,Err,Lat,Lng,Height,Undul,Vn,Ve,Vu,COG", "s----DUm-nnnh", "F----000-0000" }, \
  1382. { LOG_ESC1_MSG, sizeof(log_Esc), \
  1383. "ESC1", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1384. { LOG_ESC2_MSG, sizeof(log_Esc), \
  1385. "ESC2", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1386. { LOG_ESC3_MSG, sizeof(log_Esc), \
  1387. "ESC3", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1388. { LOG_ESC4_MSG, sizeof(log_Esc), \
  1389. "ESC4", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1390. { LOG_ESC5_MSG, sizeof(log_Esc), \
  1391. "ESC5", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1392. { LOG_ESC6_MSG, sizeof(log_Esc), \
  1393. "ESC6", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1394. { LOG_ESC7_MSG, sizeof(log_Esc), \
  1395. "ESC7", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1396. { LOG_ESC8_MSG, sizeof(log_Esc), \
  1397. "ESC8", ESC_FMT, ESC_LABELS, ESC_UNITS, ESC_MULTS }, \
  1398. { LOG_COMPASS2_MSG, sizeof(log_Compass), \
  1399. "MAG2",MAG_FMT, MAG_LABELS, MAG_UNITS, MAG_MULTS }, \
  1400. { LOG_COMPASS3_MSG, sizeof(log_Compass), \
  1401. "MAG3",MAG_FMT, MAG_LABELS, MAG_UNITS, MAG_MULTS }, \
  1402. { LOG_ACC1_MSG, sizeof(log_ACCEL), \
  1403. "ACC1", ACC_FMT, ACC_LABELS, ACC_UNITS, ACC_MULTS }, \
  1404. { LOG_ACC2_MSG, sizeof(log_ACCEL), \
  1405. "ACC2", ACC_FMT, ACC_LABELS, ACC_UNITS, ACC_MULTS }, \
  1406. { LOG_ACC3_MSG, sizeof(log_ACCEL), \
  1407. "ACC3", ACC_FMT, ACC_LABELS, ACC_UNITS, ACC_MULTS }, \
  1408. { LOG_GYR1_MSG, sizeof(log_GYRO), \
  1409. "GYR1", GYR_FMT, GYR_LABELS, GYR_UNITS, GYR_MULTS }, \
  1410. { LOG_GYR2_MSG, sizeof(log_GYRO), \
  1411. "GYR2", GYR_FMT, GYR_LABELS, GYR_UNITS, GYR_MULTS }, \
  1412. { LOG_GYR3_MSG, sizeof(log_GYRO), \
  1413. "GYR3", GYR_FMT, GYR_LABELS, GYR_UNITS, GYR_MULTS }, \
  1414. { LOG_PIDR_MSG, sizeof(log_PID), \
  1415. "PIDR", PID_FMT, PID_LABELS, PID_UNITS, PID_MULTS }, \
  1416. { LOG_PIDP_MSG, sizeof(log_PID), \
  1417. "PIDP", PID_FMT, PID_LABELS, PID_UNITS, PID_MULTS }, \
  1418. { LOG_PIDY_MSG, sizeof(log_PID), \
  1419. "PIDY", PID_FMT, PID_LABELS, PID_UNITS, PID_MULTS }, \
  1420. { LOG_PIDA_MSG, sizeof(log_PID), \
  1421. "PIDA", PID_FMT, PID_LABELS, PID_UNITS, PID_MULTS }, \
  1422. { LOG_PIDS_MSG, sizeof(log_PID), \
  1423. "PIDS", PID_FMT, PID_LABELS, PID_UNITS, PID_MULTS }, \
  1424. { LOG_DSTL_MSG, sizeof(log_DSTL), \
  1425. "DSTL", "QBfLLeccfeffff", "TimeUS,Stg,THdg,Lat,Lng,Alt,XT,Travel,L1I,Loiter,Des,P,I,D", "s??DUm--------", "F??000--------" }, \
  1426. { LOG_BAR2_MSG, sizeof(log_BARO), \
  1427. "BAR2", BARO_FMT, BARO_LABELS, BARO_UNITS, BARO_MULTS }, \
  1428. { LOG_BAR3_MSG, sizeof(log_BARO), \
  1429. "BAR3", BARO_FMT, BARO_LABELS, BARO_UNITS, BARO_MULTS }, \
  1430. { LOG_VIBE_MSG, sizeof(log_Vibe), \
  1431. "VIBE", "QfffIII", "TimeUS,VibeX,VibeY,VibeZ,Clip0,Clip1,Clip2", "s------", "F------" }, \
  1432. { LOG_IMUDT_MSG, sizeof(log_IMUDT), \
  1433. "IMT",IMT_FMT,IMT_LABELS, IMT_UNITS, IMT_MULTS }, \
  1434. { LOG_IMUDT2_MSG, sizeof(log_IMUDT), \
  1435. "IMT2",IMT_FMT,IMT_LABELS, IMT_UNITS, IMT_MULTS }, \
  1436. { LOG_IMUDT3_MSG, sizeof(log_IMUDT), \
  1437. "IMT3",IMT_FMT,IMT_LABELS, IMT_UNITS, IMT_MULTS }, \
  1438. { LOG_ISBH_MSG, sizeof(log_ISBH), \
  1439. "ISBH",ISBH_FMT,ISBH_LABELS,ISBH_UNITS,ISBH_MULTS }, \
  1440. { LOG_ISBD_MSG, sizeof(log_ISBD), \
  1441. "ISBD",ISBD_FMT,ISBD_LABELS, ISBD_UNITS, ISBD_MULTS }, \
  1442. { LOG_ORGN_MSG, sizeof(log_ORGN), \
  1443. "ORGN","QBLLe","TimeUS,Type,Lat,Lng,Alt", "s-DUm", "F-GGB" }, \
  1444. { LOG_DF_FILE_STATS, sizeof(log_DSF), \
  1445. "DSF", "QIHIIII", "TimeUS,Dp,Blk,Bytes,FMn,FMx,FAv", "s--b---", "F--0---" }, \
  1446. { LOG_RPM_MSG, sizeof(log_RPM), \
  1447. "RPM", "Qff", "TimeUS,rpm1,rpm2", "sqq", "F00" }, \
  1448. { LOG_GIMBAL1_MSG, sizeof(log_Gimbal1), \
  1449. "GMB1", "Iffffffffff", "TimeMS,dt,dax,day,daz,dvx,dvy,dvz,jx,jy,jz", "ssrrrEEELLL", "CC000000000" }, \
  1450. { LOG_GIMBAL2_MSG, sizeof(log_Gimbal2), \
  1451. "GMB2", "IBfffffffff", "TimeMS,es,ex,ey,ez,rx,ry,rz,tx,ty,tz", "s-rrrEEELLL", "C-000000000" }, \
  1452. { LOG_GIMBAL3_MSG, sizeof(log_Gimbal3), \
  1453. "GMB3", "Ihhh", "TimeMS,rl_torque_cmd,el_torque_cmd,az_torque_cmd", "s???", "C???" }, \
  1454. { LOG_RATE_MSG, sizeof(log_Rate), \
  1455. "RATE", "Qffffffffffff", "TimeUS,RDes,R,ROut,PDes,P,POut,YDes,Y,YOut,ADes,A,AOut", "skk-kk-kk-oo-", "F?????????BB-" }, \
  1456. { LOG_RALLY_MSG, sizeof(log_Rally), \
  1457. "RALY", "QBBLLh", "TimeUS,Tot,Seq,Lat,Lng,Alt", "s--DUm", "F--GGB" }, \
  1458. { LOG_MAV_MSG, sizeof(log_MAV), \
  1459. "MAV", "QBHHH", "TimeUS,chan,txp,rxp,rxdp", "s#---", "F-000" }, \
  1460. { LOG_VISUALODOM_MSG, sizeof(log_VisualOdom), \
  1461. "VISO", "Qffffffff", "TimeUS,dt,AngDX,AngDY,AngDZ,PosDX,PosDY,PosDZ,conf", "ssrrrmmm-", "FF000000-" }, \
  1462. { LOG_OPTFLOW_MSG, sizeof(log_Optflow), \
  1463. "OF", "QBffff", "TimeUS,Qual,flowX,flowY,bodyX,bodyY", "s-EEEE", "F-0000" }, \
  1464. { LOG_WHEELENCODER_MSG, sizeof(log_WheelEncoder), \
  1465. "WENC", "Qfbfb", "TimeUS,Dist0,Qual0,Dist1,Qual1", "sm-m-", "F0-0-" }, \
  1466. { LOG_ADSB_MSG, sizeof(log_ADSB), \
  1467. "ADSB", "QIiiiHHhH", "TimeUS,ICAO_address,Lat,Lng,Alt,Heading,Hor_vel,Ver_vel,Squark", "s-DUmhnn-", "F-GGCBCC-" }
  1468. #define LOG_SBP_STRUCTURES \
  1469. { LOG_MSG_SBPHEALTH, sizeof(log_SbpHealth), \
  1470. "SBPH", "QIII", "TimeUS,CrcError,LastInject,IARhyp", "s---", "F---" }, \
  1471. { LOG_MSG_SBPRAWH, sizeof(log_SbpRAWH), \
  1472. "SBRH", "QQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6", "s--b----", "F--0----" }, \
  1473. { LOG_MSG_SBPRAWM, sizeof(log_SbpRAWM), \
  1474. "SBRM", "QQQQQQQQQQQQQQQ", "TimeUS,msg_flag,1,2,3,4,5,6,7,8,9,10,11,12,13", "s??????????????", "F??????????????" }, \
  1475. { LOG_EVENT_MSG, sizeof(log_Event), \
  1476. "EV", "QB", "TimeUS,Id", "s-", "F-" }, \
  1477. { LOG_MSG_SBPEVENT, sizeof(log_SbpEvent), \
  1478. "SBRE", "QHIiBB", "TimeUS,GWk,GMS,ns_residual,level,quality", "s?????", "F?????" }, \
  1479. { LOG_ARM_DISARM_MSG, sizeof(log_Arm_Disarm), \
  1480. "ARM", "QBH", "TimeUS,ArmState,ArmChecks", "s--", "F--" }, \
  1481. { LOG_ERROR_MSG, sizeof(log_Error), \
  1482. "ERR", "QBB", "TimeUS,Subsys,ECode", "s--", "F--" }
  1483. #define LOG_COMMON_STRUCTURES LOG_BASE_STRUCTURES, LOG_EXTRA_STRUCTURES, LOG_SBP_STRUCTURES
  1484. // message types 0 to 63 reserved for vehicle specific use
  1485. // message types for common messages
  1486. enum LogMessages : uint8_t {
  1487. LOG_NKF1_MSG = 64,
  1488. LOG_NKF2_MSG,
  1489. LOG_NKF3_MSG,
  1490. LOG_NKF4_MSG,
  1491. LOG_NKF5_MSG,
  1492. LOG_NKF6_MSG,
  1493. LOG_NKF7_MSG,
  1494. LOG_NKF8_MSG,
  1495. LOG_NKF9_MSG,
  1496. LOG_NKF10_MSG,
  1497. LOG_NKF11_MSG,
  1498. LOG_NKF12_MSG,
  1499. LOG_NKF13_MSG,
  1500. LOG_NKF14_MSG,
  1501. LOG_NKQ1_MSG,
  1502. LOG_NKQ2_MSG,
  1503. LOG_NKQ3_MSG,
  1504. LOG_XKF1_MSG,
  1505. LOG_XKF2_MSG,
  1506. LOG_XKF3_MSG,
  1507. LOG_XKF4_MSG,
  1508. LOG_XKF5_MSG,
  1509. LOG_XKF6_MSG,
  1510. LOG_XKF7_MSG,
  1511. LOG_XKF8_MSG,
  1512. LOG_XKF9_MSG,
  1513. LOG_XKF10_MSG,
  1514. LOG_XKF11_MSG,
  1515. LOG_XKF12_MSG,
  1516. LOG_XKF13_MSG,
  1517. LOG_XKF14_MSG,
  1518. LOG_XKQ1_MSG,
  1519. LOG_XKQ2_MSG,
  1520. LOG_XKQ3_MSG,
  1521. LOG_XKFD_MSG,
  1522. LOG_XKV1_MSG,
  1523. LOG_XKV2_MSG,
  1524. LOG_FORMAT_MSG = 128, // this must remain #128
  1525. LOG_PARAMETER_MSG,
  1526. LOG_GPS_MSG,
  1527. LOG_GPS2_MSG,
  1528. LOG_GPSB_MSG,
  1529. LOG_IMU_MSG,
  1530. LOG_MESSAGE_MSG,
  1531. LOG_RCIN_MSG,
  1532. LOG_RCOUT_MSG,
  1533. LOG_RSSI_MSG,
  1534. LOG_IMU2_MSG,
  1535. LOG_BARO_MSG,
  1536. LOG_POWR_MSG,
  1537. LOG_AHR2_MSG,
  1538. LOG_SIMSTATE_MSG,
  1539. LOG_CMD_MSG,
  1540. LOG_MAVLINK_COMMAND_MSG,
  1541. LOG_RADIO_MSG,
  1542. LOG_ATRP_MSG,
  1543. LOG_CAMERA_MSG,
  1544. LOG_IMU3_MSG,
  1545. LOG_TERRAIN_MSG,
  1546. LOG_GPS_UBX1_MSG,
  1547. LOG_GPS_UBX2_MSG,
  1548. LOG_GPS2_UBX1_MSG,
  1549. LOG_GPS2_UBX2_MSG,
  1550. LOG_ESC1_MSG,
  1551. LOG_ESC2_MSG,
  1552. LOG_ESC3_MSG,
  1553. LOG_ESC4_MSG,
  1554. LOG_ESC5_MSG,
  1555. LOG_ESC6_MSG,
  1556. LOG_ESC7_MSG,
  1557. LOG_ESC8_MSG,
  1558. LOG_BAR2_MSG,
  1559. LOG_ARSP_MSG,
  1560. LOG_ATTITUDE_MSG,
  1561. LOG_CURRENT_MSG,
  1562. LOG_CURRENT2_MSG,
  1563. LOG_CURRENT3_MSG,
  1564. LOG_CURRENT4_MSG,
  1565. LOG_CURRENT5_MSG,
  1566. LOG_CURRENT6_MSG,
  1567. LOG_CURRENT7_MSG,
  1568. LOG_CURRENT8_MSG,
  1569. LOG_CURRENT9_MSG,
  1570. LOG_CURRENT_CELLS_MSG,
  1571. LOG_CURRENT_CELLS2_MSG,
  1572. LOG_CURRENT_CELLS3_MSG,
  1573. LOG_CURRENT_CELLS4_MSG,
  1574. LOG_CURRENT_CELLS5_MSG,
  1575. LOG_CURRENT_CELLS6_MSG,
  1576. LOG_CURRENT_CELLS7_MSG,
  1577. LOG_CURRENT_CELLS8_MSG,
  1578. LOG_CURRENT_CELLS9_MSG,
  1579. LOG_COMPASS_MSG,
  1580. LOG_COMPASS2_MSG,
  1581. LOG_COMPASS3_MSG,
  1582. LOG_MODE_MSG,
  1583. LOG_GPS_RAW_MSG,
  1584. LOG_GPS_RAWH_MSG,
  1585. LOG_GPS_RAWS_MSG,
  1586. LOG_GPS_SBF_EVENT_MSG,
  1587. LOG_ACC1_MSG,
  1588. LOG_ACC2_MSG,
  1589. LOG_ACC3_MSG,
  1590. LOG_GYR1_MSG,
  1591. LOG_GYR2_MSG,
  1592. LOG_GYR3_MSG,
  1593. LOG_POS_MSG,
  1594. LOG_PIDR_MSG,
  1595. LOG_PIDP_MSG,
  1596. LOG_PIDY_MSG,
  1597. LOG_PIDA_MSG,
  1598. LOG_PIDS_MSG,
  1599. LOG_DSTL_MSG,
  1600. LOG_VIBE_MSG,
  1601. LOG_IMUDT_MSG,
  1602. LOG_IMUDT2_MSG,
  1603. LOG_IMUDT3_MSG,
  1604. LOG_ORGN_MSG,
  1605. LOG_RPM_MSG,
  1606. LOG_GPA_MSG,
  1607. LOG_GPA2_MSG,
  1608. LOG_GPAB_MSG,
  1609. LOG_RFND_MSG,
  1610. LOG_BAR3_MSG,
  1611. LOG_MAV_STATS,
  1612. LOG_FORMAT_UNITS_MSG,
  1613. LOG_UNIT_MSG,
  1614. LOG_MULT_MSG,
  1615. LOG_MSG_SBPHEALTH,
  1616. LOG_MSG_SBPLLH,
  1617. LOG_MSG_SBPBASELINE,
  1618. LOG_MSG_SBPTRACKING1,
  1619. LOG_MSG_SBPTRACKING2,
  1620. LOG_MSG_SBPRAWH,
  1621. LOG_MSG_SBPRAWM,
  1622. LOG_MSG_SBPEVENT,
  1623. LOG_TRIGGER_MSG,
  1624. LOG_GIMBAL1_MSG,
  1625. LOG_GIMBAL2_MSG,
  1626. LOG_GIMBAL3_MSG,
  1627. LOG_RATE_MSG,
  1628. LOG_RALLY_MSG,
  1629. LOG_VISUALODOM_MSG,
  1630. LOG_AOA_SSA_MSG,
  1631. LOG_BEACON_MSG,
  1632. LOG_PROXIMITY_MSG,
  1633. LOG_DF_FILE_STATS,
  1634. LOG_SRTL_MSG,
  1635. LOG_ISBH_MSG,
  1636. LOG_ISBD_MSG,
  1637. LOG_ASP2_MSG,
  1638. LOG_PERFORMANCE_MSG,
  1639. LOG_OPTFLOW_MSG,
  1640. LOG_EVENT_MSG,
  1641. LOG_WHEELENCODER_MSG,
  1642. LOG_MAV_MSG,
  1643. LOG_ERROR_MSG,
  1644. LOG_ADSB_MSG,
  1645. LOG_ARM_DISARM_MSG,
  1646. LOG_OA_BENDYRULER_MSG,
  1647. LOG_OA_DIJKSTRA_MSG,
  1648. _LOG_LAST_MSG_
  1649. };
  1650. static_assert(_LOG_LAST_MSG_ <= 255, "Too many message formats");
  1651. enum LogOriginType {
  1652. ekf_origin = 0,
  1653. ahrs_home = 1
  1654. };