mavlink_msg_trajectory_representation_bezier.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. #pragma once
  2. // MESSAGE TRAJECTORY_REPRESENTATION_BEZIER PACKING
  3. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER 333
  4. typedef struct __mavlink_trajectory_representation_bezier_t {
  5. uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
  6. float pos_x[5]; /*< [m] X-coordinate of bezier control points. Set to NaN if not being used*/
  7. float pos_y[5]; /*< [m] Y-coordinate of bezier control points. Set to NaN if not being used*/
  8. float pos_z[5]; /*< [m] Z-coordinate of bezier control points. Set to NaN if not being used*/
  9. float delta[5]; /*< [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated*/
  10. float pos_yaw[5]; /*< [rad] Yaw. Set to NaN for unchanged*/
  11. uint8_t valid_points; /*< Number of valid control points (up-to 5 points are possible)*/
  12. } mavlink_trajectory_representation_bezier_t;
  13. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN 109
  14. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN 109
  15. #define MAVLINK_MSG_ID_333_LEN 109
  16. #define MAVLINK_MSG_ID_333_MIN_LEN 109
  17. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC 231
  18. #define MAVLINK_MSG_ID_333_CRC 231
  19. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_X_LEN 5
  20. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_Y_LEN 5
  21. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_Z_LEN 5
  22. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_DELTA_LEN 5
  23. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_YAW_LEN 5
  24. #if MAVLINK_COMMAND_24BIT
  25. #define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_BEZIER { \
  26. 333, \
  27. "TRAJECTORY_REPRESENTATION_BEZIER", \
  28. 7, \
  29. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_bezier_t, time_usec) }, \
  30. { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 108, offsetof(mavlink_trajectory_representation_bezier_t, valid_points) }, \
  31. { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_bezier_t, pos_x) }, \
  32. { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_bezier_t, pos_y) }, \
  33. { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_bezier_t, pos_z) }, \
  34. { "delta", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_bezier_t, delta) }, \
  35. { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_bezier_t, pos_yaw) }, \
  36. } \
  37. }
  38. #else
  39. #define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_BEZIER { \
  40. "TRAJECTORY_REPRESENTATION_BEZIER", \
  41. 7, \
  42. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_bezier_t, time_usec) }, \
  43. { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 108, offsetof(mavlink_trajectory_representation_bezier_t, valid_points) }, \
  44. { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_bezier_t, pos_x) }, \
  45. { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_bezier_t, pos_y) }, \
  46. { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_bezier_t, pos_z) }, \
  47. { "delta", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_bezier_t, delta) }, \
  48. { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_bezier_t, pos_yaw) }, \
  49. } \
  50. }
  51. #endif
  52. /**
  53. * @brief Pack a trajectory_representation_bezier message
  54. * @param system_id ID of this system
  55. * @param component_id ID of this component (e.g. 200 for IMU)
  56. * @param msg The MAVLink message to compress the data into
  57. *
  58. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  59. * @param valid_points Number of valid control points (up-to 5 points are possible)
  60. * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
  61. * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
  62. * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
  63. * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
  64. * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
  65. * @return length of the message in bytes (excluding serial stream start sign)
  66. */
  67. static inline uint16_t mavlink_msg_trajectory_representation_bezier_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  68. uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
  69. {
  70. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  71. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN];
  72. _mav_put_uint64_t(buf, 0, time_usec);
  73. _mav_put_uint8_t(buf, 108, valid_points);
  74. _mav_put_float_array(buf, 8, pos_x, 5);
  75. _mav_put_float_array(buf, 28, pos_y, 5);
  76. _mav_put_float_array(buf, 48, pos_z, 5);
  77. _mav_put_float_array(buf, 68, delta, 5);
  78. _mav_put_float_array(buf, 88, pos_yaw, 5);
  79. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
  80. #else
  81. mavlink_trajectory_representation_bezier_t packet;
  82. packet.time_usec = time_usec;
  83. packet.valid_points = valid_points;
  84. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  85. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  86. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  87. mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
  88. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  89. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
  90. #endif
  91. msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER;
  92. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  93. }
  94. /**
  95. * @brief Pack a trajectory_representation_bezier message on a channel
  96. * @param system_id ID of this system
  97. * @param component_id ID of this component (e.g. 200 for IMU)
  98. * @param chan The MAVLink channel this message will be sent over
  99. * @param msg The MAVLink message to compress the data into
  100. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  101. * @param valid_points Number of valid control points (up-to 5 points are possible)
  102. * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
  103. * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
  104. * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
  105. * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
  106. * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
  107. * @return length of the message in bytes (excluding serial stream start sign)
  108. */
  109. static inline uint16_t mavlink_msg_trajectory_representation_bezier_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  110. mavlink_message_t* msg,
  111. uint64_t time_usec,uint8_t valid_points,const float *pos_x,const float *pos_y,const float *pos_z,const float *delta,const float *pos_yaw)
  112. {
  113. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  114. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN];
  115. _mav_put_uint64_t(buf, 0, time_usec);
  116. _mav_put_uint8_t(buf, 108, valid_points);
  117. _mav_put_float_array(buf, 8, pos_x, 5);
  118. _mav_put_float_array(buf, 28, pos_y, 5);
  119. _mav_put_float_array(buf, 48, pos_z, 5);
  120. _mav_put_float_array(buf, 68, delta, 5);
  121. _mav_put_float_array(buf, 88, pos_yaw, 5);
  122. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
  123. #else
  124. mavlink_trajectory_representation_bezier_t packet;
  125. packet.time_usec = time_usec;
  126. packet.valid_points = valid_points;
  127. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  128. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  129. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  130. mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
  131. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  132. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
  133. #endif
  134. msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER;
  135. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  136. }
  137. /**
  138. * @brief Encode a trajectory_representation_bezier struct
  139. *
  140. * @param system_id ID of this system
  141. * @param component_id ID of this component (e.g. 200 for IMU)
  142. * @param msg The MAVLink message to compress the data into
  143. * @param trajectory_representation_bezier C-struct to read the message contents from
  144. */
  145. static inline uint16_t mavlink_msg_trajectory_representation_bezier_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
  146. {
  147. return mavlink_msg_trajectory_representation_bezier_pack(system_id, component_id, msg, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
  148. }
  149. /**
  150. * @brief Encode a trajectory_representation_bezier struct on a channel
  151. *
  152. * @param system_id ID of this system
  153. * @param component_id ID of this component (e.g. 200 for IMU)
  154. * @param chan The MAVLink channel this message will be sent over
  155. * @param msg The MAVLink message to compress the data into
  156. * @param trajectory_representation_bezier C-struct to read the message contents from
  157. */
  158. static inline uint16_t mavlink_msg_trajectory_representation_bezier_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
  159. {
  160. return mavlink_msg_trajectory_representation_bezier_pack_chan(system_id, component_id, chan, msg, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
  161. }
  162. /**
  163. * @brief Send a trajectory_representation_bezier message
  164. * @param chan MAVLink channel to send the message
  165. *
  166. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  167. * @param valid_points Number of valid control points (up-to 5 points are possible)
  168. * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
  169. * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
  170. * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
  171. * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
  172. * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
  173. */
  174. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  175. static inline void mavlink_msg_trajectory_representation_bezier_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
  176. {
  177. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  178. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN];
  179. _mav_put_uint64_t(buf, 0, time_usec);
  180. _mav_put_uint8_t(buf, 108, valid_points);
  181. _mav_put_float_array(buf, 8, pos_x, 5);
  182. _mav_put_float_array(buf, 28, pos_y, 5);
  183. _mav_put_float_array(buf, 48, pos_z, 5);
  184. _mav_put_float_array(buf, 68, delta, 5);
  185. _mav_put_float_array(buf, 88, pos_yaw, 5);
  186. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  187. #else
  188. mavlink_trajectory_representation_bezier_t packet;
  189. packet.time_usec = time_usec;
  190. packet.valid_points = valid_points;
  191. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  192. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  193. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  194. mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
  195. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  196. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, (const char *)&packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  197. #endif
  198. }
  199. /**
  200. * @brief Send a trajectory_representation_bezier message
  201. * @param chan MAVLink channel to send the message
  202. * @param struct The MAVLink struct to serialize
  203. */
  204. static inline void mavlink_msg_trajectory_representation_bezier_send_struct(mavlink_channel_t chan, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
  205. {
  206. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  207. mavlink_msg_trajectory_representation_bezier_send(chan, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
  208. #else
  209. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, (const char *)trajectory_representation_bezier, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  210. #endif
  211. }
  212. #if MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  213. /*
  214. This variant of _send() can be used to save stack space by re-using
  215. memory from the receive buffer. The caller provides a
  216. mavlink_message_t which is the size of a full mavlink message. This
  217. is usually the receive buffer for the channel, and allows a reply to an
  218. incoming message with minimum stack space usage.
  219. */
  220. static inline void mavlink_msg_trajectory_representation_bezier_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
  221. {
  222. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  223. char *buf = (char *)msgbuf;
  224. _mav_put_uint64_t(buf, 0, time_usec);
  225. _mav_put_uint8_t(buf, 108, valid_points);
  226. _mav_put_float_array(buf, 8, pos_x, 5);
  227. _mav_put_float_array(buf, 28, pos_y, 5);
  228. _mav_put_float_array(buf, 48, pos_z, 5);
  229. _mav_put_float_array(buf, 68, delta, 5);
  230. _mav_put_float_array(buf, 88, pos_yaw, 5);
  231. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  232. #else
  233. mavlink_trajectory_representation_bezier_t *packet = (mavlink_trajectory_representation_bezier_t *)msgbuf;
  234. packet->time_usec = time_usec;
  235. packet->valid_points = valid_points;
  236. mav_array_memcpy(packet->pos_x, pos_x, sizeof(float)*5);
  237. mav_array_memcpy(packet->pos_y, pos_y, sizeof(float)*5);
  238. mav_array_memcpy(packet->pos_z, pos_z, sizeof(float)*5);
  239. mav_array_memcpy(packet->delta, delta, sizeof(float)*5);
  240. mav_array_memcpy(packet->pos_yaw, pos_yaw, sizeof(float)*5);
  241. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, (const char *)packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
  242. #endif
  243. }
  244. #endif
  245. #endif
  246. // MESSAGE TRAJECTORY_REPRESENTATION_BEZIER UNPACKING
  247. /**
  248. * @brief Get field time_usec from trajectory_representation_bezier message
  249. *
  250. * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  251. */
  252. static inline uint64_t mavlink_msg_trajectory_representation_bezier_get_time_usec(const mavlink_message_t* msg)
  253. {
  254. return _MAV_RETURN_uint64_t(msg, 0);
  255. }
  256. /**
  257. * @brief Get field valid_points from trajectory_representation_bezier message
  258. *
  259. * @return Number of valid control points (up-to 5 points are possible)
  260. */
  261. static inline uint8_t mavlink_msg_trajectory_representation_bezier_get_valid_points(const mavlink_message_t* msg)
  262. {
  263. return _MAV_RETURN_uint8_t(msg, 108);
  264. }
  265. /**
  266. * @brief Get field pos_x from trajectory_representation_bezier message
  267. *
  268. * @return [m] X-coordinate of bezier control points. Set to NaN if not being used
  269. */
  270. static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_x(const mavlink_message_t* msg, float *pos_x)
  271. {
  272. return _MAV_RETURN_float_array(msg, pos_x, 5, 8);
  273. }
  274. /**
  275. * @brief Get field pos_y from trajectory_representation_bezier message
  276. *
  277. * @return [m] Y-coordinate of bezier control points. Set to NaN if not being used
  278. */
  279. static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_y(const mavlink_message_t* msg, float *pos_y)
  280. {
  281. return _MAV_RETURN_float_array(msg, pos_y, 5, 28);
  282. }
  283. /**
  284. * @brief Get field pos_z from trajectory_representation_bezier message
  285. *
  286. * @return [m] Z-coordinate of bezier control points. Set to NaN if not being used
  287. */
  288. static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_z(const mavlink_message_t* msg, float *pos_z)
  289. {
  290. return _MAV_RETURN_float_array(msg, pos_z, 5, 48);
  291. }
  292. /**
  293. * @brief Get field delta from trajectory_representation_bezier message
  294. *
  295. * @return [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
  296. */
  297. static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_delta(const mavlink_message_t* msg, float *delta)
  298. {
  299. return _MAV_RETURN_float_array(msg, delta, 5, 68);
  300. }
  301. /**
  302. * @brief Get field pos_yaw from trajectory_representation_bezier message
  303. *
  304. * @return [rad] Yaw. Set to NaN for unchanged
  305. */
  306. static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_yaw(const mavlink_message_t* msg, float *pos_yaw)
  307. {
  308. return _MAV_RETURN_float_array(msg, pos_yaw, 5, 88);
  309. }
  310. /**
  311. * @brief Decode a trajectory_representation_bezier message into a struct
  312. *
  313. * @param msg The message to decode
  314. * @param trajectory_representation_bezier C-struct to decode the message contents into
  315. */
  316. static inline void mavlink_msg_trajectory_representation_bezier_decode(const mavlink_message_t* msg, mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
  317. {
  318. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  319. trajectory_representation_bezier->time_usec = mavlink_msg_trajectory_representation_bezier_get_time_usec(msg);
  320. mavlink_msg_trajectory_representation_bezier_get_pos_x(msg, trajectory_representation_bezier->pos_x);
  321. mavlink_msg_trajectory_representation_bezier_get_pos_y(msg, trajectory_representation_bezier->pos_y);
  322. mavlink_msg_trajectory_representation_bezier_get_pos_z(msg, trajectory_representation_bezier->pos_z);
  323. mavlink_msg_trajectory_representation_bezier_get_delta(msg, trajectory_representation_bezier->delta);
  324. mavlink_msg_trajectory_representation_bezier_get_pos_yaw(msg, trajectory_representation_bezier->pos_yaw);
  325. trajectory_representation_bezier->valid_points = mavlink_msg_trajectory_representation_bezier_get_valid_points(msg);
  326. #else
  327. uint8_t len = msg->len < MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN? msg->len : MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN;
  328. memset(trajectory_representation_bezier, 0, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
  329. memcpy(trajectory_representation_bezier, _MAV_PAYLOAD(msg), len);
  330. #endif
  331. }