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