RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_position_target_global_int.h
1#pragma once
2// MESSAGE POSITION_TARGET_GLOBAL_INT PACKING
3
4#define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87
5
6MAVPACKED(
7typedef struct __mavlink_position_target_global_int_t {
8 uint32_t time_boot_ms; /*< Timestamp in milliseconds 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; /*< X Position in WGS84 frame in 1e7 * meters*/
10 int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/
11 float alt; /*< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT*/
12 float vx; /*< X velocity in NED frame in meter / s*/
13 float vy; /*< Y velocity in NED frame in meter / s*/
14 float vz; /*< Z velocity in NED frame in meter / s*/
15 float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
16 float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
17 float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
18 float yaw; /*< yaw setpoint in rad*/
19 float yaw_rate; /*< yaw rate setpoint in rad/s*/
20 uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/
21 uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/
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 Timestamp in milliseconds 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_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
85 * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
86 * @param lat_int X Position in WGS84 frame in 1e7 * meters
87 * @param lon_int Y Position in WGS84 frame in 1e7 * meters
88 * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
89 * @param vx X velocity in NED frame in meter / s
90 * @param vy Y velocity in NED frame in meter / s
91 * @param vz Z velocity in NED frame in meter / s
92 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
93 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
94 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
95 * @param yaw yaw setpoint in rad
96 * @param yaw_rate yaw rate setpoint in rad/s
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
103 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
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
140 msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
141 return mavlink_finalize_message(msg, system_id, component_id, 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);
142}
143
144/**
145 * @brief Pack a position_target_global_int message on a channel
146 * @param system_id ID of this system
147 * @param component_id ID of this component (e.g. 200 for IMU)
148 * @param chan The MAVLink channel this message will be sent over
149 * @param msg The MAVLink message to compress the data into
150 * @param time_boot_ms Timestamp in milliseconds 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.
151 * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
152 * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
153 * @param lat_int X Position in WGS84 frame in 1e7 * meters
154 * @param lon_int Y Position in WGS84 frame in 1e7 * meters
155 * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
156 * @param vx X velocity in NED frame in meter / s
157 * @param vy Y velocity in NED frame in meter / s
158 * @param vz Z velocity in NED frame in meter / s
159 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
160 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
161 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
162 * @param yaw yaw setpoint in rad
163 * @param yaw_rate yaw rate setpoint in rad/s
164 * @return length of the message in bytes (excluding serial stream start sign)
165 */
166static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
167 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
171 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
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
208 msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
209 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 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);
210}
211
212/**
213 * @brief Encode a position_target_global_int struct
214 *
215 * @param system_id ID of this system
216 * @param component_id ID of this component (e.g. 200 for IMU)
217 * @param msg The MAVLink message to compress the data into
218 * @param position_target_global_int C-struct to read the message contents from
219 */
220static 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)
221{
222 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);
223}
224
225/**
226 * @brief Encode a position_target_global_int struct on a channel
227 *
228 * @param system_id ID of this system
229 * @param component_id ID of this component (e.g. 200 for IMU)
230 * @param chan The MAVLink channel this message will be sent over
231 * @param msg The MAVLink message to compress the data into
232 * @param position_target_global_int C-struct to read the message contents from
233 */
234static 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)
235{
236 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);
237}
238
239/**
240 * @brief Send a position_target_global_int message
241 * @param chan MAVLink channel to send the message
242 *
243 * @param time_boot_ms Timestamp in milliseconds 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.
244 * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
245 * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
246 * @param lat_int X Position in WGS84 frame in 1e7 * meters
247 * @param lon_int Y Position in WGS84 frame in 1e7 * meters
248 * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
249 * @param vx X velocity in NED frame in meter / s
250 * @param vy Y velocity in NED frame in meter / s
251 * @param vz Z velocity in NED frame in meter / s
252 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
253 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
254 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
255 * @param yaw yaw setpoint in rad
256 * @param yaw_rate yaw rate setpoint in rad/s
257 */
258#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
259
260static 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)
261{
262#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
263 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
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, coordinate_frame);
278
279 _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);
280#else
281 mavlink_position_target_global_int_t packet;
282 packet.time_boot_ms = time_boot_ms;
283 packet.lat_int = lat_int;
284 packet.lon_int = lon_int;
285 packet.alt = alt;
286 packet.vx = vx;
287 packet.vy = vy;
288 packet.vz = vz;
289 packet.afx = afx;
290 packet.afy = afy;
291 packet.afz = afz;
292 packet.yaw = yaw;
293 packet.yaw_rate = yaw_rate;
294 packet.type_mask = type_mask;
295 packet.coordinate_frame = coordinate_frame;
296
297 _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);
298#endif
299}
300
301/**
302 * @brief Send a position_target_global_int message
303 * @param chan MAVLink channel to send the message
304 * @param struct The MAVLink struct to serialize
305 */
306static 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)
307{
308#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
309 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);
310#else
311 _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);
312#endif
313}
314
315#if MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
316/*
317 This varient of _send() can be used to save stack space by re-using
318 memory from the receive buffer. The caller provides a
319 mavlink_message_t which is the size of a full mavlink message. This
320 is usually the receive buffer for the channel, and allows a reply to an
321 incoming message with minimum stack space usage.
322 */
323static 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)
324{
325#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
326 char *buf = (char *)msgbuf;
327 _mav_put_uint32_t(buf, 0, time_boot_ms);
328 _mav_put_int32_t(buf, 4, lat_int);
329 _mav_put_int32_t(buf, 8, lon_int);
330 _mav_put_float(buf, 12, alt);
331 _mav_put_float(buf, 16, vx);
332 _mav_put_float(buf, 20, vy);
333 _mav_put_float(buf, 24, vz);
334 _mav_put_float(buf, 28, afx);
335 _mav_put_float(buf, 32, afy);
336 _mav_put_float(buf, 36, afz);
337 _mav_put_float(buf, 40, yaw);
338 _mav_put_float(buf, 44, yaw_rate);
339 _mav_put_uint16_t(buf, 48, type_mask);
340 _mav_put_uint8_t(buf, 50, coordinate_frame);
341
342 _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);
343#else
344 mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf;
345 packet->time_boot_ms = time_boot_ms;
346 packet->lat_int = lat_int;
347 packet->lon_int = lon_int;
348 packet->alt = alt;
349 packet->vx = vx;
350 packet->vy = vy;
351 packet->vz = vz;
352 packet->afx = afx;
353 packet->afy = afy;
354 packet->afz = afz;
355 packet->yaw = yaw;
356 packet->yaw_rate = yaw_rate;
357 packet->type_mask = type_mask;
358 packet->coordinate_frame = coordinate_frame;
359
360 _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);
361#endif
362}
363#endif
364
365#endif
366
367// MESSAGE POSITION_TARGET_GLOBAL_INT UNPACKING
368
369
370/**
371 * @brief Get field time_boot_ms from position_target_global_int message
372 *
373 * @return Timestamp in milliseconds 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.
374 */
375static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg)
376{
377 return _MAV_RETURN_uint32_t(msg, 0);
378}
379
380/**
381 * @brief Get field coordinate_frame from position_target_global_int message
382 *
383 * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
384 */
385static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg)
386{
387 return _MAV_RETURN_uint8_t(msg, 50);
388}
389
390/**
391 * @brief Get field type_mask from position_target_global_int message
392 *
393 * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
394 */
395static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg)
396{
397 return _MAV_RETURN_uint16_t(msg, 48);
398}
399
400/**
401 * @brief Get field lat_int from position_target_global_int message
402 *
403 * @return X Position in WGS84 frame in 1e7 * meters
404 */
405static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg)
406{
407 return _MAV_RETURN_int32_t(msg, 4);
408}
409
410/**
411 * @brief Get field lon_int from position_target_global_int message
412 *
413 * @return Y Position in WGS84 frame in 1e7 * meters
414 */
415static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg)
416{
417 return _MAV_RETURN_int32_t(msg, 8);
418}
419
420/**
421 * @brief Get field alt from position_target_global_int message
422 *
423 * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
424 */
425static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg)
426{
427 return _MAV_RETURN_float(msg, 12);
428}
429
430/**
431 * @brief Get field vx from position_target_global_int message
432 *
433 * @return X velocity in NED frame in meter / s
434 */
435static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg)
436{
437 return _MAV_RETURN_float(msg, 16);
438}
439
440/**
441 * @brief Get field vy from position_target_global_int message
442 *
443 * @return Y velocity in NED frame in meter / s
444 */
445static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg)
446{
447 return _MAV_RETURN_float(msg, 20);
448}
449
450/**
451 * @brief Get field vz from position_target_global_int message
452 *
453 * @return Z velocity in NED frame in meter / s
454 */
455static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg)
456{
457 return _MAV_RETURN_float(msg, 24);
458}
459
460/**
461 * @brief Get field afx from position_target_global_int message
462 *
463 * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
464 */
465static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg)
466{
467 return _MAV_RETURN_float(msg, 28);
468}
469
470/**
471 * @brief Get field afy from position_target_global_int message
472 *
473 * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
474 */
475static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg)
476{
477 return _MAV_RETURN_float(msg, 32);
478}
479
480/**
481 * @brief Get field afz from position_target_global_int message
482 *
483 * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
484 */
485static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg)
486{
487 return _MAV_RETURN_float(msg, 36);
488}
489
490/**
491 * @brief Get field yaw from position_target_global_int message
492 *
493 * @return yaw setpoint in rad
494 */
495static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg)
496{
497 return _MAV_RETURN_float(msg, 40);
498}
499
500/**
501 * @brief Get field yaw_rate from position_target_global_int message
502 *
503 * @return yaw rate setpoint in rad/s
504 */
505static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg)
506{
507 return _MAV_RETURN_float(msg, 44);
508}
509
510/**
511 * @brief Decode a position_target_global_int message into a struct
512 *
513 * @param msg The message to decode
514 * @param position_target_global_int C-struct to decode the message contents into
515 */
516static inline void mavlink_msg_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_position_target_global_int_t* position_target_global_int)
517{
518#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
519 position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg);
520 position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg);
521 position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg);
522 position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg);
523 position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg);
524 position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg);
525 position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg);
526 position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg);
527 position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg);
528 position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg);
529 position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg);
530 position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg);
531 position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg);
532 position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg);
533#else
534 uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN;
535 memset(position_target_global_int, 0, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
536 memcpy(position_target_global_int, _MAV_PAYLOAD(msg), len);
537#endif
538}