Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_position_target_global_int.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE POSITION_TARGET_GLOBAL_INT PACKING
3
4#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87
5
6
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/
9 int32_t lat_int; /*< [degE7] Latitude in WGS84 frame*/
10 int32_t lon_int; /*< [degE7] Longitude in WGS84 frame*/
11 float alt; /*< [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)*/
12 float vx; /*< [m/s] X velocity in NED frame*/
13 float vy; /*< [m/s] Y velocity in NED frame*/
14 float vz; /*< [m/s] Z velocity in NED frame*/
15 float afx; /*< [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
16 float afy; /*< [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
17 float afz; /*< [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
18 float yaw; /*< [rad] yaw setpoint*/
19 float yaw_rate; /*< [rad/s] yaw rate setpoint*/
20 uint16_t type_mask; /*< Bitmap to indicate which dimensions should be ignored by the vehicle.*/
21 uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)*/
22} mavlink_position_target_global_int_t;
23
24#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN 51
25#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN 51
26#define MAVLINK_MSG_ID_87_LEN 51
27#define MAVLINK_MSG_ID_87_MIN_LEN 51
28
29#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC 150
30#define MAVLINK_MSG_ID_87_CRC 150
31
32
33
34#if MAVLINK_COMMAND_24BIT
35#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT {
36 87,
37 "POSITION_TARGET_GLOBAL_INT",
38 14,
39 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) },
40 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) },
41 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) },
42 { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) },
43 { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) },
44 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) },
45 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) },
46 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) },
47 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) },
48 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) },
49 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) },
50 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) },
51 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) },
52 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) },
53 } \
54}
55#else
56#define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT {
57 "POSITION_TARGET_GLOBAL_INT",
58 14,
59 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) },
60 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) },
61 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) },
62 { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) },
63 { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) },
64 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) },
65 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) },
66 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) },
67 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) },
68 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) },
69 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) },
70 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) },
71 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) },
72 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) },
73 } \
74}
75#endif
76
77/**
78 * @brief Pack a position_target_global_int message
79 * @param system_id ID of this system
80 * @param component_id ID of this component (e.g. 200 for IMU)
81 * @param msg The MAVLink message to compress the data into
82 *
83 * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
84 * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)
85 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
86 * @param lat_int [degE7] Latitude in WGS84 frame
87 * @param lon_int [degE7] Longitude in WGS84 frame
88 * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)
89 * @param vx [m/s] X velocity in NED frame
90 * @param vy [m/s] Y velocity in NED frame
91 * @param vz [m/s] Z velocity in NED frame
92 * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
93 * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
94 * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
95 * @param yaw [rad] yaw setpoint
96 * @param yaw_rate [rad/s] yaw rate setpoint
97 * @return length of the message in bytes (excluding serial stream start sign)
98 */
99static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
100 uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
101{
102#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
104 _mav_put_uint32_t(buf, 0, time_boot_ms);
105 _mav_put_int32_t(buf, 4, lat_int);
106 _mav_put_int32_t(buf, 8, lon_int);
107 _mav_put_float(buf, 12, alt);
108 _mav_put_float(buf, 16, vx);
109 _mav_put_float(buf, 20, vy);
110 _mav_put_float(buf, 24, vz);
111 _mav_put_float(buf, 28, afx);
112 _mav_put_float(buf, 32, afy);
113 _mav_put_float(buf, 36, afz);
114 _mav_put_float(buf, 40, yaw);
115 _mav_put_float(buf, 44, yaw_rate);
116 _mav_put_uint16_t(buf, 48, type_mask);
117 _mav_put_uint8_t(buf, 50, coordinate_frame);
118
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
120#else
121 mavlink_position_target_global_int_t packet;
122 packet.time_boot_ms = time_boot_ms;
123 packet.lat_int = lat_int;
124 packet.lon_int = lon_int;
125 packet.alt = alt;
126 packet.vx = vx;
127 packet.vy = vy;
128 packet.vz = vz;
129 packet.afx = afx;
130 packet.afy = afy;
131 packet.afz = afz;
132 packet.yaw = yaw;
133 packet.yaw_rate = yaw_rate;
134 packet.type_mask = type_mask;
135 packet.coordinate_frame = coordinate_frame;
136
137 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
138#endif
139
142}
143
144/**
145 * @brief Pack a position_target_global_int message
146 * @param system_id ID of this system
147 * @param component_id ID of this component (e.g. 200 for IMU)
148 * @param status MAVLink status structure
149 * @param msg The MAVLink message to compress the data into
150 *
151 * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
152 * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)
153 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
154 * @param lat_int [degE7] Latitude in WGS84 frame
155 * @param lon_int [degE7] Longitude in WGS84 frame
156 * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)
157 * @param vx [m/s] X velocity in NED frame
158 * @param vy [m/s] Y velocity in NED frame
159 * @param vz [m/s] Z velocity in NED frame
160 * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
161 * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
162 * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
163 * @param yaw [rad] yaw setpoint
164 * @param yaw_rate [rad/s] yaw rate setpoint
165 * @return length of the message in bytes (excluding serial stream start sign)
166 */
167static inline uint16_t mavlink_msg_position_target_global_int_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
168 uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
169{
170#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
172 _mav_put_uint32_t(buf, 0, time_boot_ms);
173 _mav_put_int32_t(buf, 4, lat_int);
174 _mav_put_int32_t(buf, 8, lon_int);
175 _mav_put_float(buf, 12, alt);
176 _mav_put_float(buf, 16, vx);
177 _mav_put_float(buf, 20, vy);
178 _mav_put_float(buf, 24, vz);
179 _mav_put_float(buf, 28, afx);
180 _mav_put_float(buf, 32, afy);
181 _mav_put_float(buf, 36, afz);
182 _mav_put_float(buf, 40, yaw);
183 _mav_put_float(buf, 44, yaw_rate);
184 _mav_put_uint16_t(buf, 48, type_mask);
185 _mav_put_uint8_t(buf, 50, coordinate_frame);
186
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
188#else
189 mavlink_position_target_global_int_t packet;
190 packet.time_boot_ms = time_boot_ms;
191 packet.lat_int = lat_int;
192 packet.lon_int = lon_int;
193 packet.alt = alt;
194 packet.vx = vx;
195 packet.vy = vy;
196 packet.vz = vz;
197 packet.afx = afx;
198 packet.afy = afy;
199 packet.afz = afz;
200 packet.yaw = yaw;
201 packet.yaw_rate = yaw_rate;
202 packet.type_mask = type_mask;
203 packet.coordinate_frame = coordinate_frame;
204
205 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
206#endif
207
209#if MAVLINK_CRC_EXTRA
210 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
211#else
212 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
213#endif
214}
215
216/**
217 * @brief Pack a position_target_global_int message on a channel
218 * @param system_id ID of this system
219 * @param component_id ID of this component (e.g. 200 for IMU)
220 * @param chan The MAVLink channel this message will be sent over
221 * @param msg The MAVLink message to compress the data into
222 * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
223 * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)
224 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
225 * @param lat_int [degE7] Latitude in WGS84 frame
226 * @param lon_int [degE7] Longitude in WGS84 frame
227 * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)
228 * @param vx [m/s] X velocity in NED frame
229 * @param vy [m/s] Y velocity in NED frame
230 * @param vz [m/s] Z velocity in NED frame
231 * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
232 * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
233 * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
234 * @param yaw [rad] yaw setpoint
235 * @param yaw_rate [rad/s] yaw rate setpoint
236 * @return length of the message in bytes (excluding serial stream start sign)
237 */
238static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
239 mavlink_message_t* msg,
240 uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
241{
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
244 _mav_put_uint32_t(buf, 0, time_boot_ms);
245 _mav_put_int32_t(buf, 4, lat_int);
246 _mav_put_int32_t(buf, 8, lon_int);
247 _mav_put_float(buf, 12, alt);
248 _mav_put_float(buf, 16, vx);
249 _mav_put_float(buf, 20, vy);
250 _mav_put_float(buf, 24, vz);
251 _mav_put_float(buf, 28, afx);
252 _mav_put_float(buf, 32, afy);
253 _mav_put_float(buf, 36, afz);
254 _mav_put_float(buf, 40, yaw);
255 _mav_put_float(buf, 44, yaw_rate);
256 _mav_put_uint16_t(buf, 48, type_mask);
257 _mav_put_uint8_t(buf, 50, coordinate_frame);
258
259 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
260#else
261 mavlink_position_target_global_int_t packet;
262 packet.time_boot_ms = time_boot_ms;
263 packet.lat_int = lat_int;
264 packet.lon_int = lon_int;
265 packet.alt = alt;
266 packet.vx = vx;
267 packet.vy = vy;
268 packet.vz = vz;
269 packet.afx = afx;
270 packet.afy = afy;
271 packet.afz = afz;
272 packet.yaw = yaw;
273 packet.yaw_rate = yaw_rate;
274 packet.type_mask = type_mask;
275 packet.coordinate_frame = coordinate_frame;
276
277 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
278#endif
279
282}
283
284/**
285 * @brief Encode a position_target_global_int struct
286 *
287 * @param system_id ID of this system
288 * @param component_id ID of this component (e.g. 200 for IMU)
289 * @param msg The MAVLink message to compress the data into
290 * @param position_target_global_int C-struct to read the message contents from
291 */
292static inline uint16_t mavlink_msg_position_target_global_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
293{
294 return mavlink_msg_position_target_global_int_pack(system_id, component_id, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
295}
296
297/**
298 * @brief Encode a position_target_global_int struct on a channel
299 *
300 * @param system_id ID of this system
301 * @param component_id ID of this component (e.g. 200 for IMU)
302 * @param chan The MAVLink channel this message will be sent over
303 * @param msg The MAVLink message to compress the data into
304 * @param position_target_global_int C-struct to read the message contents from
305 */
306static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
307{
308 return mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, chan, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
309}
310
311/**
312 * @brief Encode a position_target_global_int struct with provided status structure
313 *
314 * @param system_id ID of this system
315 * @param component_id ID of this component (e.g. 200 for IMU)
316 * @param status MAVLink status structure
317 * @param msg The MAVLink message to compress the data into
318 * @param position_target_global_int C-struct to read the message contents from
319 */
320static inline uint16_t mavlink_msg_position_target_global_int_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
321{
322 return mavlink_msg_position_target_global_int_pack_status(system_id, component_id, _status, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
323}
324
325/**
326 * @brief Send a position_target_global_int message
327 * @param chan MAVLink channel to send the message
328 *
329 * @param time_boot_ms [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
330 * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)
331 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
332 * @param lat_int [degE7] Latitude in WGS84 frame
333 * @param lon_int [degE7] Longitude in WGS84 frame
334 * @param alt [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)
335 * @param vx [m/s] X velocity in NED frame
336 * @param vy [m/s] Y velocity in NED frame
337 * @param vz [m/s] Z velocity in NED frame
338 * @param afx [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
339 * @param afy [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
340 * @param afz [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
341 * @param yaw [rad] yaw setpoint
342 * @param yaw_rate [rad/s] yaw rate setpoint
343 */
344#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
345
346static inline void mavlink_msg_position_target_global_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
347{
348#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
349 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
350 _mav_put_uint32_t(buf, 0, time_boot_ms);
351 _mav_put_int32_t(buf, 4, lat_int);
352 _mav_put_int32_t(buf, 8, lon_int);
353 _mav_put_float(buf, 12, alt);
354 _mav_put_float(buf, 16, vx);
355 _mav_put_float(buf, 20, vy);
356 _mav_put_float(buf, 24, vz);
357 _mav_put_float(buf, 28, afx);
358 _mav_put_float(buf, 32, afy);
359 _mav_put_float(buf, 36, afz);
360 _mav_put_float(buf, 40, yaw);
361 _mav_put_float(buf, 44, yaw_rate);
362 _mav_put_uint16_t(buf, 48, type_mask);
363 _mav_put_uint8_t(buf, 50, coordinate_frame);
364
365 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
366#else
367 mavlink_position_target_global_int_t packet;
368 packet.time_boot_ms = time_boot_ms;
369 packet.lat_int = lat_int;
370 packet.lon_int = lon_int;
371 packet.alt = alt;
372 packet.vx = vx;
373 packet.vy = vy;
374 packet.vz = vz;
375 packet.afx = afx;
376 packet.afy = afy;
377 packet.afz = afz;
378 packet.yaw = yaw;
379 packet.yaw_rate = yaw_rate;
380 packet.type_mask = type_mask;
381 packet.coordinate_frame = coordinate_frame;
382
383 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
384#endif
385}
386
387/**
388 * @brief Send a position_target_global_int message
389 * @param chan MAVLink channel to send the message
390 * @param struct The MAVLink struct to serialize
391 */
392static inline void mavlink_msg_position_target_global_int_send_struct(mavlink_channel_t chan, const mavlink_position_target_global_int_t* position_target_global_int)
393{
394#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
395 mavlink_msg_position_target_global_int_send(chan, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
396#else
397 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)position_target_global_int, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
398#endif
399}
400
401#if MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
402/*
403 This variant of _send() can be used to save stack space by reusing
404 memory from the receive buffer. The caller provides a
405 mavlink_message_t which is the size of a full mavlink message. This
406 is usually the receive buffer for the channel, and allows a reply to an
407 incoming message with minimum stack space usage.
408 */
409static inline void mavlink_msg_position_target_global_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
410{
411#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
412 char *buf = (char *)msgbuf;
413 _mav_put_uint32_t(buf, 0, time_boot_ms);
414 _mav_put_int32_t(buf, 4, lat_int);
415 _mav_put_int32_t(buf, 8, lon_int);
416 _mav_put_float(buf, 12, alt);
417 _mav_put_float(buf, 16, vx);
418 _mav_put_float(buf, 20, vy);
419 _mav_put_float(buf, 24, vz);
420 _mav_put_float(buf, 28, afx);
421 _mav_put_float(buf, 32, afy);
422 _mav_put_float(buf, 36, afz);
423 _mav_put_float(buf, 40, yaw);
424 _mav_put_float(buf, 44, yaw_rate);
425 _mav_put_uint16_t(buf, 48, type_mask);
426 _mav_put_uint8_t(buf, 50, coordinate_frame);
427
428 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
429#else
430 mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf;
431 packet->time_boot_ms = time_boot_ms;
432 packet->lat_int = lat_int;
433 packet->lon_int = lon_int;
434 packet->alt = alt;
435 packet->vx = vx;
436 packet->vy = vy;
437 packet->vz = vz;
438 packet->afx = afx;
439 packet->afy = afy;
440 packet->afz = afz;
441 packet->yaw = yaw;
442 packet->yaw_rate = yaw_rate;
443 packet->type_mask = type_mask;
444 packet->coordinate_frame = coordinate_frame;
445
446 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
447#endif
448}
449#endif
450
451#endif
452
453// MESSAGE POSITION_TARGET_GLOBAL_INT UNPACKING
454
455
456/**
457 * @brief Get field time_boot_ms from position_target_global_int message
458 *
459 * @return [ms] Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
460 */
461static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg)
462{
463 return _MAV_RETURN_uint32_t(msg, 0);
464}
465
466/**
467 * @brief Get field coordinate_frame from position_target_global_int message
468 *
469 * @return Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)
470 */
471static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg)
472{
473 return _MAV_RETURN_uint8_t(msg, 50);
474}
475
476/**
477 * @brief Get field type_mask from position_target_global_int message
478 *
479 * @return Bitmap to indicate which dimensions should be ignored by the vehicle.
480 */
481static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg)
482{
483 return _MAV_RETURN_uint16_t(msg, 48);
484}
485
486/**
487 * @brief Get field lat_int from position_target_global_int message
488 *
489 * @return [degE7] Latitude in WGS84 frame
490 */
491static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg)
492{
493 return _MAV_RETURN_int32_t(msg, 4);
494}
495
496/**
497 * @brief Get field lon_int from position_target_global_int message
498 *
499 * @return [degE7] Longitude in WGS84 frame
500 */
501static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg)
502{
503 return _MAV_RETURN_int32_t(msg, 8);
504}
505
506/**
507 * @brief Get field alt from position_target_global_int message
508 *
509 * @return [m] Altitude (MSL, AGL or relative to home altitude, depending on frame)
510 */
511static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg)
512{
513 return _MAV_RETURN_float(msg, 12);
514}
515
516/**
517 * @brief Get field vx from position_target_global_int message
518 *
519 * @return [m/s] X velocity in NED frame
520 */
521static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg)
522{
523 return _MAV_RETURN_float(msg, 16);
524}
525
526/**
527 * @brief Get field vy from position_target_global_int message
528 *
529 * @return [m/s] Y velocity in NED frame
530 */
531static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg)
532{
533 return _MAV_RETURN_float(msg, 20);
534}
535
536/**
537 * @brief Get field vz from position_target_global_int message
538 *
539 * @return [m/s] Z velocity in NED frame
540 */
541static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg)
542{
543 return _MAV_RETURN_float(msg, 24);
544}
545
546/**
547 * @brief Get field afx from position_target_global_int message
548 *
549 * @return [m/s/s] X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
550 */
551static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg)
552{
553 return _MAV_RETURN_float(msg, 28);
554}
555
556/**
557 * @brief Get field afy from position_target_global_int message
558 *
559 * @return [m/s/s] Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
560 */
561static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg)
562{
563 return _MAV_RETURN_float(msg, 32);
564}
565
566/**
567 * @brief Get field afz from position_target_global_int message
568 *
569 * @return [m/s/s] Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
570 */
571static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg)
572{
573 return _MAV_RETURN_float(msg, 36);
574}
575
576/**
577 * @brief Get field yaw from position_target_global_int message
578 *
579 * @return [rad] yaw setpoint
580 */
581static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg)
582{
583 return _MAV_RETURN_float(msg, 40);
584}
585
586/**
587 * @brief Get field yaw_rate from position_target_global_int message
588 *
589 * @return [rad/s] yaw rate setpoint
590 */
591static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg)
592{
593 return _MAV_RETURN_float(msg, 44);
594}
595
596/**
597 * @brief Decode a position_target_global_int message into a struct
598 *
599 * @param msg The message to decode
600 * @param position_target_global_int C-struct to decode the message contents into
601 */
602static inline void mavlink_msg_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_position_target_global_int_t* position_target_global_int)
603{
604#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
605 position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg);
606 position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg);
607 position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg);
608 position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg);
609 position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg);
610 position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg);
611 position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg);
612 position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg);
613 position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg);
614 position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg);
615 position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg);
616 position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg);
617 position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg);
618 position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg);
619#else
620 uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN;
621 memset(position_target_global_int, 0, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
622 memcpy(position_target_global_int, _MAV_PAYLOAD(msg), len);
623#endif
624}