2 // MESSAGE SET_POSITION_TARGET_GLOBAL_INT PACKING
4 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT 86
7 typedef struct __mavlink_set_position_target_global_int_t
{
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] X Position in WGS84 frame*/
10 int32_t lon_int
; /*< [degE7] Y Position 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_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/
24 } mavlink_set_position_target_global_int_t
;
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
31 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_CRC 5
32 #define MAVLINK_MSG_ID_86_CRC 5
36 #if MAVLINK_COMMAND_24BIT
37 #define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT { \
39 "SET_POSITION_TARGET_GLOBAL_INT", \
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) }, \
60 #define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_GLOBAL_INT { \
61 "SET_POSITION_TARGET_GLOBAL_INT", \
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) }, \
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
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_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
93 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
94 * @param lat_int [degE7] X Position in WGS84 frame
95 * @param lon_int [degE7] Y Position 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)
107 static 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
)
110 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
111 char buf
[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
];
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
);
129 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
);
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
;
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
;
149 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
);
152 msg
->msgid
= MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT
;
153 return mavlink_finalize_message(msg
, system_id
, component_id
, 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
);
157 * @brief Pack a set_position_target_global_int message on a channel
158 * @param system_id ID of this system
159 * @param component_id ID of this component (e.g. 200 for IMU)
160 * @param chan The MAVLink channel this message will be sent over
161 * @param msg The MAVLink message to compress the data into
162 * @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.
163 * @param target_system System ID
164 * @param target_component Component ID
165 * @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
166 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
167 * @param lat_int [degE7] X Position in WGS84 frame
168 * @param lon_int [degE7] Y Position in WGS84 frame
169 * @param alt [m] Altitude (MSL, Relative to home, or AGL - depending on frame)
170 * @param vx [m/s] X velocity in NED frame
171 * @param vy [m/s] Y velocity in NED frame
172 * @param vz [m/s] Z velocity in NED frame
173 * @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
174 * @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
175 * @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
176 * @param yaw [rad] yaw setpoint
177 * @param yaw_rate [rad/s] yaw rate setpoint
178 * @return length of the message in bytes (excluding serial stream start sign)
180 static inline uint16_t mavlink_msg_set_position_target_global_int_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
181 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
)
184 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
185 char buf
[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
];
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
);
203 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
);
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
;
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
;
223 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
);
226 msg
->msgid
= MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT
;
227 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, 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
);
231 * @brief Encode a set_position_target_global_int struct
233 * @param system_id ID of this system
234 * @param component_id ID of this component (e.g. 200 for IMU)
235 * @param msg The MAVLink message to compress the data into
236 * @param set_position_target_global_int C-struct to read the message contents from
238 static 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
)
240 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
);
244 * @brief Encode a set_position_target_global_int struct on a channel
246 * @param system_id ID of this system
247 * @param component_id ID of this component (e.g. 200 for IMU)
248 * @param chan The MAVLink channel this message will be sent over
249 * @param msg The MAVLink message to compress the data into
250 * @param set_position_target_global_int C-struct to read the message contents from
252 static 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
)
254 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
);
258 * @brief Send a set_position_target_global_int message
259 * @param chan MAVLink channel to send the message
261 * @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.
262 * @param target_system System ID
263 * @param target_component Component ID
264 * @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
265 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
266 * @param lat_int [degE7] X Position in WGS84 frame
267 * @param lon_int [degE7] Y Position in WGS84 frame
268 * @param alt [m] Altitude (MSL, Relative to home, or AGL - depending on frame)
269 * @param vx [m/s] X velocity in NED frame
270 * @param vy [m/s] Y velocity in NED frame
271 * @param vz [m/s] Z velocity in NED frame
272 * @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
273 * @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
274 * @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
275 * @param yaw [rad] yaw setpoint
276 * @param yaw_rate [rad/s] yaw rate setpoint
278 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
280 static 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
)
282 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
283 char buf
[MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
];
284 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
285 _mav_put_int32_t(buf
, 4, lat_int
);
286 _mav_put_int32_t(buf
, 8, lon_int
);
287 _mav_put_float(buf
, 12, alt
);
288 _mav_put_float(buf
, 16, vx
);
289 _mav_put_float(buf
, 20, vy
);
290 _mav_put_float(buf
, 24, vz
);
291 _mav_put_float(buf
, 28, afx
);
292 _mav_put_float(buf
, 32, afy
);
293 _mav_put_float(buf
, 36, afz
);
294 _mav_put_float(buf
, 40, yaw
);
295 _mav_put_float(buf
, 44, yaw_rate
);
296 _mav_put_uint16_t(buf
, 48, type_mask
);
297 _mav_put_uint8_t(buf
, 50, target_system
);
298 _mav_put_uint8_t(buf
, 51, target_component
);
299 _mav_put_uint8_t(buf
, 52, coordinate_frame
);
301 _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
);
303 mavlink_set_position_target_global_int_t packet
;
304 packet
.time_boot_ms
= time_boot_ms
;
305 packet
.lat_int
= lat_int
;
306 packet
.lon_int
= lon_int
;
315 packet
.yaw_rate
= yaw_rate
;
316 packet
.type_mask
= type_mask
;
317 packet
.target_system
= target_system
;
318 packet
.target_component
= target_component
;
319 packet
.coordinate_frame
= coordinate_frame
;
321 _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
);
326 * @brief Send a set_position_target_global_int message
327 * @param chan MAVLink channel to send the message
328 * @param struct The MAVLink struct to serialize
330 static 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
)
332 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
333 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
);
335 _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
);
339 #if MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
341 This varient of _send() can be used to save stack space by re-using
342 memory from the receive buffer. The caller provides a
343 mavlink_message_t which is the size of a full mavlink message. This
344 is usually the receive buffer for the channel, and allows a reply to an
345 incoming message with minimum stack space usage.
347 static 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
)
349 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
350 char *buf
= (char *)msgbuf
;
351 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
352 _mav_put_int32_t(buf
, 4, lat_int
);
353 _mav_put_int32_t(buf
, 8, lon_int
);
354 _mav_put_float(buf
, 12, alt
);
355 _mav_put_float(buf
, 16, vx
);
356 _mav_put_float(buf
, 20, vy
);
357 _mav_put_float(buf
, 24, vz
);
358 _mav_put_float(buf
, 28, afx
);
359 _mav_put_float(buf
, 32, afy
);
360 _mav_put_float(buf
, 36, afz
);
361 _mav_put_float(buf
, 40, yaw
);
362 _mav_put_float(buf
, 44, yaw_rate
);
363 _mav_put_uint16_t(buf
, 48, type_mask
);
364 _mav_put_uint8_t(buf
, 50, target_system
);
365 _mav_put_uint8_t(buf
, 51, target_component
);
366 _mav_put_uint8_t(buf
, 52, coordinate_frame
);
368 _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
);
370 mavlink_set_position_target_global_int_t
*packet
= (mavlink_set_position_target_global_int_t
*)msgbuf
;
371 packet
->time_boot_ms
= time_boot_ms
;
372 packet
->lat_int
= lat_int
;
373 packet
->lon_int
= lon_int
;
382 packet
->yaw_rate
= yaw_rate
;
383 packet
->type_mask
= type_mask
;
384 packet
->target_system
= target_system
;
385 packet
->target_component
= target_component
;
386 packet
->coordinate_frame
= coordinate_frame
;
388 _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
);
395 // MESSAGE SET_POSITION_TARGET_GLOBAL_INT UNPACKING
399 * @brief Get field time_boot_ms from set_position_target_global_int message
401 * @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.
403 static inline uint32_t mavlink_msg_set_position_target_global_int_get_time_boot_ms(const mavlink_message_t
* msg
)
405 return _MAV_RETURN_uint32_t(msg
, 0);
409 * @brief Get field target_system from set_position_target_global_int message
413 static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_system(const mavlink_message_t
* msg
)
415 return _MAV_RETURN_uint8_t(msg
, 50);
419 * @brief Get field target_component from set_position_target_global_int message
421 * @return Component ID
423 static inline uint8_t mavlink_msg_set_position_target_global_int_get_target_component(const mavlink_message_t
* msg
)
425 return _MAV_RETURN_uint8_t(msg
, 51);
429 * @brief Get field coordinate_frame from set_position_target_global_int message
431 * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
433 static inline uint8_t mavlink_msg_set_position_target_global_int_get_coordinate_frame(const mavlink_message_t
* msg
)
435 return _MAV_RETURN_uint8_t(msg
, 52);
439 * @brief Get field type_mask from set_position_target_global_int message
441 * @return Bitmap to indicate which dimensions should be ignored by the vehicle.
443 static inline uint16_t mavlink_msg_set_position_target_global_int_get_type_mask(const mavlink_message_t
* msg
)
445 return _MAV_RETURN_uint16_t(msg
, 48);
449 * @brief Get field lat_int from set_position_target_global_int message
451 * @return [degE7] X Position in WGS84 frame
453 static inline int32_t mavlink_msg_set_position_target_global_int_get_lat_int(const mavlink_message_t
* msg
)
455 return _MAV_RETURN_int32_t(msg
, 4);
459 * @brief Get field lon_int from set_position_target_global_int message
461 * @return [degE7] Y Position in WGS84 frame
463 static inline int32_t mavlink_msg_set_position_target_global_int_get_lon_int(const mavlink_message_t
* msg
)
465 return _MAV_RETURN_int32_t(msg
, 8);
469 * @brief Get field alt from set_position_target_global_int message
471 * @return [m] Altitude (MSL, Relative to home, or AGL - depending on frame)
473 static inline float mavlink_msg_set_position_target_global_int_get_alt(const mavlink_message_t
* msg
)
475 return _MAV_RETURN_float(msg
, 12);
479 * @brief Get field vx from set_position_target_global_int message
481 * @return [m/s] X velocity in NED frame
483 static inline float mavlink_msg_set_position_target_global_int_get_vx(const mavlink_message_t
* msg
)
485 return _MAV_RETURN_float(msg
, 16);
489 * @brief Get field vy from set_position_target_global_int message
491 * @return [m/s] Y velocity in NED frame
493 static inline float mavlink_msg_set_position_target_global_int_get_vy(const mavlink_message_t
* msg
)
495 return _MAV_RETURN_float(msg
, 20);
499 * @brief Get field vz from set_position_target_global_int message
501 * @return [m/s] Z velocity in NED frame
503 static inline float mavlink_msg_set_position_target_global_int_get_vz(const mavlink_message_t
* msg
)
505 return _MAV_RETURN_float(msg
, 24);
509 * @brief Get field afx from set_position_target_global_int message
511 * @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
513 static inline float mavlink_msg_set_position_target_global_int_get_afx(const mavlink_message_t
* msg
)
515 return _MAV_RETURN_float(msg
, 28);
519 * @brief Get field afy from set_position_target_global_int message
521 * @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
523 static inline float mavlink_msg_set_position_target_global_int_get_afy(const mavlink_message_t
* msg
)
525 return _MAV_RETURN_float(msg
, 32);
529 * @brief Get field afz from set_position_target_global_int message
531 * @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
533 static inline float mavlink_msg_set_position_target_global_int_get_afz(const mavlink_message_t
* msg
)
535 return _MAV_RETURN_float(msg
, 36);
539 * @brief Get field yaw from set_position_target_global_int message
541 * @return [rad] yaw setpoint
543 static inline float mavlink_msg_set_position_target_global_int_get_yaw(const mavlink_message_t
* msg
)
545 return _MAV_RETURN_float(msg
, 40);
549 * @brief Get field yaw_rate from set_position_target_global_int message
551 * @return [rad/s] yaw rate setpoint
553 static inline float mavlink_msg_set_position_target_global_int_get_yaw_rate(const mavlink_message_t
* msg
)
555 return _MAV_RETURN_float(msg
, 44);
559 * @brief Decode a set_position_target_global_int message into a struct
561 * @param msg The message to decode
562 * @param set_position_target_global_int C-struct to decode the message contents into
564 static 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
)
566 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
567 set_position_target_global_int
->time_boot_ms
= mavlink_msg_set_position_target_global_int_get_time_boot_ms(msg
);
568 set_position_target_global_int
->lat_int
= mavlink_msg_set_position_target_global_int_get_lat_int(msg
);
569 set_position_target_global_int
->lon_int
= mavlink_msg_set_position_target_global_int_get_lon_int(msg
);
570 set_position_target_global_int
->alt
= mavlink_msg_set_position_target_global_int_get_alt(msg
);
571 set_position_target_global_int
->vx
= mavlink_msg_set_position_target_global_int_get_vx(msg
);
572 set_position_target_global_int
->vy
= mavlink_msg_set_position_target_global_int_get_vy(msg
);
573 set_position_target_global_int
->vz
= mavlink_msg_set_position_target_global_int_get_vz(msg
);
574 set_position_target_global_int
->afx
= mavlink_msg_set_position_target_global_int_get_afx(msg
);
575 set_position_target_global_int
->afy
= mavlink_msg_set_position_target_global_int_get_afy(msg
);
576 set_position_target_global_int
->afz
= mavlink_msg_set_position_target_global_int_get_afz(msg
);
577 set_position_target_global_int
->yaw
= mavlink_msg_set_position_target_global_int_get_yaw(msg
);
578 set_position_target_global_int
->yaw_rate
= mavlink_msg_set_position_target_global_int_get_yaw_rate(msg
);
579 set_position_target_global_int
->type_mask
= mavlink_msg_set_position_target_global_int_get_type_mask(msg
);
580 set_position_target_global_int
->target_system
= mavlink_msg_set_position_target_global_int_get_target_system(msg
);
581 set_position_target_global_int
->target_component
= mavlink_msg_set_position_target_global_int_get_target_component(msg
);
582 set_position_target_global_int
->coordinate_frame
= mavlink_msg_set_position_target_global_int_get_coordinate_frame(msg
);
584 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
;
585 memset(set_position_target_global_int
, 0, MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_LEN
);
586 memcpy(set_position_target_global_int
, _MAV_PAYLOAD(msg
), len
);