mavlink_msg_vk_rtk_base_pvt.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. #pragma once
  2. // MESSAGE VK_RTK_BASE_PVT PACKING
  3. #define MAVLINK_MSG_ID_VK_RTK_BASE_PVT 53024
  4. typedef struct __mavlink_vk_rtk_base_pvt_t {
  5. uint32_t timestamp; /*< [ms] timestamp from system boot*/
  6. int32_t lon; /*< [degE7] solved longitude*/
  7. int32_t lat; /*< [degE7] solved latitude*/
  8. float msl; /*< [m] solved latitude*/
  9. float ve; /*< [m/s] solved east speed*/
  10. float vn; /*< [m/s] solved north speed*/
  11. float vu; /*< [m/s] solved up speed*/
  12. float heading; /*< [deg] yaw angle*/
  13. float pitch; /*< [deg] pitch angle*/
  14. uint8_t p_sat_num; /*< position satellite number*/
  15. uint8_t h_sat_num; /*< heading satellite number*/
  16. uint8_t p_type; /*< heading satellite number*/
  17. uint8_t h_type; /*< heading satellite number*/
  18. } mavlink_vk_rtk_base_pvt_t;
  19. #define MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN 40
  20. #define MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN 40
  21. #define MAVLINK_MSG_ID_53024_LEN 40
  22. #define MAVLINK_MSG_ID_53024_MIN_LEN 40
  23. #define MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC 87
  24. #define MAVLINK_MSG_ID_53024_CRC 87
  25. #if MAVLINK_COMMAND_24BIT
  26. #define MAVLINK_MESSAGE_INFO_VK_RTK_BASE_PVT { \
  27. 53024, \
  28. "VK_RTK_BASE_PVT", \
  29. 13, \
  30. { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vk_rtk_base_pvt_t, timestamp) }, \
  31. { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_vk_rtk_base_pvt_t, lon) }, \
  32. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_vk_rtk_base_pvt_t, lat) }, \
  33. { "msl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vk_rtk_base_pvt_t, msl) }, \
  34. { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vk_rtk_base_pvt_t, ve) }, \
  35. { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vk_rtk_base_pvt_t, vn) }, \
  36. { "vu", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vk_rtk_base_pvt_t, vu) }, \
  37. { "heading", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vk_rtk_base_pvt_t, heading) }, \
  38. { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_vk_rtk_base_pvt_t, pitch) }, \
  39. { "p_sat_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_vk_rtk_base_pvt_t, p_sat_num) }, \
  40. { "h_sat_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_vk_rtk_base_pvt_t, h_sat_num) }, \
  41. { "p_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_vk_rtk_base_pvt_t, p_type) }, \
  42. { "h_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_vk_rtk_base_pvt_t, h_type) }, \
  43. } \
  44. }
  45. #else
  46. #define MAVLINK_MESSAGE_INFO_VK_RTK_BASE_PVT { \
  47. "VK_RTK_BASE_PVT", \
  48. 13, \
  49. { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_vk_rtk_base_pvt_t, timestamp) }, \
  50. { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_vk_rtk_base_pvt_t, lon) }, \
  51. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_vk_rtk_base_pvt_t, lat) }, \
  52. { "msl", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_vk_rtk_base_pvt_t, msl) }, \
  53. { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_vk_rtk_base_pvt_t, ve) }, \
  54. { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_vk_rtk_base_pvt_t, vn) }, \
  55. { "vu", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_vk_rtk_base_pvt_t, vu) }, \
  56. { "heading", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_vk_rtk_base_pvt_t, heading) }, \
  57. { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_vk_rtk_base_pvt_t, pitch) }, \
  58. { "p_sat_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_vk_rtk_base_pvt_t, p_sat_num) }, \
  59. { "h_sat_num", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_vk_rtk_base_pvt_t, h_sat_num) }, \
  60. { "p_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 38, offsetof(mavlink_vk_rtk_base_pvt_t, p_type) }, \
  61. { "h_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 39, offsetof(mavlink_vk_rtk_base_pvt_t, h_type) }, \
  62. } \
  63. }
  64. #endif
  65. /**
  66. * @brief Pack a vk_rtk_base_pvt message
  67. * @param system_id ID of this system
  68. * @param component_id ID of this component (e.g. 200 for IMU)
  69. * @param msg The MAVLink message to compress the data into
  70. *
  71. * @param timestamp [ms] timestamp from system boot
  72. * @param lon [degE7] solved longitude
  73. * @param lat [degE7] solved latitude
  74. * @param msl [m] solved latitude
  75. * @param ve [m/s] solved east speed
  76. * @param vn [m/s] solved north speed
  77. * @param vu [m/s] solved up speed
  78. * @param heading [deg] yaw angle
  79. * @param pitch [deg] pitch angle
  80. * @param p_sat_num position satellite number
  81. * @param h_sat_num heading satellite number
  82. * @param p_type heading satellite number
  83. * @param h_type heading satellite number
  84. * @return length of the message in bytes (excluding serial stream start sign)
  85. */
  86. static inline uint16_t mavlink_msg_vk_rtk_base_pvt_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  87. uint32_t timestamp, int32_t lon, int32_t lat, float msl, float ve, float vn, float vu, float heading, float pitch, uint8_t p_sat_num, uint8_t h_sat_num, uint8_t p_type, uint8_t h_type)
  88. {
  89. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  90. char buf[MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN];
  91. _mav_put_uint32_t(buf, 0, timestamp);
  92. _mav_put_int32_t(buf, 4, lon);
  93. _mav_put_int32_t(buf, 8, lat);
  94. _mav_put_float(buf, 12, msl);
  95. _mav_put_float(buf, 16, ve);
  96. _mav_put_float(buf, 20, vn);
  97. _mav_put_float(buf, 24, vu);
  98. _mav_put_float(buf, 28, heading);
  99. _mav_put_float(buf, 32, pitch);
  100. _mav_put_uint8_t(buf, 36, p_sat_num);
  101. _mav_put_uint8_t(buf, 37, h_sat_num);
  102. _mav_put_uint8_t(buf, 38, p_type);
  103. _mav_put_uint8_t(buf, 39, h_type);
  104. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  105. #else
  106. mavlink_vk_rtk_base_pvt_t packet;
  107. packet.timestamp = timestamp;
  108. packet.lon = lon;
  109. packet.lat = lat;
  110. packet.msl = msl;
  111. packet.ve = ve;
  112. packet.vn = vn;
  113. packet.vu = vu;
  114. packet.heading = heading;
  115. packet.pitch = pitch;
  116. packet.p_sat_num = p_sat_num;
  117. packet.h_sat_num = h_sat_num;
  118. packet.p_type = p_type;
  119. packet.h_type = h_type;
  120. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  121. #endif
  122. msg->msgid = MAVLINK_MSG_ID_VK_RTK_BASE_PVT;
  123. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  124. }
  125. /**
  126. * @brief Pack a vk_rtk_base_pvt message
  127. * @param system_id ID of this system
  128. * @param component_id ID of this component (e.g. 200 for IMU)
  129. * @param status MAVLink status structure
  130. * @param msg The MAVLink message to compress the data into
  131. *
  132. * @param timestamp [ms] timestamp from system boot
  133. * @param lon [degE7] solved longitude
  134. * @param lat [degE7] solved latitude
  135. * @param msl [m] solved latitude
  136. * @param ve [m/s] solved east speed
  137. * @param vn [m/s] solved north speed
  138. * @param vu [m/s] solved up speed
  139. * @param heading [deg] yaw angle
  140. * @param pitch [deg] pitch angle
  141. * @param p_sat_num position satellite number
  142. * @param h_sat_num heading satellite number
  143. * @param p_type heading satellite number
  144. * @param h_type heading satellite number
  145. * @return length of the message in bytes (excluding serial stream start sign)
  146. */
  147. static inline uint16_t mavlink_msg_vk_rtk_base_pvt_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  148. uint32_t timestamp, int32_t lon, int32_t lat, float msl, float ve, float vn, float vu, float heading, float pitch, uint8_t p_sat_num, uint8_t h_sat_num, uint8_t p_type, uint8_t h_type)
  149. {
  150. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  151. char buf[MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN];
  152. _mav_put_uint32_t(buf, 0, timestamp);
  153. _mav_put_int32_t(buf, 4, lon);
  154. _mav_put_int32_t(buf, 8, lat);
  155. _mav_put_float(buf, 12, msl);
  156. _mav_put_float(buf, 16, ve);
  157. _mav_put_float(buf, 20, vn);
  158. _mav_put_float(buf, 24, vu);
  159. _mav_put_float(buf, 28, heading);
  160. _mav_put_float(buf, 32, pitch);
  161. _mav_put_uint8_t(buf, 36, p_sat_num);
  162. _mav_put_uint8_t(buf, 37, h_sat_num);
  163. _mav_put_uint8_t(buf, 38, p_type);
  164. _mav_put_uint8_t(buf, 39, h_type);
  165. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  166. #else
  167. mavlink_vk_rtk_base_pvt_t packet;
  168. packet.timestamp = timestamp;
  169. packet.lon = lon;
  170. packet.lat = lat;
  171. packet.msl = msl;
  172. packet.ve = ve;
  173. packet.vn = vn;
  174. packet.vu = vu;
  175. packet.heading = heading;
  176. packet.pitch = pitch;
  177. packet.p_sat_num = p_sat_num;
  178. packet.h_sat_num = h_sat_num;
  179. packet.p_type = p_type;
  180. packet.h_type = h_type;
  181. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  182. #endif
  183. msg->msgid = MAVLINK_MSG_ID_VK_RTK_BASE_PVT;
  184. #if MAVLINK_CRC_EXTRA
  185. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  186. #else
  187. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  188. #endif
  189. }
  190. /**
  191. * @brief Pack a vk_rtk_base_pvt message on a channel
  192. * @param system_id ID of this system
  193. * @param component_id ID of this component (e.g. 200 for IMU)
  194. * @param chan The MAVLink channel this message will be sent over
  195. * @param msg The MAVLink message to compress the data into
  196. * @param timestamp [ms] timestamp from system boot
  197. * @param lon [degE7] solved longitude
  198. * @param lat [degE7] solved latitude
  199. * @param msl [m] solved latitude
  200. * @param ve [m/s] solved east speed
  201. * @param vn [m/s] solved north speed
  202. * @param vu [m/s] solved up speed
  203. * @param heading [deg] yaw angle
  204. * @param pitch [deg] pitch angle
  205. * @param p_sat_num position satellite number
  206. * @param h_sat_num heading satellite number
  207. * @param p_type heading satellite number
  208. * @param h_type heading satellite number
  209. * @return length of the message in bytes (excluding serial stream start sign)
  210. */
  211. static inline uint16_t mavlink_msg_vk_rtk_base_pvt_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  212. mavlink_message_t* msg,
  213. uint32_t timestamp,int32_t lon,int32_t lat,float msl,float ve,float vn,float vu,float heading,float pitch,uint8_t p_sat_num,uint8_t h_sat_num,uint8_t p_type,uint8_t h_type)
  214. {
  215. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  216. char buf[MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN];
  217. _mav_put_uint32_t(buf, 0, timestamp);
  218. _mav_put_int32_t(buf, 4, lon);
  219. _mav_put_int32_t(buf, 8, lat);
  220. _mav_put_float(buf, 12, msl);
  221. _mav_put_float(buf, 16, ve);
  222. _mav_put_float(buf, 20, vn);
  223. _mav_put_float(buf, 24, vu);
  224. _mav_put_float(buf, 28, heading);
  225. _mav_put_float(buf, 32, pitch);
  226. _mav_put_uint8_t(buf, 36, p_sat_num);
  227. _mav_put_uint8_t(buf, 37, h_sat_num);
  228. _mav_put_uint8_t(buf, 38, p_type);
  229. _mav_put_uint8_t(buf, 39, h_type);
  230. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  231. #else
  232. mavlink_vk_rtk_base_pvt_t packet;
  233. packet.timestamp = timestamp;
  234. packet.lon = lon;
  235. packet.lat = lat;
  236. packet.msl = msl;
  237. packet.ve = ve;
  238. packet.vn = vn;
  239. packet.vu = vu;
  240. packet.heading = heading;
  241. packet.pitch = pitch;
  242. packet.p_sat_num = p_sat_num;
  243. packet.h_sat_num = h_sat_num;
  244. packet.p_type = p_type;
  245. packet.h_type = h_type;
  246. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  247. #endif
  248. msg->msgid = MAVLINK_MSG_ID_VK_RTK_BASE_PVT;
  249. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  250. }
  251. /**
  252. * @brief Encode a vk_rtk_base_pvt struct
  253. *
  254. * @param system_id ID of this system
  255. * @param component_id ID of this component (e.g. 200 for IMU)
  256. * @param msg The MAVLink message to compress the data into
  257. * @param vk_rtk_base_pvt C-struct to read the message contents from
  258. */
  259. static inline uint16_t mavlink_msg_vk_rtk_base_pvt_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vk_rtk_base_pvt_t* vk_rtk_base_pvt)
  260. {
  261. return mavlink_msg_vk_rtk_base_pvt_pack(system_id, component_id, msg, vk_rtk_base_pvt->timestamp, vk_rtk_base_pvt->lon, vk_rtk_base_pvt->lat, vk_rtk_base_pvt->msl, vk_rtk_base_pvt->ve, vk_rtk_base_pvt->vn, vk_rtk_base_pvt->vu, vk_rtk_base_pvt->heading, vk_rtk_base_pvt->pitch, vk_rtk_base_pvt->p_sat_num, vk_rtk_base_pvt->h_sat_num, vk_rtk_base_pvt->p_type, vk_rtk_base_pvt->h_type);
  262. }
  263. /**
  264. * @brief Encode a vk_rtk_base_pvt struct on a channel
  265. *
  266. * @param system_id ID of this system
  267. * @param component_id ID of this component (e.g. 200 for IMU)
  268. * @param chan The MAVLink channel this message will be sent over
  269. * @param msg The MAVLink message to compress the data into
  270. * @param vk_rtk_base_pvt C-struct to read the message contents from
  271. */
  272. static inline uint16_t mavlink_msg_vk_rtk_base_pvt_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vk_rtk_base_pvt_t* vk_rtk_base_pvt)
  273. {
  274. return mavlink_msg_vk_rtk_base_pvt_pack_chan(system_id, component_id, chan, msg, vk_rtk_base_pvt->timestamp, vk_rtk_base_pvt->lon, vk_rtk_base_pvt->lat, vk_rtk_base_pvt->msl, vk_rtk_base_pvt->ve, vk_rtk_base_pvt->vn, vk_rtk_base_pvt->vu, vk_rtk_base_pvt->heading, vk_rtk_base_pvt->pitch, vk_rtk_base_pvt->p_sat_num, vk_rtk_base_pvt->h_sat_num, vk_rtk_base_pvt->p_type, vk_rtk_base_pvt->h_type);
  275. }
  276. /**
  277. * @brief Encode a vk_rtk_base_pvt struct with provided status structure
  278. *
  279. * @param system_id ID of this system
  280. * @param component_id ID of this component (e.g. 200 for IMU)
  281. * @param status MAVLink status structure
  282. * @param msg The MAVLink message to compress the data into
  283. * @param vk_rtk_base_pvt C-struct to read the message contents from
  284. */
  285. static inline uint16_t mavlink_msg_vk_rtk_base_pvt_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vk_rtk_base_pvt_t* vk_rtk_base_pvt)
  286. {
  287. return mavlink_msg_vk_rtk_base_pvt_pack_status(system_id, component_id, _status, msg, vk_rtk_base_pvt->timestamp, vk_rtk_base_pvt->lon, vk_rtk_base_pvt->lat, vk_rtk_base_pvt->msl, vk_rtk_base_pvt->ve, vk_rtk_base_pvt->vn, vk_rtk_base_pvt->vu, vk_rtk_base_pvt->heading, vk_rtk_base_pvt->pitch, vk_rtk_base_pvt->p_sat_num, vk_rtk_base_pvt->h_sat_num, vk_rtk_base_pvt->p_type, vk_rtk_base_pvt->h_type);
  288. }
  289. /**
  290. * @brief Send a vk_rtk_base_pvt message
  291. * @param chan MAVLink channel to send the message
  292. *
  293. * @param timestamp [ms] timestamp from system boot
  294. * @param lon [degE7] solved longitude
  295. * @param lat [degE7] solved latitude
  296. * @param msl [m] solved latitude
  297. * @param ve [m/s] solved east speed
  298. * @param vn [m/s] solved north speed
  299. * @param vu [m/s] solved up speed
  300. * @param heading [deg] yaw angle
  301. * @param pitch [deg] pitch angle
  302. * @param p_sat_num position satellite number
  303. * @param h_sat_num heading satellite number
  304. * @param p_type heading satellite number
  305. * @param h_type heading satellite number
  306. */
  307. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  308. static inline void mavlink_msg_vk_rtk_base_pvt_send(mavlink_channel_t chan, uint32_t timestamp, int32_t lon, int32_t lat, float msl, float ve, float vn, float vu, float heading, float pitch, uint8_t p_sat_num, uint8_t h_sat_num, uint8_t p_type, uint8_t h_type)
  309. {
  310. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  311. char buf[MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN];
  312. _mav_put_uint32_t(buf, 0, timestamp);
  313. _mav_put_int32_t(buf, 4, lon);
  314. _mav_put_int32_t(buf, 8, lat);
  315. _mav_put_float(buf, 12, msl);
  316. _mav_put_float(buf, 16, ve);
  317. _mav_put_float(buf, 20, vn);
  318. _mav_put_float(buf, 24, vu);
  319. _mav_put_float(buf, 28, heading);
  320. _mav_put_float(buf, 32, pitch);
  321. _mav_put_uint8_t(buf, 36, p_sat_num);
  322. _mav_put_uint8_t(buf, 37, h_sat_num);
  323. _mav_put_uint8_t(buf, 38, p_type);
  324. _mav_put_uint8_t(buf, 39, h_type);
  325. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_RTK_BASE_PVT, buf, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  326. #else
  327. mavlink_vk_rtk_base_pvt_t packet;
  328. packet.timestamp = timestamp;
  329. packet.lon = lon;
  330. packet.lat = lat;
  331. packet.msl = msl;
  332. packet.ve = ve;
  333. packet.vn = vn;
  334. packet.vu = vu;
  335. packet.heading = heading;
  336. packet.pitch = pitch;
  337. packet.p_sat_num = p_sat_num;
  338. packet.h_sat_num = h_sat_num;
  339. packet.p_type = p_type;
  340. packet.h_type = h_type;
  341. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_RTK_BASE_PVT, (const char *)&packet, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  342. #endif
  343. }
  344. /**
  345. * @brief Send a vk_rtk_base_pvt message
  346. * @param chan MAVLink channel to send the message
  347. * @param struct The MAVLink struct to serialize
  348. */
  349. static inline void mavlink_msg_vk_rtk_base_pvt_send_struct(mavlink_channel_t chan, const mavlink_vk_rtk_base_pvt_t* vk_rtk_base_pvt)
  350. {
  351. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  352. mavlink_msg_vk_rtk_base_pvt_send(chan, vk_rtk_base_pvt->timestamp, vk_rtk_base_pvt->lon, vk_rtk_base_pvt->lat, vk_rtk_base_pvt->msl, vk_rtk_base_pvt->ve, vk_rtk_base_pvt->vn, vk_rtk_base_pvt->vu, vk_rtk_base_pvt->heading, vk_rtk_base_pvt->pitch, vk_rtk_base_pvt->p_sat_num, vk_rtk_base_pvt->h_sat_num, vk_rtk_base_pvt->p_type, vk_rtk_base_pvt->h_type);
  353. #else
  354. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_RTK_BASE_PVT, (const char *)vk_rtk_base_pvt, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  355. #endif
  356. }
  357. #if MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  358. /*
  359. This variant of _send() can be used to save stack space by re-using
  360. memory from the receive buffer. The caller provides a
  361. mavlink_message_t which is the size of a full mavlink message. This
  362. is usually the receive buffer for the channel, and allows a reply to an
  363. incoming message with minimum stack space usage.
  364. */
  365. static inline void mavlink_msg_vk_rtk_base_pvt_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t timestamp, int32_t lon, int32_t lat, float msl, float ve, float vn, float vu, float heading, float pitch, uint8_t p_sat_num, uint8_t h_sat_num, uint8_t p_type, uint8_t h_type)
  366. {
  367. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  368. char *buf = (char *)msgbuf;
  369. _mav_put_uint32_t(buf, 0, timestamp);
  370. _mav_put_int32_t(buf, 4, lon);
  371. _mav_put_int32_t(buf, 8, lat);
  372. _mav_put_float(buf, 12, msl);
  373. _mav_put_float(buf, 16, ve);
  374. _mav_put_float(buf, 20, vn);
  375. _mav_put_float(buf, 24, vu);
  376. _mav_put_float(buf, 28, heading);
  377. _mav_put_float(buf, 32, pitch);
  378. _mav_put_uint8_t(buf, 36, p_sat_num);
  379. _mav_put_uint8_t(buf, 37, h_sat_num);
  380. _mav_put_uint8_t(buf, 38, p_type);
  381. _mav_put_uint8_t(buf, 39, h_type);
  382. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_RTK_BASE_PVT, buf, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  383. #else
  384. mavlink_vk_rtk_base_pvt_t *packet = (mavlink_vk_rtk_base_pvt_t *)msgbuf;
  385. packet->timestamp = timestamp;
  386. packet->lon = lon;
  387. packet->lat = lat;
  388. packet->msl = msl;
  389. packet->ve = ve;
  390. packet->vn = vn;
  391. packet->vu = vu;
  392. packet->heading = heading;
  393. packet->pitch = pitch;
  394. packet->p_sat_num = p_sat_num;
  395. packet->h_sat_num = h_sat_num;
  396. packet->p_type = p_type;
  397. packet->h_type = h_type;
  398. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VK_RTK_BASE_PVT, (const char *)packet, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_MIN_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_CRC);
  399. #endif
  400. }
  401. #endif
  402. #endif
  403. // MESSAGE VK_RTK_BASE_PVT UNPACKING
  404. /**
  405. * @brief Get field timestamp from vk_rtk_base_pvt message
  406. *
  407. * @return [ms] timestamp from system boot
  408. */
  409. static inline uint32_t mavlink_msg_vk_rtk_base_pvt_get_timestamp(const mavlink_message_t* msg)
  410. {
  411. return _MAV_RETURN_uint32_t(msg, 0);
  412. }
  413. /**
  414. * @brief Get field lon from vk_rtk_base_pvt message
  415. *
  416. * @return [degE7] solved longitude
  417. */
  418. static inline int32_t mavlink_msg_vk_rtk_base_pvt_get_lon(const mavlink_message_t* msg)
  419. {
  420. return _MAV_RETURN_int32_t(msg, 4);
  421. }
  422. /**
  423. * @brief Get field lat from vk_rtk_base_pvt message
  424. *
  425. * @return [degE7] solved latitude
  426. */
  427. static inline int32_t mavlink_msg_vk_rtk_base_pvt_get_lat(const mavlink_message_t* msg)
  428. {
  429. return _MAV_RETURN_int32_t(msg, 8);
  430. }
  431. /**
  432. * @brief Get field msl from vk_rtk_base_pvt message
  433. *
  434. * @return [m] solved latitude
  435. */
  436. static inline float mavlink_msg_vk_rtk_base_pvt_get_msl(const mavlink_message_t* msg)
  437. {
  438. return _MAV_RETURN_float(msg, 12);
  439. }
  440. /**
  441. * @brief Get field ve from vk_rtk_base_pvt message
  442. *
  443. * @return [m/s] solved east speed
  444. */
  445. static inline float mavlink_msg_vk_rtk_base_pvt_get_ve(const mavlink_message_t* msg)
  446. {
  447. return _MAV_RETURN_float(msg, 16);
  448. }
  449. /**
  450. * @brief Get field vn from vk_rtk_base_pvt message
  451. *
  452. * @return [m/s] solved north speed
  453. */
  454. static inline float mavlink_msg_vk_rtk_base_pvt_get_vn(const mavlink_message_t* msg)
  455. {
  456. return _MAV_RETURN_float(msg, 20);
  457. }
  458. /**
  459. * @brief Get field vu from vk_rtk_base_pvt message
  460. *
  461. * @return [m/s] solved up speed
  462. */
  463. static inline float mavlink_msg_vk_rtk_base_pvt_get_vu(const mavlink_message_t* msg)
  464. {
  465. return _MAV_RETURN_float(msg, 24);
  466. }
  467. /**
  468. * @brief Get field heading from vk_rtk_base_pvt message
  469. *
  470. * @return [deg] yaw angle
  471. */
  472. static inline float mavlink_msg_vk_rtk_base_pvt_get_heading(const mavlink_message_t* msg)
  473. {
  474. return _MAV_RETURN_float(msg, 28);
  475. }
  476. /**
  477. * @brief Get field pitch from vk_rtk_base_pvt message
  478. *
  479. * @return [deg] pitch angle
  480. */
  481. static inline float mavlink_msg_vk_rtk_base_pvt_get_pitch(const mavlink_message_t* msg)
  482. {
  483. return _MAV_RETURN_float(msg, 32);
  484. }
  485. /**
  486. * @brief Get field p_sat_num from vk_rtk_base_pvt message
  487. *
  488. * @return position satellite number
  489. */
  490. static inline uint8_t mavlink_msg_vk_rtk_base_pvt_get_p_sat_num(const mavlink_message_t* msg)
  491. {
  492. return _MAV_RETURN_uint8_t(msg, 36);
  493. }
  494. /**
  495. * @brief Get field h_sat_num from vk_rtk_base_pvt message
  496. *
  497. * @return heading satellite number
  498. */
  499. static inline uint8_t mavlink_msg_vk_rtk_base_pvt_get_h_sat_num(const mavlink_message_t* msg)
  500. {
  501. return _MAV_RETURN_uint8_t(msg, 37);
  502. }
  503. /**
  504. * @brief Get field p_type from vk_rtk_base_pvt message
  505. *
  506. * @return heading satellite number
  507. */
  508. static inline uint8_t mavlink_msg_vk_rtk_base_pvt_get_p_type(const mavlink_message_t* msg)
  509. {
  510. return _MAV_RETURN_uint8_t(msg, 38);
  511. }
  512. /**
  513. * @brief Get field h_type from vk_rtk_base_pvt message
  514. *
  515. * @return heading satellite number
  516. */
  517. static inline uint8_t mavlink_msg_vk_rtk_base_pvt_get_h_type(const mavlink_message_t* msg)
  518. {
  519. return _MAV_RETURN_uint8_t(msg, 39);
  520. }
  521. /**
  522. * @brief Decode a vk_rtk_base_pvt message into a struct
  523. *
  524. * @param msg The message to decode
  525. * @param vk_rtk_base_pvt C-struct to decode the message contents into
  526. */
  527. static inline void mavlink_msg_vk_rtk_base_pvt_decode(const mavlink_message_t* msg, mavlink_vk_rtk_base_pvt_t* vk_rtk_base_pvt)
  528. {
  529. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  530. vk_rtk_base_pvt->timestamp = mavlink_msg_vk_rtk_base_pvt_get_timestamp(msg);
  531. vk_rtk_base_pvt->lon = mavlink_msg_vk_rtk_base_pvt_get_lon(msg);
  532. vk_rtk_base_pvt->lat = mavlink_msg_vk_rtk_base_pvt_get_lat(msg);
  533. vk_rtk_base_pvt->msl = mavlink_msg_vk_rtk_base_pvt_get_msl(msg);
  534. vk_rtk_base_pvt->ve = mavlink_msg_vk_rtk_base_pvt_get_ve(msg);
  535. vk_rtk_base_pvt->vn = mavlink_msg_vk_rtk_base_pvt_get_vn(msg);
  536. vk_rtk_base_pvt->vu = mavlink_msg_vk_rtk_base_pvt_get_vu(msg);
  537. vk_rtk_base_pvt->heading = mavlink_msg_vk_rtk_base_pvt_get_heading(msg);
  538. vk_rtk_base_pvt->pitch = mavlink_msg_vk_rtk_base_pvt_get_pitch(msg);
  539. vk_rtk_base_pvt->p_sat_num = mavlink_msg_vk_rtk_base_pvt_get_p_sat_num(msg);
  540. vk_rtk_base_pvt->h_sat_num = mavlink_msg_vk_rtk_base_pvt_get_h_sat_num(msg);
  541. vk_rtk_base_pvt->p_type = mavlink_msg_vk_rtk_base_pvt_get_p_type(msg);
  542. vk_rtk_base_pvt->h_type = mavlink_msg_vk_rtk_base_pvt_get_h_type(msg);
  543. #else
  544. uint8_t len = msg->len < MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN? msg->len : MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN;
  545. memset(vk_rtk_base_pvt, 0, MAVLINK_MSG_ID_VK_RTK_BASE_PVT_LEN);
  546. memcpy(vk_rtk_base_pvt, _MAV_PAYLOAD(msg), len);
  547. #endif
  548. }