2
0

mavlink_msg_trajectory_representation_waypoints.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. #pragma once
  2. // MESSAGE TRAJECTORY_REPRESENTATION_WAYPOINTS PACKING
  3. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS 332
  4. typedef struct __mavlink_trajectory_representation_waypoints_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 waypoint, set to NaN if not being used*/
  7. float pos_y[5]; /*< [m] Y-coordinate of waypoint, set to NaN if not being used*/
  8. float pos_z[5]; /*< [m] Z-coordinate of waypoint, set to NaN if not being used*/
  9. float vel_x[5]; /*< [m/s] X-velocity of waypoint, set to NaN if not being used*/
  10. float vel_y[5]; /*< [m/s] Y-velocity of waypoint, set to NaN if not being used*/
  11. float vel_z[5]; /*< [m/s] Z-velocity of waypoint, set to NaN if not being used*/
  12. float acc_x[5]; /*< [m/s/s] X-acceleration of waypoint, set to NaN if not being used*/
  13. float acc_y[5]; /*< [m/s/s] Y-acceleration of waypoint, set to NaN if not being used*/
  14. float acc_z[5]; /*< [m/s/s] Z-acceleration of waypoint, set to NaN if not being used*/
  15. float pos_yaw[5]; /*< [rad] Yaw angle, set to NaN if not being used*/
  16. float vel_yaw[5]; /*< [rad/s] Yaw rate, set to NaN if not being used*/
  17. uint16_t command[5]; /*< MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.*/
  18. uint8_t valid_points; /*< Number of valid points (up-to 5 waypoints are possible)*/
  19. } mavlink_trajectory_representation_waypoints_t;
  20. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN 239
  21. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN 239
  22. #define MAVLINK_MSG_ID_332_LEN 239
  23. #define MAVLINK_MSG_ID_332_MIN_LEN 239
  24. #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC 236
  25. #define MAVLINK_MSG_ID_332_CRC 236
  26. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_X_LEN 5
  27. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_Y_LEN 5
  28. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_Z_LEN 5
  29. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_X_LEN 5
  30. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_Y_LEN 5
  31. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_Z_LEN 5
  32. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_ACC_X_LEN 5
  33. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_ACC_Y_LEN 5
  34. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_ACC_Z_LEN 5
  35. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_YAW_LEN 5
  36. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_YAW_LEN 5
  37. #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_COMMAND_LEN 5
  38. #if MAVLINK_COMMAND_24BIT
  39. #define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_WAYPOINTS { \
  40. 332, \
  41. "TRAJECTORY_REPRESENTATION_WAYPOINTS", \
  42. 14, \
  43. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_waypoints_t, time_usec) }, \
  44. { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 238, offsetof(mavlink_trajectory_representation_waypoints_t, valid_points) }, \
  45. { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_waypoints_t, pos_x) }, \
  46. { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_waypoints_t, pos_y) }, \
  47. { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_waypoints_t, pos_z) }, \
  48. { "vel_x", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_waypoints_t, vel_x) }, \
  49. { "vel_y", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_waypoints_t, vel_y) }, \
  50. { "vel_z", NULL, MAVLINK_TYPE_FLOAT, 5, 108, offsetof(mavlink_trajectory_representation_waypoints_t, vel_z) }, \
  51. { "acc_x", NULL, MAVLINK_TYPE_FLOAT, 5, 128, offsetof(mavlink_trajectory_representation_waypoints_t, acc_x) }, \
  52. { "acc_y", NULL, MAVLINK_TYPE_FLOAT, 5, 148, offsetof(mavlink_trajectory_representation_waypoints_t, acc_y) }, \
  53. { "acc_z", NULL, MAVLINK_TYPE_FLOAT, 5, 168, offsetof(mavlink_trajectory_representation_waypoints_t, acc_z) }, \
  54. { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 188, offsetof(mavlink_trajectory_representation_waypoints_t, pos_yaw) }, \
  55. { "vel_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 208, offsetof(mavlink_trajectory_representation_waypoints_t, vel_yaw) }, \
  56. { "command", NULL, MAVLINK_TYPE_UINT16_T, 5, 228, offsetof(mavlink_trajectory_representation_waypoints_t, command) }, \
  57. } \
  58. }
  59. #else
  60. #define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_WAYPOINTS { \
  61. "TRAJECTORY_REPRESENTATION_WAYPOINTS", \
  62. 14, \
  63. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_waypoints_t, time_usec) }, \
  64. { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 238, offsetof(mavlink_trajectory_representation_waypoints_t, valid_points) }, \
  65. { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_waypoints_t, pos_x) }, \
  66. { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_waypoints_t, pos_y) }, \
  67. { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_waypoints_t, pos_z) }, \
  68. { "vel_x", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_waypoints_t, vel_x) }, \
  69. { "vel_y", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_waypoints_t, vel_y) }, \
  70. { "vel_z", NULL, MAVLINK_TYPE_FLOAT, 5, 108, offsetof(mavlink_trajectory_representation_waypoints_t, vel_z) }, \
  71. { "acc_x", NULL, MAVLINK_TYPE_FLOAT, 5, 128, offsetof(mavlink_trajectory_representation_waypoints_t, acc_x) }, \
  72. { "acc_y", NULL, MAVLINK_TYPE_FLOAT, 5, 148, offsetof(mavlink_trajectory_representation_waypoints_t, acc_y) }, \
  73. { "acc_z", NULL, MAVLINK_TYPE_FLOAT, 5, 168, offsetof(mavlink_trajectory_representation_waypoints_t, acc_z) }, \
  74. { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 188, offsetof(mavlink_trajectory_representation_waypoints_t, pos_yaw) }, \
  75. { "vel_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 208, offsetof(mavlink_trajectory_representation_waypoints_t, vel_yaw) }, \
  76. { "command", NULL, MAVLINK_TYPE_UINT16_T, 5, 228, offsetof(mavlink_trajectory_representation_waypoints_t, command) }, \
  77. } \
  78. }
  79. #endif
  80. /**
  81. * @brief Pack a trajectory_representation_waypoints message
  82. * @param system_id ID of this system
  83. * @param component_id ID of this component (e.g. 200 for IMU)
  84. * @param msg The MAVLink message to compress the data into
  85. *
  86. * @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.
  87. * @param valid_points Number of valid points (up-to 5 waypoints are possible)
  88. * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
  89. * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
  90. * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
  91. * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
  92. * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
  93. * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
  94. * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
  95. * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
  96. * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
  97. * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
  98. * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
  99. * @param command MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.
  100. * @return length of the message in bytes (excluding serial stream start sign)
  101. */
  102. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  103. uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
  104. {
  105. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  106. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
  107. _mav_put_uint64_t(buf, 0, time_usec);
  108. _mav_put_uint8_t(buf, 238, valid_points);
  109. _mav_put_float_array(buf, 8, pos_x, 5);
  110. _mav_put_float_array(buf, 28, pos_y, 5);
  111. _mav_put_float_array(buf, 48, pos_z, 5);
  112. _mav_put_float_array(buf, 68, vel_x, 5);
  113. _mav_put_float_array(buf, 88, vel_y, 5);
  114. _mav_put_float_array(buf, 108, vel_z, 5);
  115. _mav_put_float_array(buf, 128, acc_x, 5);
  116. _mav_put_float_array(buf, 148, acc_y, 5);
  117. _mav_put_float_array(buf, 168, acc_z, 5);
  118. _mav_put_float_array(buf, 188, pos_yaw, 5);
  119. _mav_put_float_array(buf, 208, vel_yaw, 5);
  120. _mav_put_uint16_t_array(buf, 228, command, 5);
  121. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  122. #else
  123. mavlink_trajectory_representation_waypoints_t packet;
  124. packet.time_usec = time_usec;
  125. packet.valid_points = valid_points;
  126. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  127. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  128. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  129. mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
  130. mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
  131. mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
  132. mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
  133. mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
  134. mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
  135. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  136. mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
  137. mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
  138. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  139. #endif
  140. msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS;
  141. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  142. }
  143. /**
  144. * @brief Pack a trajectory_representation_waypoints message
  145. * @param system_id ID of this system
  146. * @param component_id ID of this component (e.g. 200 for IMU)
  147. * @param status MAVLink status structure
  148. * @param msg The MAVLink message to compress the data into
  149. *
  150. * @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.
  151. * @param valid_points Number of valid points (up-to 5 waypoints are possible)
  152. * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
  153. * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
  154. * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
  155. * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
  156. * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
  157. * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
  158. * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
  159. * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
  160. * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
  161. * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
  162. * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
  163. * @param command MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.
  164. * @return length of the message in bytes (excluding serial stream start sign)
  165. */
  166. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  167. uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
  168. {
  169. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  170. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
  171. _mav_put_uint64_t(buf, 0, time_usec);
  172. _mav_put_uint8_t(buf, 238, valid_points);
  173. _mav_put_float_array(buf, 8, pos_x, 5);
  174. _mav_put_float_array(buf, 28, pos_y, 5);
  175. _mav_put_float_array(buf, 48, pos_z, 5);
  176. _mav_put_float_array(buf, 68, vel_x, 5);
  177. _mav_put_float_array(buf, 88, vel_y, 5);
  178. _mav_put_float_array(buf, 108, vel_z, 5);
  179. _mav_put_float_array(buf, 128, acc_x, 5);
  180. _mav_put_float_array(buf, 148, acc_y, 5);
  181. _mav_put_float_array(buf, 168, acc_z, 5);
  182. _mav_put_float_array(buf, 188, pos_yaw, 5);
  183. _mav_put_float_array(buf, 208, vel_yaw, 5);
  184. _mav_put_uint16_t_array(buf, 228, command, 5);
  185. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  186. #else
  187. mavlink_trajectory_representation_waypoints_t packet;
  188. packet.time_usec = time_usec;
  189. packet.valid_points = valid_points;
  190. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  191. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  192. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  193. mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
  194. mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
  195. mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
  196. mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
  197. mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
  198. mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
  199. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  200. mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
  201. mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
  202. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  203. #endif
  204. msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS;
  205. #if MAVLINK_CRC_EXTRA
  206. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  207. #else
  208. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  209. #endif
  210. }
  211. /**
  212. * @brief Pack a trajectory_representation_waypoints message on a channel
  213. * @param system_id ID of this system
  214. * @param component_id ID of this component (e.g. 200 for IMU)
  215. * @param chan The MAVLink channel this message will be sent over
  216. * @param msg The MAVLink message to compress the data into
  217. * @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.
  218. * @param valid_points Number of valid points (up-to 5 waypoints are possible)
  219. * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
  220. * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
  221. * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
  222. * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
  223. * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
  224. * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
  225. * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
  226. * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
  227. * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
  228. * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
  229. * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
  230. * @param command MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.
  231. * @return length of the message in bytes (excluding serial stream start sign)
  232. */
  233. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  234. mavlink_message_t* msg,
  235. uint64_t time_usec,uint8_t valid_points,const float *pos_x,const float *pos_y,const float *pos_z,const float *vel_x,const float *vel_y,const float *vel_z,const float *acc_x,const float *acc_y,const float *acc_z,const float *pos_yaw,const float *vel_yaw,const uint16_t *command)
  236. {
  237. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  238. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
  239. _mav_put_uint64_t(buf, 0, time_usec);
  240. _mav_put_uint8_t(buf, 238, valid_points);
  241. _mav_put_float_array(buf, 8, pos_x, 5);
  242. _mav_put_float_array(buf, 28, pos_y, 5);
  243. _mav_put_float_array(buf, 48, pos_z, 5);
  244. _mav_put_float_array(buf, 68, vel_x, 5);
  245. _mav_put_float_array(buf, 88, vel_y, 5);
  246. _mav_put_float_array(buf, 108, vel_z, 5);
  247. _mav_put_float_array(buf, 128, acc_x, 5);
  248. _mav_put_float_array(buf, 148, acc_y, 5);
  249. _mav_put_float_array(buf, 168, acc_z, 5);
  250. _mav_put_float_array(buf, 188, pos_yaw, 5);
  251. _mav_put_float_array(buf, 208, vel_yaw, 5);
  252. _mav_put_uint16_t_array(buf, 228, command, 5);
  253. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  254. #else
  255. mavlink_trajectory_representation_waypoints_t packet;
  256. packet.time_usec = time_usec;
  257. packet.valid_points = valid_points;
  258. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  259. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  260. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  261. mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
  262. mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
  263. mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
  264. mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
  265. mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
  266. mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
  267. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  268. mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
  269. mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
  270. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  271. #endif
  272. msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS;
  273. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  274. }
  275. /**
  276. * @brief Encode a trajectory_representation_waypoints struct
  277. *
  278. * @param system_id ID of this system
  279. * @param component_id ID of this component (e.g. 200 for IMU)
  280. * @param msg The MAVLink message to compress the data into
  281. * @param trajectory_representation_waypoints C-struct to read the message contents from
  282. */
  283. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
  284. {
  285. return mavlink_msg_trajectory_representation_waypoints_pack(system_id, component_id, msg, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
  286. }
  287. /**
  288. * @brief Encode a trajectory_representation_waypoints struct on a channel
  289. *
  290. * @param system_id ID of this system
  291. * @param component_id ID of this component (e.g. 200 for IMU)
  292. * @param chan The MAVLink channel this message will be sent over
  293. * @param msg The MAVLink message to compress the data into
  294. * @param trajectory_representation_waypoints C-struct to read the message contents from
  295. */
  296. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
  297. {
  298. return mavlink_msg_trajectory_representation_waypoints_pack_chan(system_id, component_id, chan, msg, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
  299. }
  300. /**
  301. * @brief Encode a trajectory_representation_waypoints struct with provided status structure
  302. *
  303. * @param system_id ID of this system
  304. * @param component_id ID of this component (e.g. 200 for IMU)
  305. * @param status MAVLink status structure
  306. * @param msg The MAVLink message to compress the data into
  307. * @param trajectory_representation_waypoints C-struct to read the message contents from
  308. */
  309. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
  310. {
  311. return mavlink_msg_trajectory_representation_waypoints_pack_status(system_id, component_id, _status, msg, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
  312. }
  313. /**
  314. * @brief Send a trajectory_representation_waypoints message
  315. * @param chan MAVLink channel to send the message
  316. *
  317. * @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.
  318. * @param valid_points Number of valid points (up-to 5 waypoints are possible)
  319. * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
  320. * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
  321. * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
  322. * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
  323. * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
  324. * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
  325. * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
  326. * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
  327. * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
  328. * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
  329. * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
  330. * @param command MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.
  331. */
  332. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  333. static inline void mavlink_msg_trajectory_representation_waypoints_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 *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
  334. {
  335. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  336. char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
  337. _mav_put_uint64_t(buf, 0, time_usec);
  338. _mav_put_uint8_t(buf, 238, valid_points);
  339. _mav_put_float_array(buf, 8, pos_x, 5);
  340. _mav_put_float_array(buf, 28, pos_y, 5);
  341. _mav_put_float_array(buf, 48, pos_z, 5);
  342. _mav_put_float_array(buf, 68, vel_x, 5);
  343. _mav_put_float_array(buf, 88, vel_y, 5);
  344. _mav_put_float_array(buf, 108, vel_z, 5);
  345. _mav_put_float_array(buf, 128, acc_x, 5);
  346. _mav_put_float_array(buf, 148, acc_y, 5);
  347. _mav_put_float_array(buf, 168, acc_z, 5);
  348. _mav_put_float_array(buf, 188, pos_yaw, 5);
  349. _mav_put_float_array(buf, 208, vel_yaw, 5);
  350. _mav_put_uint16_t_array(buf, 228, command, 5);
  351. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  352. #else
  353. mavlink_trajectory_representation_waypoints_t packet;
  354. packet.time_usec = time_usec;
  355. packet.valid_points = valid_points;
  356. mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
  357. mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
  358. mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
  359. mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
  360. mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
  361. mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
  362. mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
  363. mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
  364. mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
  365. mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
  366. mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
  367. mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
  368. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, (const char *)&packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  369. #endif
  370. }
  371. /**
  372. * @brief Send a trajectory_representation_waypoints message
  373. * @param chan MAVLink channel to send the message
  374. * @param struct The MAVLink struct to serialize
  375. */
  376. static inline void mavlink_msg_trajectory_representation_waypoints_send_struct(mavlink_channel_t chan, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
  377. {
  378. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  379. mavlink_msg_trajectory_representation_waypoints_send(chan, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
  380. #else
  381. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, (const char *)trajectory_representation_waypoints, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  382. #endif
  383. }
  384. #if MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  385. /*
  386. This variant of _send() can be used to save stack space by re-using
  387. memory from the receive buffer. The caller provides a
  388. mavlink_message_t which is the size of a full mavlink message. This
  389. is usually the receive buffer for the channel, and allows a reply to an
  390. incoming message with minimum stack space usage.
  391. */
  392. static inline void mavlink_msg_trajectory_representation_waypoints_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 *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
  393. {
  394. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  395. char *buf = (char *)msgbuf;
  396. _mav_put_uint64_t(buf, 0, time_usec);
  397. _mav_put_uint8_t(buf, 238, valid_points);
  398. _mav_put_float_array(buf, 8, pos_x, 5);
  399. _mav_put_float_array(buf, 28, pos_y, 5);
  400. _mav_put_float_array(buf, 48, pos_z, 5);
  401. _mav_put_float_array(buf, 68, vel_x, 5);
  402. _mav_put_float_array(buf, 88, vel_y, 5);
  403. _mav_put_float_array(buf, 108, vel_z, 5);
  404. _mav_put_float_array(buf, 128, acc_x, 5);
  405. _mav_put_float_array(buf, 148, acc_y, 5);
  406. _mav_put_float_array(buf, 168, acc_z, 5);
  407. _mav_put_float_array(buf, 188, pos_yaw, 5);
  408. _mav_put_float_array(buf, 208, vel_yaw, 5);
  409. _mav_put_uint16_t_array(buf, 228, command, 5);
  410. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  411. #else
  412. mavlink_trajectory_representation_waypoints_t *packet = (mavlink_trajectory_representation_waypoints_t *)msgbuf;
  413. packet->time_usec = time_usec;
  414. packet->valid_points = valid_points;
  415. mav_array_memcpy(packet->pos_x, pos_x, sizeof(float)*5);
  416. mav_array_memcpy(packet->pos_y, pos_y, sizeof(float)*5);
  417. mav_array_memcpy(packet->pos_z, pos_z, sizeof(float)*5);
  418. mav_array_memcpy(packet->vel_x, vel_x, sizeof(float)*5);
  419. mav_array_memcpy(packet->vel_y, vel_y, sizeof(float)*5);
  420. mav_array_memcpy(packet->vel_z, vel_z, sizeof(float)*5);
  421. mav_array_memcpy(packet->acc_x, acc_x, sizeof(float)*5);
  422. mav_array_memcpy(packet->acc_y, acc_y, sizeof(float)*5);
  423. mav_array_memcpy(packet->acc_z, acc_z, sizeof(float)*5);
  424. mav_array_memcpy(packet->pos_yaw, pos_yaw, sizeof(float)*5);
  425. mav_array_memcpy(packet->vel_yaw, vel_yaw, sizeof(float)*5);
  426. mav_array_memcpy(packet->command, command, sizeof(uint16_t)*5);
  427. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, (const char *)packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
  428. #endif
  429. }
  430. #endif
  431. #endif
  432. // MESSAGE TRAJECTORY_REPRESENTATION_WAYPOINTS UNPACKING
  433. /**
  434. * @brief Get field time_usec from trajectory_representation_waypoints message
  435. *
  436. * @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.
  437. */
  438. static inline uint64_t mavlink_msg_trajectory_representation_waypoints_get_time_usec(const mavlink_message_t* msg)
  439. {
  440. return _MAV_RETURN_uint64_t(msg, 0);
  441. }
  442. /**
  443. * @brief Get field valid_points from trajectory_representation_waypoints message
  444. *
  445. * @return Number of valid points (up-to 5 waypoints are possible)
  446. */
  447. static inline uint8_t mavlink_msg_trajectory_representation_waypoints_get_valid_points(const mavlink_message_t* msg)
  448. {
  449. return _MAV_RETURN_uint8_t(msg, 238);
  450. }
  451. /**
  452. * @brief Get field pos_x from trajectory_representation_waypoints message
  453. *
  454. * @return [m] X-coordinate of waypoint, set to NaN if not being used
  455. */
  456. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_x(const mavlink_message_t* msg, float *pos_x)
  457. {
  458. return _MAV_RETURN_float_array(msg, pos_x, 5, 8);
  459. }
  460. /**
  461. * @brief Get field pos_y from trajectory_representation_waypoints message
  462. *
  463. * @return [m] Y-coordinate of waypoint, set to NaN if not being used
  464. */
  465. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_y(const mavlink_message_t* msg, float *pos_y)
  466. {
  467. return _MAV_RETURN_float_array(msg, pos_y, 5, 28);
  468. }
  469. /**
  470. * @brief Get field pos_z from trajectory_representation_waypoints message
  471. *
  472. * @return [m] Z-coordinate of waypoint, set to NaN if not being used
  473. */
  474. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_z(const mavlink_message_t* msg, float *pos_z)
  475. {
  476. return _MAV_RETURN_float_array(msg, pos_z, 5, 48);
  477. }
  478. /**
  479. * @brief Get field vel_x from trajectory_representation_waypoints message
  480. *
  481. * @return [m/s] X-velocity of waypoint, set to NaN if not being used
  482. */
  483. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_x(const mavlink_message_t* msg, float *vel_x)
  484. {
  485. return _MAV_RETURN_float_array(msg, vel_x, 5, 68);
  486. }
  487. /**
  488. * @brief Get field vel_y from trajectory_representation_waypoints message
  489. *
  490. * @return [m/s] Y-velocity of waypoint, set to NaN if not being used
  491. */
  492. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_y(const mavlink_message_t* msg, float *vel_y)
  493. {
  494. return _MAV_RETURN_float_array(msg, vel_y, 5, 88);
  495. }
  496. /**
  497. * @brief Get field vel_z from trajectory_representation_waypoints message
  498. *
  499. * @return [m/s] Z-velocity of waypoint, set to NaN if not being used
  500. */
  501. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_z(const mavlink_message_t* msg, float *vel_z)
  502. {
  503. return _MAV_RETURN_float_array(msg, vel_z, 5, 108);
  504. }
  505. /**
  506. * @brief Get field acc_x from trajectory_representation_waypoints message
  507. *
  508. * @return [m/s/s] X-acceleration of waypoint, set to NaN if not being used
  509. */
  510. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_acc_x(const mavlink_message_t* msg, float *acc_x)
  511. {
  512. return _MAV_RETURN_float_array(msg, acc_x, 5, 128);
  513. }
  514. /**
  515. * @brief Get field acc_y from trajectory_representation_waypoints message
  516. *
  517. * @return [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
  518. */
  519. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_acc_y(const mavlink_message_t* msg, float *acc_y)
  520. {
  521. return _MAV_RETURN_float_array(msg, acc_y, 5, 148);
  522. }
  523. /**
  524. * @brief Get field acc_z from trajectory_representation_waypoints message
  525. *
  526. * @return [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
  527. */
  528. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_acc_z(const mavlink_message_t* msg, float *acc_z)
  529. {
  530. return _MAV_RETURN_float_array(msg, acc_z, 5, 168);
  531. }
  532. /**
  533. * @brief Get field pos_yaw from trajectory_representation_waypoints message
  534. *
  535. * @return [rad] Yaw angle, set to NaN if not being used
  536. */
  537. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_yaw(const mavlink_message_t* msg, float *pos_yaw)
  538. {
  539. return _MAV_RETURN_float_array(msg, pos_yaw, 5, 188);
  540. }
  541. /**
  542. * @brief Get field vel_yaw from trajectory_representation_waypoints message
  543. *
  544. * @return [rad/s] Yaw rate, set to NaN if not being used
  545. */
  546. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_yaw(const mavlink_message_t* msg, float *vel_yaw)
  547. {
  548. return _MAV_RETURN_float_array(msg, vel_yaw, 5, 208);
  549. }
  550. /**
  551. * @brief Get field command from trajectory_representation_waypoints message
  552. *
  553. * @return MAV_CMD command id of waypoint, set to UINT16_MAX if not being used.
  554. */
  555. static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_command(const mavlink_message_t* msg, uint16_t *command)
  556. {
  557. return _MAV_RETURN_uint16_t_array(msg, command, 5, 228);
  558. }
  559. /**
  560. * @brief Decode a trajectory_representation_waypoints message into a struct
  561. *
  562. * @param msg The message to decode
  563. * @param trajectory_representation_waypoints C-struct to decode the message contents into
  564. */
  565. static inline void mavlink_msg_trajectory_representation_waypoints_decode(const mavlink_message_t* msg, mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
  566. {
  567. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  568. trajectory_representation_waypoints->time_usec = mavlink_msg_trajectory_representation_waypoints_get_time_usec(msg);
  569. mavlink_msg_trajectory_representation_waypoints_get_pos_x(msg, trajectory_representation_waypoints->pos_x);
  570. mavlink_msg_trajectory_representation_waypoints_get_pos_y(msg, trajectory_representation_waypoints->pos_y);
  571. mavlink_msg_trajectory_representation_waypoints_get_pos_z(msg, trajectory_representation_waypoints->pos_z);
  572. mavlink_msg_trajectory_representation_waypoints_get_vel_x(msg, trajectory_representation_waypoints->vel_x);
  573. mavlink_msg_trajectory_representation_waypoints_get_vel_y(msg, trajectory_representation_waypoints->vel_y);
  574. mavlink_msg_trajectory_representation_waypoints_get_vel_z(msg, trajectory_representation_waypoints->vel_z);
  575. mavlink_msg_trajectory_representation_waypoints_get_acc_x(msg, trajectory_representation_waypoints->acc_x);
  576. mavlink_msg_trajectory_representation_waypoints_get_acc_y(msg, trajectory_representation_waypoints->acc_y);
  577. mavlink_msg_trajectory_representation_waypoints_get_acc_z(msg, trajectory_representation_waypoints->acc_z);
  578. mavlink_msg_trajectory_representation_waypoints_get_pos_yaw(msg, trajectory_representation_waypoints->pos_yaw);
  579. mavlink_msg_trajectory_representation_waypoints_get_vel_yaw(msg, trajectory_representation_waypoints->vel_yaw);
  580. mavlink_msg_trajectory_representation_waypoints_get_command(msg, trajectory_representation_waypoints->command);
  581. trajectory_representation_waypoints->valid_points = mavlink_msg_trajectory_representation_waypoints_get_valid_points(msg);
  582. #else
  583. uint8_t len = msg->len < MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN? msg->len : MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN;
  584. memset(trajectory_representation_waypoints, 0, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
  585. memcpy(trajectory_representation_waypoints, _MAV_PAYLOAD(msg), len);
  586. #endif
  587. }