You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

513 lines
20 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE ADAP_TUNING PACKING
  3. #define MAVLINK_MSG_ID_ADAP_TUNING 11010
  4. MAVPACKED(
  5. typedef struct __mavlink_adap_tuning_t {
  6. float desired; /*< [deg/s] Desired rate.*/
  7. float achieved; /*< [deg/s] Achieved rate.*/
  8. float error; /*< Error between model and vehicle.*/
  9. float theta; /*< Theta estimated state predictor.*/
  10. float omega; /*< Omega estimated state predictor.*/
  11. float sigma; /*< Sigma estimated state predictor.*/
  12. float theta_dot; /*< Theta derivative.*/
  13. float omega_dot; /*< Omega derivative.*/
  14. float sigma_dot; /*< Sigma derivative.*/
  15. float f; /*< Projection operator value.*/
  16. float f_dot; /*< Projection operator derivative.*/
  17. float u; /*< u adaptive controlled output command.*/
  18. uint8_t axis; /*< Axis.*/
  19. }) mavlink_adap_tuning_t;
  20. #define MAVLINK_MSG_ID_ADAP_TUNING_LEN 49
  21. #define MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN 49
  22. #define MAVLINK_MSG_ID_11010_LEN 49
  23. #define MAVLINK_MSG_ID_11010_MIN_LEN 49
  24. #define MAVLINK_MSG_ID_ADAP_TUNING_CRC 46
  25. #define MAVLINK_MSG_ID_11010_CRC 46
  26. #if MAVLINK_COMMAND_24BIT
  27. #define MAVLINK_MESSAGE_INFO_ADAP_TUNING { \
  28. 11010, \
  29. "ADAP_TUNING", \
  30. 13, \
  31. { { "axis", NULL, MAVLINK_TYPE_UINT8_T, 0, 48, offsetof(mavlink_adap_tuning_t, axis) }, \
  32. { "desired", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_adap_tuning_t, desired) }, \
  33. { "achieved", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_adap_tuning_t, achieved) }, \
  34. { "error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_adap_tuning_t, error) }, \
  35. { "theta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_adap_tuning_t, theta) }, \
  36. { "omega", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_adap_tuning_t, omega) }, \
  37. { "sigma", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_adap_tuning_t, sigma) }, \
  38. { "theta_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_adap_tuning_t, theta_dot) }, \
  39. { "omega_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_adap_tuning_t, omega_dot) }, \
  40. { "sigma_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_adap_tuning_t, sigma_dot) }, \
  41. { "f", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_adap_tuning_t, f) }, \
  42. { "f_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_adap_tuning_t, f_dot) }, \
  43. { "u", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_adap_tuning_t, u) }, \
  44. } \
  45. }
  46. #else
  47. #define MAVLINK_MESSAGE_INFO_ADAP_TUNING { \
  48. "ADAP_TUNING", \
  49. 13, \
  50. { { "axis", NULL, MAVLINK_TYPE_UINT8_T, 0, 48, offsetof(mavlink_adap_tuning_t, axis) }, \
  51. { "desired", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_adap_tuning_t, desired) }, \
  52. { "achieved", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_adap_tuning_t, achieved) }, \
  53. { "error", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_adap_tuning_t, error) }, \
  54. { "theta", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_adap_tuning_t, theta) }, \
  55. { "omega", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_adap_tuning_t, omega) }, \
  56. { "sigma", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_adap_tuning_t, sigma) }, \
  57. { "theta_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_adap_tuning_t, theta_dot) }, \
  58. { "omega_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_adap_tuning_t, omega_dot) }, \
  59. { "sigma_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_adap_tuning_t, sigma_dot) }, \
  60. { "f", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_adap_tuning_t, f) }, \
  61. { "f_dot", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_adap_tuning_t, f_dot) }, \
  62. { "u", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_adap_tuning_t, u) }, \
  63. } \
  64. }
  65. #endif
  66. /**
  67. * @brief Pack a adap_tuning message
  68. * @param system_id ID of this system
  69. * @param component_id ID of this component (e.g. 200 for IMU)
  70. * @param msg The MAVLink message to compress the data into
  71. *
  72. * @param axis Axis.
  73. * @param desired [deg/s] Desired rate.
  74. * @param achieved [deg/s] Achieved rate.
  75. * @param error Error between model and vehicle.
  76. * @param theta Theta estimated state predictor.
  77. * @param omega Omega estimated state predictor.
  78. * @param sigma Sigma estimated state predictor.
  79. * @param theta_dot Theta derivative.
  80. * @param omega_dot Omega derivative.
  81. * @param sigma_dot Sigma derivative.
  82. * @param f Projection operator value.
  83. * @param f_dot Projection operator derivative.
  84. * @param u u adaptive controlled output command.
  85. * @return length of the message in bytes (excluding serial stream start sign)
  86. */
  87. static inline uint16_t mavlink_msg_adap_tuning_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  88. uint8_t axis, float desired, float achieved, float error, float theta, float omega, float sigma, float theta_dot, float omega_dot, float sigma_dot, float f, float f_dot, float u)
  89. {
  90. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  91. char buf[MAVLINK_MSG_ID_ADAP_TUNING_LEN];
  92. _mav_put_float(buf, 0, desired);
  93. _mav_put_float(buf, 4, achieved);
  94. _mav_put_float(buf, 8, error);
  95. _mav_put_float(buf, 12, theta);
  96. _mav_put_float(buf, 16, omega);
  97. _mav_put_float(buf, 20, sigma);
  98. _mav_put_float(buf, 24, theta_dot);
  99. _mav_put_float(buf, 28, omega_dot);
  100. _mav_put_float(buf, 32, sigma_dot);
  101. _mav_put_float(buf, 36, f);
  102. _mav_put_float(buf, 40, f_dot);
  103. _mav_put_float(buf, 44, u);
  104. _mav_put_uint8_t(buf, 48, axis);
  105. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADAP_TUNING_LEN);
  106. #else
  107. mavlink_adap_tuning_t packet;
  108. packet.desired = desired;
  109. packet.achieved = achieved;
  110. packet.error = error;
  111. packet.theta = theta;
  112. packet.omega = omega;
  113. packet.sigma = sigma;
  114. packet.theta_dot = theta_dot;
  115. packet.omega_dot = omega_dot;
  116. packet.sigma_dot = sigma_dot;
  117. packet.f = f;
  118. packet.f_dot = f_dot;
  119. packet.u = u;
  120. packet.axis = axis;
  121. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADAP_TUNING_LEN);
  122. #endif
  123. msg->msgid = MAVLINK_MSG_ID_ADAP_TUNING;
  124. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  125. }
  126. /**
  127. * @brief Pack a adap_tuning message on a channel
  128. * @param system_id ID of this system
  129. * @param component_id ID of this component (e.g. 200 for IMU)
  130. * @param chan The MAVLink channel this message will be sent over
  131. * @param msg The MAVLink message to compress the data into
  132. * @param axis Axis.
  133. * @param desired [deg/s] Desired rate.
  134. * @param achieved [deg/s] Achieved rate.
  135. * @param error Error between model and vehicle.
  136. * @param theta Theta estimated state predictor.
  137. * @param omega Omega estimated state predictor.
  138. * @param sigma Sigma estimated state predictor.
  139. * @param theta_dot Theta derivative.
  140. * @param omega_dot Omega derivative.
  141. * @param sigma_dot Sigma derivative.
  142. * @param f Projection operator value.
  143. * @param f_dot Projection operator derivative.
  144. * @param u u adaptive controlled output command.
  145. * @return length of the message in bytes (excluding serial stream start sign)
  146. */
  147. static inline uint16_t mavlink_msg_adap_tuning_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  148. mavlink_message_t* msg,
  149. uint8_t axis,float desired,float achieved,float error,float theta,float omega,float sigma,float theta_dot,float omega_dot,float sigma_dot,float f,float f_dot,float u)
  150. {
  151. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  152. char buf[MAVLINK_MSG_ID_ADAP_TUNING_LEN];
  153. _mav_put_float(buf, 0, desired);
  154. _mav_put_float(buf, 4, achieved);
  155. _mav_put_float(buf, 8, error);
  156. _mav_put_float(buf, 12, theta);
  157. _mav_put_float(buf, 16, omega);
  158. _mav_put_float(buf, 20, sigma);
  159. _mav_put_float(buf, 24, theta_dot);
  160. _mav_put_float(buf, 28, omega_dot);
  161. _mav_put_float(buf, 32, sigma_dot);
  162. _mav_put_float(buf, 36, f);
  163. _mav_put_float(buf, 40, f_dot);
  164. _mav_put_float(buf, 44, u);
  165. _mav_put_uint8_t(buf, 48, axis);
  166. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ADAP_TUNING_LEN);
  167. #else
  168. mavlink_adap_tuning_t packet;
  169. packet.desired = desired;
  170. packet.achieved = achieved;
  171. packet.error = error;
  172. packet.theta = theta;
  173. packet.omega = omega;
  174. packet.sigma = sigma;
  175. packet.theta_dot = theta_dot;
  176. packet.omega_dot = omega_dot;
  177. packet.sigma_dot = sigma_dot;
  178. packet.f = f;
  179. packet.f_dot = f_dot;
  180. packet.u = u;
  181. packet.axis = axis;
  182. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ADAP_TUNING_LEN);
  183. #endif
  184. msg->msgid = MAVLINK_MSG_ID_ADAP_TUNING;
  185. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  186. }
  187. /**
  188. * @brief Encode a adap_tuning struct
  189. *
  190. * @param system_id ID of this system
  191. * @param component_id ID of this component (e.g. 200 for IMU)
  192. * @param msg The MAVLink message to compress the data into
  193. * @param adap_tuning C-struct to read the message contents from
  194. */
  195. static inline uint16_t mavlink_msg_adap_tuning_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_adap_tuning_t* adap_tuning)
  196. {
  197. return mavlink_msg_adap_tuning_pack(system_id, component_id, msg, adap_tuning->axis, adap_tuning->desired, adap_tuning->achieved, adap_tuning->error, adap_tuning->theta, adap_tuning->omega, adap_tuning->sigma, adap_tuning->theta_dot, adap_tuning->omega_dot, adap_tuning->sigma_dot, adap_tuning->f, adap_tuning->f_dot, adap_tuning->u);
  198. }
  199. /**
  200. * @brief Encode a adap_tuning struct on a channel
  201. *
  202. * @param system_id ID of this system
  203. * @param component_id ID of this component (e.g. 200 for IMU)
  204. * @param chan The MAVLink channel this message will be sent over
  205. * @param msg The MAVLink message to compress the data into
  206. * @param adap_tuning C-struct to read the message contents from
  207. */
  208. static inline uint16_t mavlink_msg_adap_tuning_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_adap_tuning_t* adap_tuning)
  209. {
  210. return mavlink_msg_adap_tuning_pack_chan(system_id, component_id, chan, msg, adap_tuning->axis, adap_tuning->desired, adap_tuning->achieved, adap_tuning->error, adap_tuning->theta, adap_tuning->omega, adap_tuning->sigma, adap_tuning->theta_dot, adap_tuning->omega_dot, adap_tuning->sigma_dot, adap_tuning->f, adap_tuning->f_dot, adap_tuning->u);
  211. }
  212. /**
  213. * @brief Send a adap_tuning message
  214. * @param chan MAVLink channel to send the message
  215. *
  216. * @param axis Axis.
  217. * @param desired [deg/s] Desired rate.
  218. * @param achieved [deg/s] Achieved rate.
  219. * @param error Error between model and vehicle.
  220. * @param theta Theta estimated state predictor.
  221. * @param omega Omega estimated state predictor.
  222. * @param sigma Sigma estimated state predictor.
  223. * @param theta_dot Theta derivative.
  224. * @param omega_dot Omega derivative.
  225. * @param sigma_dot Sigma derivative.
  226. * @param f Projection operator value.
  227. * @param f_dot Projection operator derivative.
  228. * @param u u adaptive controlled output command.
  229. */
  230. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  231. static inline void mavlink_msg_adap_tuning_send(mavlink_channel_t chan, uint8_t axis, float desired, float achieved, float error, float theta, float omega, float sigma, float theta_dot, float omega_dot, float sigma_dot, float f, float f_dot, float u)
  232. {
  233. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  234. char buf[MAVLINK_MSG_ID_ADAP_TUNING_LEN];
  235. _mav_put_float(buf, 0, desired);
  236. _mav_put_float(buf, 4, achieved);
  237. _mav_put_float(buf, 8, error);
  238. _mav_put_float(buf, 12, theta);
  239. _mav_put_float(buf, 16, omega);
  240. _mav_put_float(buf, 20, sigma);
  241. _mav_put_float(buf, 24, theta_dot);
  242. _mav_put_float(buf, 28, omega_dot);
  243. _mav_put_float(buf, 32, sigma_dot);
  244. _mav_put_float(buf, 36, f);
  245. _mav_put_float(buf, 40, f_dot);
  246. _mav_put_float(buf, 44, u);
  247. _mav_put_uint8_t(buf, 48, axis);
  248. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADAP_TUNING, buf, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  249. #else
  250. mavlink_adap_tuning_t packet;
  251. packet.desired = desired;
  252. packet.achieved = achieved;
  253. packet.error = error;
  254. packet.theta = theta;
  255. packet.omega = omega;
  256. packet.sigma = sigma;
  257. packet.theta_dot = theta_dot;
  258. packet.omega_dot = omega_dot;
  259. packet.sigma_dot = sigma_dot;
  260. packet.f = f;
  261. packet.f_dot = f_dot;
  262. packet.u = u;
  263. packet.axis = axis;
  264. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADAP_TUNING, (const char *)&packet, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  265. #endif
  266. }
  267. /**
  268. * @brief Send a adap_tuning message
  269. * @param chan MAVLink channel to send the message
  270. * @param struct The MAVLink struct to serialize
  271. */
  272. static inline void mavlink_msg_adap_tuning_send_struct(mavlink_channel_t chan, const mavlink_adap_tuning_t* adap_tuning)
  273. {
  274. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  275. mavlink_msg_adap_tuning_send(chan, adap_tuning->axis, adap_tuning->desired, adap_tuning->achieved, adap_tuning->error, adap_tuning->theta, adap_tuning->omega, adap_tuning->sigma, adap_tuning->theta_dot, adap_tuning->omega_dot, adap_tuning->sigma_dot, adap_tuning->f, adap_tuning->f_dot, adap_tuning->u);
  276. #else
  277. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADAP_TUNING, (const char *)adap_tuning, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  278. #endif
  279. }
  280. #if MAVLINK_MSG_ID_ADAP_TUNING_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  281. /*
  282. This varient of _send() can be used to save stack space by re-using
  283. memory from the receive buffer. The caller provides a
  284. mavlink_message_t which is the size of a full mavlink message. This
  285. is usually the receive buffer for the channel, and allows a reply to an
  286. incoming message with minimum stack space usage.
  287. */
  288. static inline void mavlink_msg_adap_tuning_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t axis, float desired, float achieved, float error, float theta, float omega, float sigma, float theta_dot, float omega_dot, float sigma_dot, float f, float f_dot, float u)
  289. {
  290. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  291. char *buf = (char *)msgbuf;
  292. _mav_put_float(buf, 0, desired);
  293. _mav_put_float(buf, 4, achieved);
  294. _mav_put_float(buf, 8, error);
  295. _mav_put_float(buf, 12, theta);
  296. _mav_put_float(buf, 16, omega);
  297. _mav_put_float(buf, 20, sigma);
  298. _mav_put_float(buf, 24, theta_dot);
  299. _mav_put_float(buf, 28, omega_dot);
  300. _mav_put_float(buf, 32, sigma_dot);
  301. _mav_put_float(buf, 36, f);
  302. _mav_put_float(buf, 40, f_dot);
  303. _mav_put_float(buf, 44, u);
  304. _mav_put_uint8_t(buf, 48, axis);
  305. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADAP_TUNING, buf, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  306. #else
  307. mavlink_adap_tuning_t *packet = (mavlink_adap_tuning_t *)msgbuf;
  308. packet->desired = desired;
  309. packet->achieved = achieved;
  310. packet->error = error;
  311. packet->theta = theta;
  312. packet->omega = omega;
  313. packet->sigma = sigma;
  314. packet->theta_dot = theta_dot;
  315. packet->omega_dot = omega_dot;
  316. packet->sigma_dot = sigma_dot;
  317. packet->f = f;
  318. packet->f_dot = f_dot;
  319. packet->u = u;
  320. packet->axis = axis;
  321. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADAP_TUNING, (const char *)packet, MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN, MAVLINK_MSG_ID_ADAP_TUNING_LEN, MAVLINK_MSG_ID_ADAP_TUNING_CRC);
  322. #endif
  323. }
  324. #endif
  325. #endif
  326. // MESSAGE ADAP_TUNING UNPACKING
  327. /**
  328. * @brief Get field axis from adap_tuning message
  329. *
  330. * @return Axis.
  331. */
  332. static inline uint8_t mavlink_msg_adap_tuning_get_axis(const mavlink_message_t* msg)
  333. {
  334. return _MAV_RETURN_uint8_t(msg, 48);
  335. }
  336. /**
  337. * @brief Get field desired from adap_tuning message
  338. *
  339. * @return [deg/s] Desired rate.
  340. */
  341. static inline float mavlink_msg_adap_tuning_get_desired(const mavlink_message_t* msg)
  342. {
  343. return _MAV_RETURN_float(msg, 0);
  344. }
  345. /**
  346. * @brief Get field achieved from adap_tuning message
  347. *
  348. * @return [deg/s] Achieved rate.
  349. */
  350. static inline float mavlink_msg_adap_tuning_get_achieved(const mavlink_message_t* msg)
  351. {
  352. return _MAV_RETURN_float(msg, 4);
  353. }
  354. /**
  355. * @brief Get field error from adap_tuning message
  356. *
  357. * @return Error between model and vehicle.
  358. */
  359. static inline float mavlink_msg_adap_tuning_get_error(const mavlink_message_t* msg)
  360. {
  361. return _MAV_RETURN_float(msg, 8);
  362. }
  363. /**
  364. * @brief Get field theta from adap_tuning message
  365. *
  366. * @return Theta estimated state predictor.
  367. */
  368. static inline float mavlink_msg_adap_tuning_get_theta(const mavlink_message_t* msg)
  369. {
  370. return _MAV_RETURN_float(msg, 12);
  371. }
  372. /**
  373. * @brief Get field omega from adap_tuning message
  374. *
  375. * @return Omega estimated state predictor.
  376. */
  377. static inline float mavlink_msg_adap_tuning_get_omega(const mavlink_message_t* msg)
  378. {
  379. return _MAV_RETURN_float(msg, 16);
  380. }
  381. /**
  382. * @brief Get field sigma from adap_tuning message
  383. *
  384. * @return Sigma estimated state predictor.
  385. */
  386. static inline float mavlink_msg_adap_tuning_get_sigma(const mavlink_message_t* msg)
  387. {
  388. return _MAV_RETURN_float(msg, 20);
  389. }
  390. /**
  391. * @brief Get field theta_dot from adap_tuning message
  392. *
  393. * @return Theta derivative.
  394. */
  395. static inline float mavlink_msg_adap_tuning_get_theta_dot(const mavlink_message_t* msg)
  396. {
  397. return _MAV_RETURN_float(msg, 24);
  398. }
  399. /**
  400. * @brief Get field omega_dot from adap_tuning message
  401. *
  402. * @return Omega derivative.
  403. */
  404. static inline float mavlink_msg_adap_tuning_get_omega_dot(const mavlink_message_t* msg)
  405. {
  406. return _MAV_RETURN_float(msg, 28);
  407. }
  408. /**
  409. * @brief Get field sigma_dot from adap_tuning message
  410. *
  411. * @return Sigma derivative.
  412. */
  413. static inline float mavlink_msg_adap_tuning_get_sigma_dot(const mavlink_message_t* msg)
  414. {
  415. return _MAV_RETURN_float(msg, 32);
  416. }
  417. /**
  418. * @brief Get field f from adap_tuning message
  419. *
  420. * @return Projection operator value.
  421. */
  422. static inline float mavlink_msg_adap_tuning_get_f(const mavlink_message_t* msg)
  423. {
  424. return _MAV_RETURN_float(msg, 36);
  425. }
  426. /**
  427. * @brief Get field f_dot from adap_tuning message
  428. *
  429. * @return Projection operator derivative.
  430. */
  431. static inline float mavlink_msg_adap_tuning_get_f_dot(const mavlink_message_t* msg)
  432. {
  433. return _MAV_RETURN_float(msg, 40);
  434. }
  435. /**
  436. * @brief Get field u from adap_tuning message
  437. *
  438. * @return u adaptive controlled output command.
  439. */
  440. static inline float mavlink_msg_adap_tuning_get_u(const mavlink_message_t* msg)
  441. {
  442. return _MAV_RETURN_float(msg, 44);
  443. }
  444. /**
  445. * @brief Decode a adap_tuning message into a struct
  446. *
  447. * @param msg The message to decode
  448. * @param adap_tuning C-struct to decode the message contents into
  449. */
  450. static inline void mavlink_msg_adap_tuning_decode(const mavlink_message_t* msg, mavlink_adap_tuning_t* adap_tuning)
  451. {
  452. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  453. adap_tuning->desired = mavlink_msg_adap_tuning_get_desired(msg);
  454. adap_tuning->achieved = mavlink_msg_adap_tuning_get_achieved(msg);
  455. adap_tuning->error = mavlink_msg_adap_tuning_get_error(msg);
  456. adap_tuning->theta = mavlink_msg_adap_tuning_get_theta(msg);
  457. adap_tuning->omega = mavlink_msg_adap_tuning_get_omega(msg);
  458. adap_tuning->sigma = mavlink_msg_adap_tuning_get_sigma(msg);
  459. adap_tuning->theta_dot = mavlink_msg_adap_tuning_get_theta_dot(msg);
  460. adap_tuning->omega_dot = mavlink_msg_adap_tuning_get_omega_dot(msg);
  461. adap_tuning->sigma_dot = mavlink_msg_adap_tuning_get_sigma_dot(msg);
  462. adap_tuning->f = mavlink_msg_adap_tuning_get_f(msg);
  463. adap_tuning->f_dot = mavlink_msg_adap_tuning_get_f_dot(msg);
  464. adap_tuning->u = mavlink_msg_adap_tuning_get_u(msg);
  465. adap_tuning->axis = mavlink_msg_adap_tuning_get_axis(msg);
  466. #else
  467. uint8_t len = msg->len < MAVLINK_MSG_ID_ADAP_TUNING_LEN? msg->len : MAVLINK_MSG_ID_ADAP_TUNING_LEN;
  468. memset(adap_tuning, 0, MAVLINK_MSG_ID_ADAP_TUNING_LEN);
  469. memcpy(adap_tuning, _MAV_PAYLOAD(msg), len);
  470. #endif
  471. }