mavlink_msg_fw_soaring_data.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  1. #pragma once
  2. // MESSAGE FW_SOARING_DATA PACKING
  3. #define MAVLINK_MSG_ID_FW_SOARING_DATA 210
  4. typedef struct __mavlink_fw_soaring_data_t {
  5. uint64_t timestamp; /*< [ms] Timestamp*/
  6. uint64_t timestampModeChanged; /*< [ms] Timestamp since last mode change*/
  7. float xW; /*< [m/s] Thermal core updraft strength*/
  8. float xR; /*< [m] Thermal radius*/
  9. float xLat; /*< [deg] Thermal center latitude*/
  10. float xLon; /*< [deg] Thermal center longitude*/
  11. float VarW; /*< Variance W*/
  12. float VarR; /*< Variance R*/
  13. float VarLat; /*< Variance Lat*/
  14. float VarLon; /*< Variance Lon */
  15. float LoiterRadius; /*< [m] Suggested loiter radius*/
  16. float LoiterDirection; /*< Suggested loiter direction*/
  17. float DistToSoarPoint; /*< [m] Distance to soar point*/
  18. float vSinkExp; /*< [m/s] Expected sink rate at current airspeed, roll and throttle*/
  19. float z1_LocalUpdraftSpeed; /*< [m/s] Measurement / updraft speed at current/local airplane position*/
  20. float z2_DeltaRoll; /*< [deg] Measurement / roll angle tracking error*/
  21. float z1_exp; /*< Expected measurement 1*/
  22. float z2_exp; /*< Expected measurement 2*/
  23. float ThermalGSNorth; /*< [m/s] Thermal drift (from estimator prediction step only)*/
  24. float ThermalGSEast; /*< [m/s] Thermal drift (from estimator prediction step only)*/
  25. float TSE_dot; /*< [m/s] Total specific energy change (filtered)*/
  26. float DebugVar1; /*< Debug variable 1*/
  27. float DebugVar2; /*< Debug variable 2*/
  28. uint8_t ControlMode; /*< Control Mode [-]*/
  29. uint8_t valid; /*< Data valid [-]*/
  30. } mavlink_fw_soaring_data_t;
  31. #define MAVLINK_MSG_ID_FW_SOARING_DATA_LEN 102
  32. #define MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN 102
  33. #define MAVLINK_MSG_ID_210_LEN 102
  34. #define MAVLINK_MSG_ID_210_MIN_LEN 102
  35. #define MAVLINK_MSG_ID_FW_SOARING_DATA_CRC 20
  36. #define MAVLINK_MSG_ID_210_CRC 20
  37. #if MAVLINK_COMMAND_24BIT
  38. #define MAVLINK_MESSAGE_INFO_FW_SOARING_DATA { \
  39. 210, \
  40. "FW_SOARING_DATA", \
  41. 25, \
  42. { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_fw_soaring_data_t, timestamp) }, \
  43. { "timestampModeChanged", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_fw_soaring_data_t, timestampModeChanged) }, \
  44. { "xW", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_fw_soaring_data_t, xW) }, \
  45. { "xR", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_fw_soaring_data_t, xR) }, \
  46. { "xLat", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_fw_soaring_data_t, xLat) }, \
  47. { "xLon", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_fw_soaring_data_t, xLon) }, \
  48. { "VarW", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_fw_soaring_data_t, VarW) }, \
  49. { "VarR", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_fw_soaring_data_t, VarR) }, \
  50. { "VarLat", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_fw_soaring_data_t, VarLat) }, \
  51. { "VarLon", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_fw_soaring_data_t, VarLon) }, \
  52. { "LoiterRadius", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_fw_soaring_data_t, LoiterRadius) }, \
  53. { "LoiterDirection", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_fw_soaring_data_t, LoiterDirection) }, \
  54. { "DistToSoarPoint", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_fw_soaring_data_t, DistToSoarPoint) }, \
  55. { "vSinkExp", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_fw_soaring_data_t, vSinkExp) }, \
  56. { "z1_LocalUpdraftSpeed", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_fw_soaring_data_t, z1_LocalUpdraftSpeed) }, \
  57. { "z2_DeltaRoll", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_fw_soaring_data_t, z2_DeltaRoll) }, \
  58. { "z1_exp", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_fw_soaring_data_t, z1_exp) }, \
  59. { "z2_exp", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_fw_soaring_data_t, z2_exp) }, \
  60. { "ThermalGSNorth", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_fw_soaring_data_t, ThermalGSNorth) }, \
  61. { "ThermalGSEast", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_fw_soaring_data_t, ThermalGSEast) }, \
  62. { "TSE_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_fw_soaring_data_t, TSE_dot) }, \
  63. { "DebugVar1", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_fw_soaring_data_t, DebugVar1) }, \
  64. { "DebugVar2", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_fw_soaring_data_t, DebugVar2) }, \
  65. { "ControlMode", NULL, MAVLINK_TYPE_UINT8_T, 0, 100, offsetof(mavlink_fw_soaring_data_t, ControlMode) }, \
  66. { "valid", NULL, MAVLINK_TYPE_UINT8_T, 0, 101, offsetof(mavlink_fw_soaring_data_t, valid) }, \
  67. } \
  68. }
  69. #else
  70. #define MAVLINK_MESSAGE_INFO_FW_SOARING_DATA { \
  71. "FW_SOARING_DATA", \
  72. 25, \
  73. { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_fw_soaring_data_t, timestamp) }, \
  74. { "timestampModeChanged", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_fw_soaring_data_t, timestampModeChanged) }, \
  75. { "xW", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_fw_soaring_data_t, xW) }, \
  76. { "xR", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_fw_soaring_data_t, xR) }, \
  77. { "xLat", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_fw_soaring_data_t, xLat) }, \
  78. { "xLon", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_fw_soaring_data_t, xLon) }, \
  79. { "VarW", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_fw_soaring_data_t, VarW) }, \
  80. { "VarR", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_fw_soaring_data_t, VarR) }, \
  81. { "VarLat", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_fw_soaring_data_t, VarLat) }, \
  82. { "VarLon", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_fw_soaring_data_t, VarLon) }, \
  83. { "LoiterRadius", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_fw_soaring_data_t, LoiterRadius) }, \
  84. { "LoiterDirection", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_fw_soaring_data_t, LoiterDirection) }, \
  85. { "DistToSoarPoint", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_fw_soaring_data_t, DistToSoarPoint) }, \
  86. { "vSinkExp", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_fw_soaring_data_t, vSinkExp) }, \
  87. { "z1_LocalUpdraftSpeed", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_fw_soaring_data_t, z1_LocalUpdraftSpeed) }, \
  88. { "z2_DeltaRoll", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_fw_soaring_data_t, z2_DeltaRoll) }, \
  89. { "z1_exp", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_fw_soaring_data_t, z1_exp) }, \
  90. { "z2_exp", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_fw_soaring_data_t, z2_exp) }, \
  91. { "ThermalGSNorth", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_fw_soaring_data_t, ThermalGSNorth) }, \
  92. { "ThermalGSEast", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_fw_soaring_data_t, ThermalGSEast) }, \
  93. { "TSE_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_fw_soaring_data_t, TSE_dot) }, \
  94. { "DebugVar1", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_fw_soaring_data_t, DebugVar1) }, \
  95. { "DebugVar2", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_fw_soaring_data_t, DebugVar2) }, \
  96. { "ControlMode", NULL, MAVLINK_TYPE_UINT8_T, 0, 100, offsetof(mavlink_fw_soaring_data_t, ControlMode) }, \
  97. { "valid", NULL, MAVLINK_TYPE_UINT8_T, 0, 101, offsetof(mavlink_fw_soaring_data_t, valid) }, \
  98. } \
  99. }
  100. #endif
  101. /**
  102. * @brief Pack a fw_soaring_data message
  103. * @param system_id ID of this system
  104. * @param component_id ID of this component (e.g. 200 for IMU)
  105. * @param msg The MAVLink message to compress the data into
  106. *
  107. * @param timestamp [ms] Timestamp
  108. * @param timestampModeChanged [ms] Timestamp since last mode change
  109. * @param xW [m/s] Thermal core updraft strength
  110. * @param xR [m] Thermal radius
  111. * @param xLat [deg] Thermal center latitude
  112. * @param xLon [deg] Thermal center longitude
  113. * @param VarW Variance W
  114. * @param VarR Variance R
  115. * @param VarLat Variance Lat
  116. * @param VarLon Variance Lon
  117. * @param LoiterRadius [m] Suggested loiter radius
  118. * @param LoiterDirection Suggested loiter direction
  119. * @param DistToSoarPoint [m] Distance to soar point
  120. * @param vSinkExp [m/s] Expected sink rate at current airspeed, roll and throttle
  121. * @param z1_LocalUpdraftSpeed [m/s] Measurement / updraft speed at current/local airplane position
  122. * @param z2_DeltaRoll [deg] Measurement / roll angle tracking error
  123. * @param z1_exp Expected measurement 1
  124. * @param z2_exp Expected measurement 2
  125. * @param ThermalGSNorth [m/s] Thermal drift (from estimator prediction step only)
  126. * @param ThermalGSEast [m/s] Thermal drift (from estimator prediction step only)
  127. * @param TSE_dot [m/s] Total specific energy change (filtered)
  128. * @param DebugVar1 Debug variable 1
  129. * @param DebugVar2 Debug variable 2
  130. * @param ControlMode Control Mode [-]
  131. * @param valid Data valid [-]
  132. * @return length of the message in bytes (excluding serial stream start sign)
  133. */
  134. static inline uint16_t mavlink_msg_fw_soaring_data_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  135. uint64_t timestamp, uint64_t timestampModeChanged, float xW, float xR, float xLat, float xLon, float VarW, float VarR, float VarLat, float VarLon, float LoiterRadius, float LoiterDirection, float DistToSoarPoint, float vSinkExp, float z1_LocalUpdraftSpeed, float z2_DeltaRoll, float z1_exp, float z2_exp, float ThermalGSNorth, float ThermalGSEast, float TSE_dot, float DebugVar1, float DebugVar2, uint8_t ControlMode, uint8_t valid)
  136. {
  137. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  138. char buf[MAVLINK_MSG_ID_FW_SOARING_DATA_LEN];
  139. _mav_put_uint64_t(buf, 0, timestamp);
  140. _mav_put_uint64_t(buf, 8, timestampModeChanged);
  141. _mav_put_float(buf, 16, xW);
  142. _mav_put_float(buf, 20, xR);
  143. _mav_put_float(buf, 24, xLat);
  144. _mav_put_float(buf, 28, xLon);
  145. _mav_put_float(buf, 32, VarW);
  146. _mav_put_float(buf, 36, VarR);
  147. _mav_put_float(buf, 40, VarLat);
  148. _mav_put_float(buf, 44, VarLon);
  149. _mav_put_float(buf, 48, LoiterRadius);
  150. _mav_put_float(buf, 52, LoiterDirection);
  151. _mav_put_float(buf, 56, DistToSoarPoint);
  152. _mav_put_float(buf, 60, vSinkExp);
  153. _mav_put_float(buf, 64, z1_LocalUpdraftSpeed);
  154. _mav_put_float(buf, 68, z2_DeltaRoll);
  155. _mav_put_float(buf, 72, z1_exp);
  156. _mav_put_float(buf, 76, z2_exp);
  157. _mav_put_float(buf, 80, ThermalGSNorth);
  158. _mav_put_float(buf, 84, ThermalGSEast);
  159. _mav_put_float(buf, 88, TSE_dot);
  160. _mav_put_float(buf, 92, DebugVar1);
  161. _mav_put_float(buf, 96, DebugVar2);
  162. _mav_put_uint8_t(buf, 100, ControlMode);
  163. _mav_put_uint8_t(buf, 101, valid);
  164. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN);
  165. #else
  166. mavlink_fw_soaring_data_t packet;
  167. packet.timestamp = timestamp;
  168. packet.timestampModeChanged = timestampModeChanged;
  169. packet.xW = xW;
  170. packet.xR = xR;
  171. packet.xLat = xLat;
  172. packet.xLon = xLon;
  173. packet.VarW = VarW;
  174. packet.VarR = VarR;
  175. packet.VarLat = VarLat;
  176. packet.VarLon = VarLon;
  177. packet.LoiterRadius = LoiterRadius;
  178. packet.LoiterDirection = LoiterDirection;
  179. packet.DistToSoarPoint = DistToSoarPoint;
  180. packet.vSinkExp = vSinkExp;
  181. packet.z1_LocalUpdraftSpeed = z1_LocalUpdraftSpeed;
  182. packet.z2_DeltaRoll = z2_DeltaRoll;
  183. packet.z1_exp = z1_exp;
  184. packet.z2_exp = z2_exp;
  185. packet.ThermalGSNorth = ThermalGSNorth;
  186. packet.ThermalGSEast = ThermalGSEast;
  187. packet.TSE_dot = TSE_dot;
  188. packet.DebugVar1 = DebugVar1;
  189. packet.DebugVar2 = DebugVar2;
  190. packet.ControlMode = ControlMode;
  191. packet.valid = valid;
  192. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN);
  193. #endif
  194. msg->msgid = MAVLINK_MSG_ID_FW_SOARING_DATA;
  195. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  196. }
  197. /**
  198. * @brief Pack a fw_soaring_data message on a channel
  199. * @param system_id ID of this system
  200. * @param component_id ID of this component (e.g. 200 for IMU)
  201. * @param chan The MAVLink channel this message will be sent over
  202. * @param msg The MAVLink message to compress the data into
  203. * @param timestamp [ms] Timestamp
  204. * @param timestampModeChanged [ms] Timestamp since last mode change
  205. * @param xW [m/s] Thermal core updraft strength
  206. * @param xR [m] Thermal radius
  207. * @param xLat [deg] Thermal center latitude
  208. * @param xLon [deg] Thermal center longitude
  209. * @param VarW Variance W
  210. * @param VarR Variance R
  211. * @param VarLat Variance Lat
  212. * @param VarLon Variance Lon
  213. * @param LoiterRadius [m] Suggested loiter radius
  214. * @param LoiterDirection Suggested loiter direction
  215. * @param DistToSoarPoint [m] Distance to soar point
  216. * @param vSinkExp [m/s] Expected sink rate at current airspeed, roll and throttle
  217. * @param z1_LocalUpdraftSpeed [m/s] Measurement / updraft speed at current/local airplane position
  218. * @param z2_DeltaRoll [deg] Measurement / roll angle tracking error
  219. * @param z1_exp Expected measurement 1
  220. * @param z2_exp Expected measurement 2
  221. * @param ThermalGSNorth [m/s] Thermal drift (from estimator prediction step only)
  222. * @param ThermalGSEast [m/s] Thermal drift (from estimator prediction step only)
  223. * @param TSE_dot [m/s] Total specific energy change (filtered)
  224. * @param DebugVar1 Debug variable 1
  225. * @param DebugVar2 Debug variable 2
  226. * @param ControlMode Control Mode [-]
  227. * @param valid Data valid [-]
  228. * @return length of the message in bytes (excluding serial stream start sign)
  229. */
  230. static inline uint16_t mavlink_msg_fw_soaring_data_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  231. mavlink_message_t* msg,
  232. uint64_t timestamp,uint64_t timestampModeChanged,float xW,float xR,float xLat,float xLon,float VarW,float VarR,float VarLat,float VarLon,float LoiterRadius,float LoiterDirection,float DistToSoarPoint,float vSinkExp,float z1_LocalUpdraftSpeed,float z2_DeltaRoll,float z1_exp,float z2_exp,float ThermalGSNorth,float ThermalGSEast,float TSE_dot,float DebugVar1,float DebugVar2,uint8_t ControlMode,uint8_t valid)
  233. {
  234. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  235. char buf[MAVLINK_MSG_ID_FW_SOARING_DATA_LEN];
  236. _mav_put_uint64_t(buf, 0, timestamp);
  237. _mav_put_uint64_t(buf, 8, timestampModeChanged);
  238. _mav_put_float(buf, 16, xW);
  239. _mav_put_float(buf, 20, xR);
  240. _mav_put_float(buf, 24, xLat);
  241. _mav_put_float(buf, 28, xLon);
  242. _mav_put_float(buf, 32, VarW);
  243. _mav_put_float(buf, 36, VarR);
  244. _mav_put_float(buf, 40, VarLat);
  245. _mav_put_float(buf, 44, VarLon);
  246. _mav_put_float(buf, 48, LoiterRadius);
  247. _mav_put_float(buf, 52, LoiterDirection);
  248. _mav_put_float(buf, 56, DistToSoarPoint);
  249. _mav_put_float(buf, 60, vSinkExp);
  250. _mav_put_float(buf, 64, z1_LocalUpdraftSpeed);
  251. _mav_put_float(buf, 68, z2_DeltaRoll);
  252. _mav_put_float(buf, 72, z1_exp);
  253. _mav_put_float(buf, 76, z2_exp);
  254. _mav_put_float(buf, 80, ThermalGSNorth);
  255. _mav_put_float(buf, 84, ThermalGSEast);
  256. _mav_put_float(buf, 88, TSE_dot);
  257. _mav_put_float(buf, 92, DebugVar1);
  258. _mav_put_float(buf, 96, DebugVar2);
  259. _mav_put_uint8_t(buf, 100, ControlMode);
  260. _mav_put_uint8_t(buf, 101, valid);
  261. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN);
  262. #else
  263. mavlink_fw_soaring_data_t packet;
  264. packet.timestamp = timestamp;
  265. packet.timestampModeChanged = timestampModeChanged;
  266. packet.xW = xW;
  267. packet.xR = xR;
  268. packet.xLat = xLat;
  269. packet.xLon = xLon;
  270. packet.VarW = VarW;
  271. packet.VarR = VarR;
  272. packet.VarLat = VarLat;
  273. packet.VarLon = VarLon;
  274. packet.LoiterRadius = LoiterRadius;
  275. packet.LoiterDirection = LoiterDirection;
  276. packet.DistToSoarPoint = DistToSoarPoint;
  277. packet.vSinkExp = vSinkExp;
  278. packet.z1_LocalUpdraftSpeed = z1_LocalUpdraftSpeed;
  279. packet.z2_DeltaRoll = z2_DeltaRoll;
  280. packet.z1_exp = z1_exp;
  281. packet.z2_exp = z2_exp;
  282. packet.ThermalGSNorth = ThermalGSNorth;
  283. packet.ThermalGSEast = ThermalGSEast;
  284. packet.TSE_dot = TSE_dot;
  285. packet.DebugVar1 = DebugVar1;
  286. packet.DebugVar2 = DebugVar2;
  287. packet.ControlMode = ControlMode;
  288. packet.valid = valid;
  289. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN);
  290. #endif
  291. msg->msgid = MAVLINK_MSG_ID_FW_SOARING_DATA;
  292. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  293. }
  294. /**
  295. * @brief Encode a fw_soaring_data struct
  296. *
  297. * @param system_id ID of this system
  298. * @param component_id ID of this component (e.g. 200 for IMU)
  299. * @param msg The MAVLink message to compress the data into
  300. * @param fw_soaring_data C-struct to read the message contents from
  301. */
  302. static inline uint16_t mavlink_msg_fw_soaring_data_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_fw_soaring_data_t* fw_soaring_data)
  303. {
  304. return mavlink_msg_fw_soaring_data_pack(system_id, component_id, msg, fw_soaring_data->timestamp, fw_soaring_data->timestampModeChanged, fw_soaring_data->xW, fw_soaring_data->xR, fw_soaring_data->xLat, fw_soaring_data->xLon, fw_soaring_data->VarW, fw_soaring_data->VarR, fw_soaring_data->VarLat, fw_soaring_data->VarLon, fw_soaring_data->LoiterRadius, fw_soaring_data->LoiterDirection, fw_soaring_data->DistToSoarPoint, fw_soaring_data->vSinkExp, fw_soaring_data->z1_LocalUpdraftSpeed, fw_soaring_data->z2_DeltaRoll, fw_soaring_data->z1_exp, fw_soaring_data->z2_exp, fw_soaring_data->ThermalGSNorth, fw_soaring_data->ThermalGSEast, fw_soaring_data->TSE_dot, fw_soaring_data->DebugVar1, fw_soaring_data->DebugVar2, fw_soaring_data->ControlMode, fw_soaring_data->valid);
  305. }
  306. /**
  307. * @brief Encode a fw_soaring_data struct on a channel
  308. *
  309. * @param system_id ID of this system
  310. * @param component_id ID of this component (e.g. 200 for IMU)
  311. * @param chan The MAVLink channel this message will be sent over
  312. * @param msg The MAVLink message to compress the data into
  313. * @param fw_soaring_data C-struct to read the message contents from
  314. */
  315. static inline uint16_t mavlink_msg_fw_soaring_data_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_fw_soaring_data_t* fw_soaring_data)
  316. {
  317. return mavlink_msg_fw_soaring_data_pack_chan(system_id, component_id, chan, msg, fw_soaring_data->timestamp, fw_soaring_data->timestampModeChanged, fw_soaring_data->xW, fw_soaring_data->xR, fw_soaring_data->xLat, fw_soaring_data->xLon, fw_soaring_data->VarW, fw_soaring_data->VarR, fw_soaring_data->VarLat, fw_soaring_data->VarLon, fw_soaring_data->LoiterRadius, fw_soaring_data->LoiterDirection, fw_soaring_data->DistToSoarPoint, fw_soaring_data->vSinkExp, fw_soaring_data->z1_LocalUpdraftSpeed, fw_soaring_data->z2_DeltaRoll, fw_soaring_data->z1_exp, fw_soaring_data->z2_exp, fw_soaring_data->ThermalGSNorth, fw_soaring_data->ThermalGSEast, fw_soaring_data->TSE_dot, fw_soaring_data->DebugVar1, fw_soaring_data->DebugVar2, fw_soaring_data->ControlMode, fw_soaring_data->valid);
  318. }
  319. /**
  320. * @brief Send a fw_soaring_data message
  321. * @param chan MAVLink channel to send the message
  322. *
  323. * @param timestamp [ms] Timestamp
  324. * @param timestampModeChanged [ms] Timestamp since last mode change
  325. * @param xW [m/s] Thermal core updraft strength
  326. * @param xR [m] Thermal radius
  327. * @param xLat [deg] Thermal center latitude
  328. * @param xLon [deg] Thermal center longitude
  329. * @param VarW Variance W
  330. * @param VarR Variance R
  331. * @param VarLat Variance Lat
  332. * @param VarLon Variance Lon
  333. * @param LoiterRadius [m] Suggested loiter radius
  334. * @param LoiterDirection Suggested loiter direction
  335. * @param DistToSoarPoint [m] Distance to soar point
  336. * @param vSinkExp [m/s] Expected sink rate at current airspeed, roll and throttle
  337. * @param z1_LocalUpdraftSpeed [m/s] Measurement / updraft speed at current/local airplane position
  338. * @param z2_DeltaRoll [deg] Measurement / roll angle tracking error
  339. * @param z1_exp Expected measurement 1
  340. * @param z2_exp Expected measurement 2
  341. * @param ThermalGSNorth [m/s] Thermal drift (from estimator prediction step only)
  342. * @param ThermalGSEast [m/s] Thermal drift (from estimator prediction step only)
  343. * @param TSE_dot [m/s] Total specific energy change (filtered)
  344. * @param DebugVar1 Debug variable 1
  345. * @param DebugVar2 Debug variable 2
  346. * @param ControlMode Control Mode [-]
  347. * @param valid Data valid [-]
  348. */
  349. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  350. static inline void mavlink_msg_fw_soaring_data_send(mavlink_channel_t chan, uint64_t timestamp, uint64_t timestampModeChanged, float xW, float xR, float xLat, float xLon, float VarW, float VarR, float VarLat, float VarLon, float LoiterRadius, float LoiterDirection, float DistToSoarPoint, float vSinkExp, float z1_LocalUpdraftSpeed, float z2_DeltaRoll, float z1_exp, float z2_exp, float ThermalGSNorth, float ThermalGSEast, float TSE_dot, float DebugVar1, float DebugVar2, uint8_t ControlMode, uint8_t valid)
  351. {
  352. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  353. char buf[MAVLINK_MSG_ID_FW_SOARING_DATA_LEN];
  354. _mav_put_uint64_t(buf, 0, timestamp);
  355. _mav_put_uint64_t(buf, 8, timestampModeChanged);
  356. _mav_put_float(buf, 16, xW);
  357. _mav_put_float(buf, 20, xR);
  358. _mav_put_float(buf, 24, xLat);
  359. _mav_put_float(buf, 28, xLon);
  360. _mav_put_float(buf, 32, VarW);
  361. _mav_put_float(buf, 36, VarR);
  362. _mav_put_float(buf, 40, VarLat);
  363. _mav_put_float(buf, 44, VarLon);
  364. _mav_put_float(buf, 48, LoiterRadius);
  365. _mav_put_float(buf, 52, LoiterDirection);
  366. _mav_put_float(buf, 56, DistToSoarPoint);
  367. _mav_put_float(buf, 60, vSinkExp);
  368. _mav_put_float(buf, 64, z1_LocalUpdraftSpeed);
  369. _mav_put_float(buf, 68, z2_DeltaRoll);
  370. _mav_put_float(buf, 72, z1_exp);
  371. _mav_put_float(buf, 76, z2_exp);
  372. _mav_put_float(buf, 80, ThermalGSNorth);
  373. _mav_put_float(buf, 84, ThermalGSEast);
  374. _mav_put_float(buf, 88, TSE_dot);
  375. _mav_put_float(buf, 92, DebugVar1);
  376. _mav_put_float(buf, 96, DebugVar2);
  377. _mav_put_uint8_t(buf, 100, ControlMode);
  378. _mav_put_uint8_t(buf, 101, valid);
  379. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FW_SOARING_DATA, buf, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  380. #else
  381. mavlink_fw_soaring_data_t packet;
  382. packet.timestamp = timestamp;
  383. packet.timestampModeChanged = timestampModeChanged;
  384. packet.xW = xW;
  385. packet.xR = xR;
  386. packet.xLat = xLat;
  387. packet.xLon = xLon;
  388. packet.VarW = VarW;
  389. packet.VarR = VarR;
  390. packet.VarLat = VarLat;
  391. packet.VarLon = VarLon;
  392. packet.LoiterRadius = LoiterRadius;
  393. packet.LoiterDirection = LoiterDirection;
  394. packet.DistToSoarPoint = DistToSoarPoint;
  395. packet.vSinkExp = vSinkExp;
  396. packet.z1_LocalUpdraftSpeed = z1_LocalUpdraftSpeed;
  397. packet.z2_DeltaRoll = z2_DeltaRoll;
  398. packet.z1_exp = z1_exp;
  399. packet.z2_exp = z2_exp;
  400. packet.ThermalGSNorth = ThermalGSNorth;
  401. packet.ThermalGSEast = ThermalGSEast;
  402. packet.TSE_dot = TSE_dot;
  403. packet.DebugVar1 = DebugVar1;
  404. packet.DebugVar2 = DebugVar2;
  405. packet.ControlMode = ControlMode;
  406. packet.valid = valid;
  407. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FW_SOARING_DATA, (const char *)&packet, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  408. #endif
  409. }
  410. /**
  411. * @brief Send a fw_soaring_data message
  412. * @param chan MAVLink channel to send the message
  413. * @param struct The MAVLink struct to serialize
  414. */
  415. static inline void mavlink_msg_fw_soaring_data_send_struct(mavlink_channel_t chan, const mavlink_fw_soaring_data_t* fw_soaring_data)
  416. {
  417. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  418. mavlink_msg_fw_soaring_data_send(chan, fw_soaring_data->timestamp, fw_soaring_data->timestampModeChanged, fw_soaring_data->xW, fw_soaring_data->xR, fw_soaring_data->xLat, fw_soaring_data->xLon, fw_soaring_data->VarW, fw_soaring_data->VarR, fw_soaring_data->VarLat, fw_soaring_data->VarLon, fw_soaring_data->LoiterRadius, fw_soaring_data->LoiterDirection, fw_soaring_data->DistToSoarPoint, fw_soaring_data->vSinkExp, fw_soaring_data->z1_LocalUpdraftSpeed, fw_soaring_data->z2_DeltaRoll, fw_soaring_data->z1_exp, fw_soaring_data->z2_exp, fw_soaring_data->ThermalGSNorth, fw_soaring_data->ThermalGSEast, fw_soaring_data->TSE_dot, fw_soaring_data->DebugVar1, fw_soaring_data->DebugVar2, fw_soaring_data->ControlMode, fw_soaring_data->valid);
  419. #else
  420. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FW_SOARING_DATA, (const char *)fw_soaring_data, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  421. #endif
  422. }
  423. #if MAVLINK_MSG_ID_FW_SOARING_DATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  424. /*
  425. This varient of _send() can be used to save stack space by re-using
  426. memory from the receive buffer. The caller provides a
  427. mavlink_message_t which is the size of a full mavlink message. This
  428. is usually the receive buffer for the channel, and allows a reply to an
  429. incoming message with minimum stack space usage.
  430. */
  431. static inline void mavlink_msg_fw_soaring_data_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint64_t timestampModeChanged, float xW, float xR, float xLat, float xLon, float VarW, float VarR, float VarLat, float VarLon, float LoiterRadius, float LoiterDirection, float DistToSoarPoint, float vSinkExp, float z1_LocalUpdraftSpeed, float z2_DeltaRoll, float z1_exp, float z2_exp, float ThermalGSNorth, float ThermalGSEast, float TSE_dot, float DebugVar1, float DebugVar2, uint8_t ControlMode, uint8_t valid)
  432. {
  433. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  434. char *buf = (char *)msgbuf;
  435. _mav_put_uint64_t(buf, 0, timestamp);
  436. _mav_put_uint64_t(buf, 8, timestampModeChanged);
  437. _mav_put_float(buf, 16, xW);
  438. _mav_put_float(buf, 20, xR);
  439. _mav_put_float(buf, 24, xLat);
  440. _mav_put_float(buf, 28, xLon);
  441. _mav_put_float(buf, 32, VarW);
  442. _mav_put_float(buf, 36, VarR);
  443. _mav_put_float(buf, 40, VarLat);
  444. _mav_put_float(buf, 44, VarLon);
  445. _mav_put_float(buf, 48, LoiterRadius);
  446. _mav_put_float(buf, 52, LoiterDirection);
  447. _mav_put_float(buf, 56, DistToSoarPoint);
  448. _mav_put_float(buf, 60, vSinkExp);
  449. _mav_put_float(buf, 64, z1_LocalUpdraftSpeed);
  450. _mav_put_float(buf, 68, z2_DeltaRoll);
  451. _mav_put_float(buf, 72, z1_exp);
  452. _mav_put_float(buf, 76, z2_exp);
  453. _mav_put_float(buf, 80, ThermalGSNorth);
  454. _mav_put_float(buf, 84, ThermalGSEast);
  455. _mav_put_float(buf, 88, TSE_dot);
  456. _mav_put_float(buf, 92, DebugVar1);
  457. _mav_put_float(buf, 96, DebugVar2);
  458. _mav_put_uint8_t(buf, 100, ControlMode);
  459. _mav_put_uint8_t(buf, 101, valid);
  460. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FW_SOARING_DATA, buf, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  461. #else
  462. mavlink_fw_soaring_data_t *packet = (mavlink_fw_soaring_data_t *)msgbuf;
  463. packet->timestamp = timestamp;
  464. packet->timestampModeChanged = timestampModeChanged;
  465. packet->xW = xW;
  466. packet->xR = xR;
  467. packet->xLat = xLat;
  468. packet->xLon = xLon;
  469. packet->VarW = VarW;
  470. packet->VarR = VarR;
  471. packet->VarLat = VarLat;
  472. packet->VarLon = VarLon;
  473. packet->LoiterRadius = LoiterRadius;
  474. packet->LoiterDirection = LoiterDirection;
  475. packet->DistToSoarPoint = DistToSoarPoint;
  476. packet->vSinkExp = vSinkExp;
  477. packet->z1_LocalUpdraftSpeed = z1_LocalUpdraftSpeed;
  478. packet->z2_DeltaRoll = z2_DeltaRoll;
  479. packet->z1_exp = z1_exp;
  480. packet->z2_exp = z2_exp;
  481. packet->ThermalGSNorth = ThermalGSNorth;
  482. packet->ThermalGSEast = ThermalGSEast;
  483. packet->TSE_dot = TSE_dot;
  484. packet->DebugVar1 = DebugVar1;
  485. packet->DebugVar2 = DebugVar2;
  486. packet->ControlMode = ControlMode;
  487. packet->valid = valid;
  488. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FW_SOARING_DATA, (const char *)packet, MAVLINK_MSG_ID_FW_SOARING_DATA_MIN_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN, MAVLINK_MSG_ID_FW_SOARING_DATA_CRC);
  489. #endif
  490. }
  491. #endif
  492. #endif
  493. // MESSAGE FW_SOARING_DATA UNPACKING
  494. /**
  495. * @brief Get field timestamp from fw_soaring_data message
  496. *
  497. * @return [ms] Timestamp
  498. */
  499. static inline uint64_t mavlink_msg_fw_soaring_data_get_timestamp(const mavlink_message_t* msg)
  500. {
  501. return _MAV_RETURN_uint64_t(msg, 0);
  502. }
  503. /**
  504. * @brief Get field timestampModeChanged from fw_soaring_data message
  505. *
  506. * @return [ms] Timestamp since last mode change
  507. */
  508. static inline uint64_t mavlink_msg_fw_soaring_data_get_timestampModeChanged(const mavlink_message_t* msg)
  509. {
  510. return _MAV_RETURN_uint64_t(msg, 8);
  511. }
  512. /**
  513. * @brief Get field xW from fw_soaring_data message
  514. *
  515. * @return [m/s] Thermal core updraft strength
  516. */
  517. static inline float mavlink_msg_fw_soaring_data_get_xW(const mavlink_message_t* msg)
  518. {
  519. return _MAV_RETURN_float(msg, 16);
  520. }
  521. /**
  522. * @brief Get field xR from fw_soaring_data message
  523. *
  524. * @return [m] Thermal radius
  525. */
  526. static inline float mavlink_msg_fw_soaring_data_get_xR(const mavlink_message_t* msg)
  527. {
  528. return _MAV_RETURN_float(msg, 20);
  529. }
  530. /**
  531. * @brief Get field xLat from fw_soaring_data message
  532. *
  533. * @return [deg] Thermal center latitude
  534. */
  535. static inline float mavlink_msg_fw_soaring_data_get_xLat(const mavlink_message_t* msg)
  536. {
  537. return _MAV_RETURN_float(msg, 24);
  538. }
  539. /**
  540. * @brief Get field xLon from fw_soaring_data message
  541. *
  542. * @return [deg] Thermal center longitude
  543. */
  544. static inline float mavlink_msg_fw_soaring_data_get_xLon(const mavlink_message_t* msg)
  545. {
  546. return _MAV_RETURN_float(msg, 28);
  547. }
  548. /**
  549. * @brief Get field VarW from fw_soaring_data message
  550. *
  551. * @return Variance W
  552. */
  553. static inline float mavlink_msg_fw_soaring_data_get_VarW(const mavlink_message_t* msg)
  554. {
  555. return _MAV_RETURN_float(msg, 32);
  556. }
  557. /**
  558. * @brief Get field VarR from fw_soaring_data message
  559. *
  560. * @return Variance R
  561. */
  562. static inline float mavlink_msg_fw_soaring_data_get_VarR(const mavlink_message_t* msg)
  563. {
  564. return _MAV_RETURN_float(msg, 36);
  565. }
  566. /**
  567. * @brief Get field VarLat from fw_soaring_data message
  568. *
  569. * @return Variance Lat
  570. */
  571. static inline float mavlink_msg_fw_soaring_data_get_VarLat(const mavlink_message_t* msg)
  572. {
  573. return _MAV_RETURN_float(msg, 40);
  574. }
  575. /**
  576. * @brief Get field VarLon from fw_soaring_data message
  577. *
  578. * @return Variance Lon
  579. */
  580. static inline float mavlink_msg_fw_soaring_data_get_VarLon(const mavlink_message_t* msg)
  581. {
  582. return _MAV_RETURN_float(msg, 44);
  583. }
  584. /**
  585. * @brief Get field LoiterRadius from fw_soaring_data message
  586. *
  587. * @return [m] Suggested loiter radius
  588. */
  589. static inline float mavlink_msg_fw_soaring_data_get_LoiterRadius(const mavlink_message_t* msg)
  590. {
  591. return _MAV_RETURN_float(msg, 48);
  592. }
  593. /**
  594. * @brief Get field LoiterDirection from fw_soaring_data message
  595. *
  596. * @return Suggested loiter direction
  597. */
  598. static inline float mavlink_msg_fw_soaring_data_get_LoiterDirection(const mavlink_message_t* msg)
  599. {
  600. return _MAV_RETURN_float(msg, 52);
  601. }
  602. /**
  603. * @brief Get field DistToSoarPoint from fw_soaring_data message
  604. *
  605. * @return [m] Distance to soar point
  606. */
  607. static inline float mavlink_msg_fw_soaring_data_get_DistToSoarPoint(const mavlink_message_t* msg)
  608. {
  609. return _MAV_RETURN_float(msg, 56);
  610. }
  611. /**
  612. * @brief Get field vSinkExp from fw_soaring_data message
  613. *
  614. * @return [m/s] Expected sink rate at current airspeed, roll and throttle
  615. */
  616. static inline float mavlink_msg_fw_soaring_data_get_vSinkExp(const mavlink_message_t* msg)
  617. {
  618. return _MAV_RETURN_float(msg, 60);
  619. }
  620. /**
  621. * @brief Get field z1_LocalUpdraftSpeed from fw_soaring_data message
  622. *
  623. * @return [m/s] Measurement / updraft speed at current/local airplane position
  624. */
  625. static inline float mavlink_msg_fw_soaring_data_get_z1_LocalUpdraftSpeed(const mavlink_message_t* msg)
  626. {
  627. return _MAV_RETURN_float(msg, 64);
  628. }
  629. /**
  630. * @brief Get field z2_DeltaRoll from fw_soaring_data message
  631. *
  632. * @return [deg] Measurement / roll angle tracking error
  633. */
  634. static inline float mavlink_msg_fw_soaring_data_get_z2_DeltaRoll(const mavlink_message_t* msg)
  635. {
  636. return _MAV_RETURN_float(msg, 68);
  637. }
  638. /**
  639. * @brief Get field z1_exp from fw_soaring_data message
  640. *
  641. * @return Expected measurement 1
  642. */
  643. static inline float mavlink_msg_fw_soaring_data_get_z1_exp(const mavlink_message_t* msg)
  644. {
  645. return _MAV_RETURN_float(msg, 72);
  646. }
  647. /**
  648. * @brief Get field z2_exp from fw_soaring_data message
  649. *
  650. * @return Expected measurement 2
  651. */
  652. static inline float mavlink_msg_fw_soaring_data_get_z2_exp(const mavlink_message_t* msg)
  653. {
  654. return _MAV_RETURN_float(msg, 76);
  655. }
  656. /**
  657. * @brief Get field ThermalGSNorth from fw_soaring_data message
  658. *
  659. * @return [m/s] Thermal drift (from estimator prediction step only)
  660. */
  661. static inline float mavlink_msg_fw_soaring_data_get_ThermalGSNorth(const mavlink_message_t* msg)
  662. {
  663. return _MAV_RETURN_float(msg, 80);
  664. }
  665. /**
  666. * @brief Get field ThermalGSEast from fw_soaring_data message
  667. *
  668. * @return [m/s] Thermal drift (from estimator prediction step only)
  669. */
  670. static inline float mavlink_msg_fw_soaring_data_get_ThermalGSEast(const mavlink_message_t* msg)
  671. {
  672. return _MAV_RETURN_float(msg, 84);
  673. }
  674. /**
  675. * @brief Get field TSE_dot from fw_soaring_data message
  676. *
  677. * @return [m/s] Total specific energy change (filtered)
  678. */
  679. static inline float mavlink_msg_fw_soaring_data_get_TSE_dot(const mavlink_message_t* msg)
  680. {
  681. return _MAV_RETURN_float(msg, 88);
  682. }
  683. /**
  684. * @brief Get field DebugVar1 from fw_soaring_data message
  685. *
  686. * @return Debug variable 1
  687. */
  688. static inline float mavlink_msg_fw_soaring_data_get_DebugVar1(const mavlink_message_t* msg)
  689. {
  690. return _MAV_RETURN_float(msg, 92);
  691. }
  692. /**
  693. * @brief Get field DebugVar2 from fw_soaring_data message
  694. *
  695. * @return Debug variable 2
  696. */
  697. static inline float mavlink_msg_fw_soaring_data_get_DebugVar2(const mavlink_message_t* msg)
  698. {
  699. return _MAV_RETURN_float(msg, 96);
  700. }
  701. /**
  702. * @brief Get field ControlMode from fw_soaring_data message
  703. *
  704. * @return Control Mode [-]
  705. */
  706. static inline uint8_t mavlink_msg_fw_soaring_data_get_ControlMode(const mavlink_message_t* msg)
  707. {
  708. return _MAV_RETURN_uint8_t(msg, 100);
  709. }
  710. /**
  711. * @brief Get field valid from fw_soaring_data message
  712. *
  713. * @return Data valid [-]
  714. */
  715. static inline uint8_t mavlink_msg_fw_soaring_data_get_valid(const mavlink_message_t* msg)
  716. {
  717. return _MAV_RETURN_uint8_t(msg, 101);
  718. }
  719. /**
  720. * @brief Decode a fw_soaring_data message into a struct
  721. *
  722. * @param msg The message to decode
  723. * @param fw_soaring_data C-struct to decode the message contents into
  724. */
  725. static inline void mavlink_msg_fw_soaring_data_decode(const mavlink_message_t* msg, mavlink_fw_soaring_data_t* fw_soaring_data)
  726. {
  727. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  728. fw_soaring_data->timestamp = mavlink_msg_fw_soaring_data_get_timestamp(msg);
  729. fw_soaring_data->timestampModeChanged = mavlink_msg_fw_soaring_data_get_timestampModeChanged(msg);
  730. fw_soaring_data->xW = mavlink_msg_fw_soaring_data_get_xW(msg);
  731. fw_soaring_data->xR = mavlink_msg_fw_soaring_data_get_xR(msg);
  732. fw_soaring_data->xLat = mavlink_msg_fw_soaring_data_get_xLat(msg);
  733. fw_soaring_data->xLon = mavlink_msg_fw_soaring_data_get_xLon(msg);
  734. fw_soaring_data->VarW = mavlink_msg_fw_soaring_data_get_VarW(msg);
  735. fw_soaring_data->VarR = mavlink_msg_fw_soaring_data_get_VarR(msg);
  736. fw_soaring_data->VarLat = mavlink_msg_fw_soaring_data_get_VarLat(msg);
  737. fw_soaring_data->VarLon = mavlink_msg_fw_soaring_data_get_VarLon(msg);
  738. fw_soaring_data->LoiterRadius = mavlink_msg_fw_soaring_data_get_LoiterRadius(msg);
  739. fw_soaring_data->LoiterDirection = mavlink_msg_fw_soaring_data_get_LoiterDirection(msg);
  740. fw_soaring_data->DistToSoarPoint = mavlink_msg_fw_soaring_data_get_DistToSoarPoint(msg);
  741. fw_soaring_data->vSinkExp = mavlink_msg_fw_soaring_data_get_vSinkExp(msg);
  742. fw_soaring_data->z1_LocalUpdraftSpeed = mavlink_msg_fw_soaring_data_get_z1_LocalUpdraftSpeed(msg);
  743. fw_soaring_data->z2_DeltaRoll = mavlink_msg_fw_soaring_data_get_z2_DeltaRoll(msg);
  744. fw_soaring_data->z1_exp = mavlink_msg_fw_soaring_data_get_z1_exp(msg);
  745. fw_soaring_data->z2_exp = mavlink_msg_fw_soaring_data_get_z2_exp(msg);
  746. fw_soaring_data->ThermalGSNorth = mavlink_msg_fw_soaring_data_get_ThermalGSNorth(msg);
  747. fw_soaring_data->ThermalGSEast = mavlink_msg_fw_soaring_data_get_ThermalGSEast(msg);
  748. fw_soaring_data->TSE_dot = mavlink_msg_fw_soaring_data_get_TSE_dot(msg);
  749. fw_soaring_data->DebugVar1 = mavlink_msg_fw_soaring_data_get_DebugVar1(msg);
  750. fw_soaring_data->DebugVar2 = mavlink_msg_fw_soaring_data_get_DebugVar2(msg);
  751. fw_soaring_data->ControlMode = mavlink_msg_fw_soaring_data_get_ControlMode(msg);
  752. fw_soaring_data->valid = mavlink_msg_fw_soaring_data_get_valid(msg);
  753. #else
  754. uint8_t len = msg->len < MAVLINK_MSG_ID_FW_SOARING_DATA_LEN? msg->len : MAVLINK_MSG_ID_FW_SOARING_DATA_LEN;
  755. memset(fw_soaring_data, 0, MAVLINK_MSG_ID_FW_SOARING_DATA_LEN);
  756. memcpy(fw_soaring_data, _MAV_PAYLOAD(msg), len);
  757. #endif
  758. }