Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_position_target_global_int.h
blobb9601467a4d8c49b859fd74613fca903807d86cc
1 // MESSAGE POSITION_TARGET_GLOBAL_INT PACKING
3 #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87
5 typedef struct __mavlink_position_target_global_int_t
7 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.
8 int32_t lat_int; ///< X Position in WGS84 frame in 1e7 * meters
9 int32_t lon_int; ///< Y Position in WGS84 frame in 1e7 * meters
10 float alt; ///< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
11 float vx; ///< X velocity in NED frame in meter / s
12 float vy; ///< Y velocity in NED frame in meter / s
13 float vz; ///< Z velocity in NED frame in meter / s
14 float afx; ///< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
15 float afy; ///< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
16 float afz; ///< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
17 float yaw; ///< yaw setpoint in rad
18 float yaw_rate; ///< yaw rate setpoint in rad/s
19 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
20 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
21 } mavlink_position_target_global_int_t;
23 #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN 51
24 #define MAVLINK_MSG_ID_87_LEN 51
26 #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC 150
27 #define MAVLINK_MSG_ID_87_CRC 150
31 #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \
32 "POSITION_TARGET_GLOBAL_INT", \
33 14, \
34 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \
35 { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \
36 { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \
37 { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \
38 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) }, \
39 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) }, \
40 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) }, \
41 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) }, \
42 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) }, \
43 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \
44 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \
45 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \
46 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \
47 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \
48 } \
52 /**
53 * @brief Pack a position_target_global_int message
54 * @param system_id ID of this system
55 * @param component_id ID of this component (e.g. 200 for IMU)
56 * @param msg The MAVLink message to compress the data into
58 * @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.
59 * @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
60 * @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
61 * @param lat_int X Position in WGS84 frame in 1e7 * meters
62 * @param lon_int Y Position in WGS84 frame in 1e7 * meters
63 * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
64 * @param vx X velocity in NED frame in meter / s
65 * @param vy Y velocity in NED frame in meter / s
66 * @param vz Z velocity in NED frame in meter / s
67 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
68 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
69 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
70 * @param yaw yaw setpoint in rad
71 * @param yaw_rate yaw rate setpoint in rad/s
72 * @return length of the message in bytes (excluding serial stream start sign)
74 static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
75 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)
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
78 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
79 _mav_put_uint32_t(buf, 0, time_boot_ms);
80 _mav_put_int32_t(buf, 4, lat_int);
81 _mav_put_int32_t(buf, 8, lon_int);
82 _mav_put_float(buf, 12, alt);
83 _mav_put_float(buf, 16, vx);
84 _mav_put_float(buf, 20, vy);
85 _mav_put_float(buf, 24, vz);
86 _mav_put_float(buf, 28, afx);
87 _mav_put_float(buf, 32, afy);
88 _mav_put_float(buf, 36, afz);
89 _mav_put_float(buf, 40, yaw);
90 _mav_put_float(buf, 44, yaw_rate);
91 _mav_put_uint16_t(buf, 48, type_mask);
92 _mav_put_uint8_t(buf, 50, coordinate_frame);
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
95 #else
96 mavlink_position_target_global_int_t packet;
97 packet.time_boot_ms = time_boot_ms;
98 packet.lat_int = lat_int;
99 packet.lon_int = lon_int;
100 packet.alt = alt;
101 packet.vx = vx;
102 packet.vy = vy;
103 packet.vz = vz;
104 packet.afx = afx;
105 packet.afy = afy;
106 packet.afz = afz;
107 packet.yaw = yaw;
108 packet.yaw_rate = yaw_rate;
109 packet.type_mask = type_mask;
110 packet.coordinate_frame = coordinate_frame;
112 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
113 #endif
115 msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
116 #if MAVLINK_CRC_EXTRA
117 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
118 #else
119 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
120 #endif
124 * @brief Pack a position_target_global_int message on a channel
125 * @param system_id ID of this system
126 * @param component_id ID of this component (e.g. 200 for IMU)
127 * @param chan The MAVLink channel this message will be sent over
128 * @param msg The MAVLink message to compress the data into
129 * @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.
130 * @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
131 * @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
132 * @param lat_int X Position in WGS84 frame in 1e7 * meters
133 * @param lon_int Y Position in WGS84 frame in 1e7 * meters
134 * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
135 * @param vx X velocity in NED frame in meter / s
136 * @param vy Y velocity in NED frame in meter / s
137 * @param vz Z velocity in NED frame in meter / s
138 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
139 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
140 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
141 * @param yaw yaw setpoint in rad
142 * @param yaw_rate yaw rate setpoint in rad/s
143 * @return length of the message in bytes (excluding serial stream start sign)
145 static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146 mavlink_message_t* msg,
147 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)
149 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
150 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
151 _mav_put_uint32_t(buf, 0, time_boot_ms);
152 _mav_put_int32_t(buf, 4, lat_int);
153 _mav_put_int32_t(buf, 8, lon_int);
154 _mav_put_float(buf, 12, alt);
155 _mav_put_float(buf, 16, vx);
156 _mav_put_float(buf, 20, vy);
157 _mav_put_float(buf, 24, vz);
158 _mav_put_float(buf, 28, afx);
159 _mav_put_float(buf, 32, afy);
160 _mav_put_float(buf, 36, afz);
161 _mav_put_float(buf, 40, yaw);
162 _mav_put_float(buf, 44, yaw_rate);
163 _mav_put_uint16_t(buf, 48, type_mask);
164 _mav_put_uint8_t(buf, 50, coordinate_frame);
166 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
167 #else
168 mavlink_position_target_global_int_t packet;
169 packet.time_boot_ms = time_boot_ms;
170 packet.lat_int = lat_int;
171 packet.lon_int = lon_int;
172 packet.alt = alt;
173 packet.vx = vx;
174 packet.vy = vy;
175 packet.vz = vz;
176 packet.afx = afx;
177 packet.afy = afy;
178 packet.afz = afz;
179 packet.yaw = yaw;
180 packet.yaw_rate = yaw_rate;
181 packet.type_mask = type_mask;
182 packet.coordinate_frame = coordinate_frame;
184 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
185 #endif
187 msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
188 #if MAVLINK_CRC_EXTRA
189 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
190 #else
191 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
192 #endif
196 * @brief Encode a position_target_global_int struct
198 * @param system_id ID of this system
199 * @param component_id ID of this component (e.g. 200 for IMU)
200 * @param msg The MAVLink message to compress the data into
201 * @param position_target_global_int C-struct to read the message contents from
203 static 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)
205 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);
209 * @brief Encode a position_target_global_int struct on a channel
211 * @param system_id ID of this system
212 * @param component_id ID of this component (e.g. 200 for IMU)
213 * @param chan The MAVLink channel this message will be sent over
214 * @param msg The MAVLink message to compress the data into
215 * @param position_target_global_int C-struct to read the message contents from
217 static 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)
219 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);
223 * @brief Send a position_target_global_int message
224 * @param chan MAVLink channel to send the message
226 * @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.
227 * @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
228 * @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
229 * @param lat_int X Position in WGS84 frame in 1e7 * meters
230 * @param lon_int Y Position in WGS84 frame in 1e7 * meters
231 * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
232 * @param vx X velocity in NED frame in meter / s
233 * @param vy Y velocity in NED frame in meter / s
234 * @param vz Z velocity in NED frame in meter / s
235 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
236 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
237 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
238 * @param yaw yaw setpoint in rad
239 * @param yaw_rate yaw rate setpoint in rad/s
241 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
243 static 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)
245 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
246 char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
247 _mav_put_uint32_t(buf, 0, time_boot_ms);
248 _mav_put_int32_t(buf, 4, lat_int);
249 _mav_put_int32_t(buf, 8, lon_int);
250 _mav_put_float(buf, 12, alt);
251 _mav_put_float(buf, 16, vx);
252 _mav_put_float(buf, 20, vy);
253 _mav_put_float(buf, 24, vz);
254 _mav_put_float(buf, 28, afx);
255 _mav_put_float(buf, 32, afy);
256 _mav_put_float(buf, 36, afz);
257 _mav_put_float(buf, 40, yaw);
258 _mav_put_float(buf, 44, yaw_rate);
259 _mav_put_uint16_t(buf, 48, type_mask);
260 _mav_put_uint8_t(buf, 50, coordinate_frame);
262 #if MAVLINK_CRC_EXTRA
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
264 #else
265 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
266 #endif
267 #else
268 mavlink_position_target_global_int_t packet;
269 packet.time_boot_ms = time_boot_ms;
270 packet.lat_int = lat_int;
271 packet.lon_int = lon_int;
272 packet.alt = alt;
273 packet.vx = vx;
274 packet.vy = vy;
275 packet.vz = vz;
276 packet.afx = afx;
277 packet.afy = afy;
278 packet.afz = afz;
279 packet.yaw = yaw;
280 packet.yaw_rate = yaw_rate;
281 packet.type_mask = type_mask;
282 packet.coordinate_frame = coordinate_frame;
284 #if MAVLINK_CRC_EXTRA
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
286 #else
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
288 #endif
289 #endif
292 #if MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
294 This varient of _send() can be used to save stack space by re-using
295 memory from the receive buffer. The caller provides a
296 mavlink_message_t which is the size of a full mavlink message. This
297 is usually the receive buffer for the channel, and allows a reply to an
298 incoming message with minimum stack space usage.
300 static 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)
302 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
303 char *buf = (char *)msgbuf;
304 _mav_put_uint32_t(buf, 0, time_boot_ms);
305 _mav_put_int32_t(buf, 4, lat_int);
306 _mav_put_int32_t(buf, 8, lon_int);
307 _mav_put_float(buf, 12, alt);
308 _mav_put_float(buf, 16, vx);
309 _mav_put_float(buf, 20, vy);
310 _mav_put_float(buf, 24, vz);
311 _mav_put_float(buf, 28, afx);
312 _mav_put_float(buf, 32, afy);
313 _mav_put_float(buf, 36, afz);
314 _mav_put_float(buf, 40, yaw);
315 _mav_put_float(buf, 44, yaw_rate);
316 _mav_put_uint16_t(buf, 48, type_mask);
317 _mav_put_uint8_t(buf, 50, coordinate_frame);
319 #if MAVLINK_CRC_EXTRA
320 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
321 #else
322 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
323 #endif
324 #else
325 mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf;
326 packet->time_boot_ms = time_boot_ms;
327 packet->lat_int = lat_int;
328 packet->lon_int = lon_int;
329 packet->alt = alt;
330 packet->vx = vx;
331 packet->vy = vy;
332 packet->vz = vz;
333 packet->afx = afx;
334 packet->afy = afy;
335 packet->afz = afz;
336 packet->yaw = yaw;
337 packet->yaw_rate = yaw_rate;
338 packet->type_mask = type_mask;
339 packet->coordinate_frame = coordinate_frame;
341 #if MAVLINK_CRC_EXTRA
342 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
343 #else
344 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
345 #endif
346 #endif
348 #endif
350 #endif
352 // MESSAGE POSITION_TARGET_GLOBAL_INT UNPACKING
356 * @brief Get field time_boot_ms from position_target_global_int message
358 * @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.
360 static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg)
362 return _MAV_RETURN_uint32_t(msg, 0);
366 * @brief Get field coordinate_frame from position_target_global_int message
368 * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
370 static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg)
372 return _MAV_RETURN_uint8_t(msg, 50);
376 * @brief Get field type_mask from position_target_global_int message
378 * @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
380 static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg)
382 return _MAV_RETURN_uint16_t(msg, 48);
386 * @brief Get field lat_int from position_target_global_int message
388 * @return X Position in WGS84 frame in 1e7 * meters
390 static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg)
392 return _MAV_RETURN_int32_t(msg, 4);
396 * @brief Get field lon_int from position_target_global_int message
398 * @return Y Position in WGS84 frame in 1e7 * meters
400 static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg)
402 return _MAV_RETURN_int32_t(msg, 8);
406 * @brief Get field alt from position_target_global_int message
408 * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
410 static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg)
412 return _MAV_RETURN_float(msg, 12);
416 * @brief Get field vx from position_target_global_int message
418 * @return X velocity in NED frame in meter / s
420 static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg)
422 return _MAV_RETURN_float(msg, 16);
426 * @brief Get field vy from position_target_global_int message
428 * @return Y velocity in NED frame in meter / s
430 static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg)
432 return _MAV_RETURN_float(msg, 20);
436 * @brief Get field vz from position_target_global_int message
438 * @return Z velocity in NED frame in meter / s
440 static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg)
442 return _MAV_RETURN_float(msg, 24);
446 * @brief Get field afx from position_target_global_int message
448 * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
450 static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg)
452 return _MAV_RETURN_float(msg, 28);
456 * @brief Get field afy from position_target_global_int message
458 * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
460 static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg)
462 return _MAV_RETURN_float(msg, 32);
466 * @brief Get field afz from position_target_global_int message
468 * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
470 static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg)
472 return _MAV_RETURN_float(msg, 36);
476 * @brief Get field yaw from position_target_global_int message
478 * @return yaw setpoint in rad
480 static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg)
482 return _MAV_RETURN_float(msg, 40);
486 * @brief Get field yaw_rate from position_target_global_int message
488 * @return yaw rate setpoint in rad/s
490 static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg)
492 return _MAV_RETURN_float(msg, 44);
496 * @brief Decode a position_target_global_int message into a struct
498 * @param msg The message to decode
499 * @param position_target_global_int C-struct to decode the message contents into
501 static inline void mavlink_msg_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_position_target_global_int_t* position_target_global_int)
503 #if MAVLINK_NEED_BYTE_SWAP
504 position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg);
505 position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg);
506 position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg);
507 position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg);
508 position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg);
509 position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg);
510 position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg);
511 position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg);
512 position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg);
513 position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg);
514 position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg);
515 position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg);
516 position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg);
517 position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg);
518 #else
519 memcpy(position_target_global_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
520 #endif