RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_set_position_target_local_ned.h
1#pragma once
2// MESSAGE SET_POSITION_TARGET_LOCAL_NED PACKING
3
4#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED 84
5
6MAVPACKED(
7typedef struct __mavlink_set_position_target_local_ned_t {
8 uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot*/
9 float x; /*< X Position in NED frame in meters*/
10 float y; /*< Y Position in NED frame in meters*/
11 float z; /*< Z Position in NED frame in meters (note, altitude is negative in NED)*/
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 target_system; /*< System ID*/
22 uint8_t target_component; /*< Component ID*/
23 uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9*/
24}) mavlink_set_position_target_local_ned_t;
25
26#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN 53
27#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN 53
28#define MAVLINK_MSG_ID_84_LEN 53
29#define MAVLINK_MSG_ID_84_MIN_LEN 53
30
31#define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC 143
32#define MAVLINK_MSG_ID_84_CRC 143
33
34
35
36#if MAVLINK_COMMAND_24BIT
37#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \
38 84, \
39 "SET_POSITION_TARGET_LOCAL_NED", \
40 16, \
41 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \
42 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \
43 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \
44 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \
45 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \
46 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \
47 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \
48 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \
49 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_local_ned_t, vx) }, \
50 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_local_ned_t, vy) }, \
51 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_local_ned_t, vz) }, \
52 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_local_ned_t, afx) }, \
53 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_local_ned_t, afy) }, \
54 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \
55 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \
56 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \
57 } \
58}
59#else
60#define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \
61 "SET_POSITION_TARGET_LOCAL_NED", \
62 16, \
63 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \
64 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \
65 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \
66 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \
67 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \
68 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \
69 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \
70 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \
71 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_local_ned_t, vx) }, \
72 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_local_ned_t, vy) }, \
73 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_local_ned_t, vz) }, \
74 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_local_ned_t, afx) }, \
75 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_local_ned_t, afy) }, \
76 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \
77 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \
78 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \
79 } \
80}
81#endif
82
83/**
84 * @brief Pack a set_position_target_local_ned 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 Timestamp in milliseconds since system boot
90 * @param target_system System ID
91 * @param target_component Component ID
92 * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
93 * @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
94 * @param x X Position in NED frame in meters
95 * @param y Y Position in NED frame in meters
96 * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
97 * @param vx X velocity in NED frame in meter / s
98 * @param vy Y velocity in NED frame in meter / s
99 * @param vz Z velocity in NED frame in meter / s
100 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
101 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
102 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
103 * @param yaw yaw setpoint in rad
104 * @param yaw_rate yaw rate setpoint in rad/s
105 * @return length of the message in bytes (excluding serial stream start sign)
106 */
107static inline uint16_t mavlink_msg_set_position_target_local_ned_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, float x, float y, float z, 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
111 char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
112 _mav_put_uint32_t(buf, 0, time_boot_ms);
113 _mav_put_float(buf, 4, x);
114 _mav_put_float(buf, 8, y);
115 _mav_put_float(buf, 12, z);
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_LOCAL_NED_LEN);
130#else
131 mavlink_set_position_target_local_ned_t packet;
132 packet.time_boot_ms = time_boot_ms;
133 packet.x = x;
134 packet.y = y;
135 packet.z = z;
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_LOCAL_NED_LEN);
150#endif
151
152 msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED;
153 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
154}
155
156/**
157 * @brief Pack a set_position_target_local_ned 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 Timestamp in milliseconds since system boot
163 * @param target_system System ID
164 * @param target_component Component ID
165 * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
166 * @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
167 * @param x X Position in NED frame in meters
168 * @param y Y Position in NED frame in meters
169 * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
170 * @param vx X velocity in NED frame in meter / s
171 * @param vy Y velocity in NED frame in meter / s
172 * @param vz Z velocity in NED frame in meter / s
173 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
174 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
175 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
176 * @param yaw yaw setpoint in rad
177 * @param yaw_rate yaw rate setpoint in rad/s
178 * @return length of the message in bytes (excluding serial stream start sign)
179 */
180static inline uint16_t mavlink_msg_set_position_target_local_ned_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,float x,float y,float z,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
185 char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
186 _mav_put_uint32_t(buf, 0, time_boot_ms);
187 _mav_put_float(buf, 4, x);
188 _mav_put_float(buf, 8, y);
189 _mav_put_float(buf, 12, z);
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_LOCAL_NED_LEN);
204#else
205 mavlink_set_position_target_local_ned_t packet;
206 packet.time_boot_ms = time_boot_ms;
207 packet.x = x;
208 packet.y = y;
209 packet.z = z;
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_LOCAL_NED_LEN);
224#endif
225
226 msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED;
227 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
228}
229
230/**
231 * @brief Encode a set_position_target_local_ned struct
232 *
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_local_ned C-struct to read the message contents from
237 */
238static inline uint16_t mavlink_msg_set_position_target_local_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
239{
240 return mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate);
241}
242
243/**
244 * @brief Encode a set_position_target_local_ned struct on a channel
245 *
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_local_ned C-struct to read the message contents from
251 */
252static inline uint16_t mavlink_msg_set_position_target_local_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
253{
254 return mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate);
255}
256
257/**
258 * @brief Send a set_position_target_local_ned message
259 * @param chan MAVLink channel to send the message
260 *
261 * @param time_boot_ms Timestamp in milliseconds since system boot
262 * @param target_system System ID
263 * @param target_component Component ID
264 * @param coordinate_frame Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
265 * @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
266 * @param x X Position in NED frame in meters
267 * @param y Y Position in NED frame in meters
268 * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
269 * @param vx X velocity in NED frame in meter / s
270 * @param vy Y velocity in NED frame in meter / s
271 * @param vz Z velocity in NED frame in meter / s
272 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
273 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
274 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
275 * @param yaw yaw setpoint in rad
276 * @param yaw_rate yaw rate setpoint in rad/s
277 */
278#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
279
280static inline void mavlink_msg_set_position_target_local_ned_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, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
281{
282#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
283 char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
284 _mav_put_uint32_t(buf, 0, time_boot_ms);
285 _mav_put_float(buf, 4, x);
286 _mav_put_float(buf, 8, y);
287 _mav_put_float(buf, 12, z);
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);
300
301 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
302#else
303 mavlink_set_position_target_local_ned_t packet;
304 packet.time_boot_ms = time_boot_ms;
305 packet.x = x;
306 packet.y = y;
307 packet.z = z;
308 packet.vx = vx;
309 packet.vy = vy;
310 packet.vz = vz;
311 packet.afx = afx;
312 packet.afy = afy;
313 packet.afz = afz;
314 packet.yaw = yaw;
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;
320
321 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
322#endif
323}
324
325/**
326 * @brief Send a set_position_target_local_ned message
327 * @param chan MAVLink channel to send the message
328 * @param struct The MAVLink struct to serialize
329 */
330static inline void mavlink_msg_set_position_target_local_ned_send_struct(mavlink_channel_t chan, const mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
331{
332#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
333 mavlink_msg_set_position_target_local_ned_send(chan, set_position_target_local_ned->time_boot_ms, set_position_target_local_ned->target_system, set_position_target_local_ned->target_component, set_position_target_local_ned->coordinate_frame, set_position_target_local_ned->type_mask, set_position_target_local_ned->x, set_position_target_local_ned->y, set_position_target_local_ned->z, set_position_target_local_ned->vx, set_position_target_local_ned->vy, set_position_target_local_ned->vz, set_position_target_local_ned->afx, set_position_target_local_ned->afy, set_position_target_local_ned->afz, set_position_target_local_ned->yaw, set_position_target_local_ned->yaw_rate);
334#else
335 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)set_position_target_local_ned, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
336#endif
337}
338
339#if MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
340/*
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.
346 */
347static inline void mavlink_msg_set_position_target_local_ned_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, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
348{
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_float(buf, 4, x);
353 _mav_put_float(buf, 8, y);
354 _mav_put_float(buf, 12, z);
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);
367
368 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
369#else
370 mavlink_set_position_target_local_ned_t *packet = (mavlink_set_position_target_local_ned_t *)msgbuf;
371 packet->time_boot_ms = time_boot_ms;
372 packet->x = x;
373 packet->y = y;
374 packet->z = z;
375 packet->vx = vx;
376 packet->vy = vy;
377 packet->vz = vz;
378 packet->afx = afx;
379 packet->afy = afy;
380 packet->afz = afz;
381 packet->yaw = yaw;
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;
387
388 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
389#endif
390}
391#endif
392
393#endif
394
395// MESSAGE SET_POSITION_TARGET_LOCAL_NED UNPACKING
396
397
398/**
399 * @brief Get field time_boot_ms from set_position_target_local_ned message
400 *
401 * @return Timestamp in milliseconds since system boot
402 */
403static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg)
404{
405 return _MAV_RETURN_uint32_t(msg, 0);
406}
407
408/**
409 * @brief Get field target_system from set_position_target_local_ned message
410 *
411 * @return System ID
412 */
413static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_system(const mavlink_message_t* msg)
414{
415 return _MAV_RETURN_uint8_t(msg, 50);
416}
417
418/**
419 * @brief Get field target_component from set_position_target_local_ned message
420 *
421 * @return Component ID
422 */
423static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_component(const mavlink_message_t* msg)
424{
425 return _MAV_RETURN_uint8_t(msg, 51);
426}
427
428/**
429 * @brief Get field coordinate_frame from set_position_target_local_ned message
430 *
431 * @return Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9
432 */
433static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg)
434{
435 return _MAV_RETURN_uint8_t(msg, 52);
436}
437
438/**
439 * @brief Get field type_mask from set_position_target_local_ned message
440 *
441 * @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
442 */
443static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(const mavlink_message_t* msg)
444{
445 return _MAV_RETURN_uint16_t(msg, 48);
446}
447
448/**
449 * @brief Get field x from set_position_target_local_ned message
450 *
451 * @return X Position in NED frame in meters
452 */
453static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlink_message_t* msg)
454{
455 return _MAV_RETURN_float(msg, 4);
456}
457
458/**
459 * @brief Get field y from set_position_target_local_ned message
460 *
461 * @return Y Position in NED frame in meters
462 */
463static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlink_message_t* msg)
464{
465 return _MAV_RETURN_float(msg, 8);
466}
467
468/**
469 * @brief Get field z from set_position_target_local_ned message
470 *
471 * @return Z Position in NED frame in meters (note, altitude is negative in NED)
472 */
473static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlink_message_t* msg)
474{
475 return _MAV_RETURN_float(msg, 12);
476}
477
478/**
479 * @brief Get field vx from set_position_target_local_ned message
480 *
481 * @return X velocity in NED frame in meter / s
482 */
483static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavlink_message_t* msg)
484{
485 return _MAV_RETURN_float(msg, 16);
486}
487
488/**
489 * @brief Get field vy from set_position_target_local_ned message
490 *
491 * @return Y velocity in NED frame in meter / s
492 */
493static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavlink_message_t* msg)
494{
495 return _MAV_RETURN_float(msg, 20);
496}
497
498/**
499 * @brief Get field vz from set_position_target_local_ned message
500 *
501 * @return Z velocity in NED frame in meter / s
502 */
503static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavlink_message_t* msg)
504{
505 return _MAV_RETURN_float(msg, 24);
506}
507
508/**
509 * @brief Get field afx from set_position_target_local_ned message
510 *
511 * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
512 */
513static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavlink_message_t* msg)
514{
515 return _MAV_RETURN_float(msg, 28);
516}
517
518/**
519 * @brief Get field afy from set_position_target_local_ned message
520 *
521 * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
522 */
523static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavlink_message_t* msg)
524{
525 return _MAV_RETURN_float(msg, 32);
526}
527
528/**
529 * @brief Get field afz from set_position_target_local_ned message
530 *
531 * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
532 */
533static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavlink_message_t* msg)
534{
535 return _MAV_RETURN_float(msg, 36);
536}
537
538/**
539 * @brief Get field yaw from set_position_target_local_ned message
540 *
541 * @return yaw setpoint in rad
542 */
543static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavlink_message_t* msg)
544{
545 return _MAV_RETURN_float(msg, 40);
546}
547
548/**
549 * @brief Get field yaw_rate from set_position_target_local_ned message
550 *
551 * @return yaw rate setpoint in rad/s
552 */
553static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg)
554{
555 return _MAV_RETURN_float(msg, 44);
556}
557
558/**
559 * @brief Decode a set_position_target_local_ned message into a struct
560 *
561 * @param msg The message to decode
562 * @param set_position_target_local_ned C-struct to decode the message contents into
563 */
564static inline void mavlink_msg_set_position_target_local_ned_decode(const mavlink_message_t* msg, mavlink_set_position_target_local_ned_t* set_position_target_local_ned)
565{
566#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
567 set_position_target_local_ned->time_boot_ms = mavlink_msg_set_position_target_local_ned_get_time_boot_ms(msg);
568 set_position_target_local_ned->x = mavlink_msg_set_position_target_local_ned_get_x(msg);
569 set_position_target_local_ned->y = mavlink_msg_set_position_target_local_ned_get_y(msg);
570 set_position_target_local_ned->z = mavlink_msg_set_position_target_local_ned_get_z(msg);
571 set_position_target_local_ned->vx = mavlink_msg_set_position_target_local_ned_get_vx(msg);
572 set_position_target_local_ned->vy = mavlink_msg_set_position_target_local_ned_get_vy(msg);
573 set_position_target_local_ned->vz = mavlink_msg_set_position_target_local_ned_get_vz(msg);
574 set_position_target_local_ned->afx = mavlink_msg_set_position_target_local_ned_get_afx(msg);
575 set_position_target_local_ned->afy = mavlink_msg_set_position_target_local_ned_get_afy(msg);
576 set_position_target_local_ned->afz = mavlink_msg_set_position_target_local_ned_get_afz(msg);
577 set_position_target_local_ned->yaw = mavlink_msg_set_position_target_local_ned_get_yaw(msg);
578 set_position_target_local_ned->yaw_rate = mavlink_msg_set_position_target_local_ned_get_yaw_rate(msg);
579 set_position_target_local_ned->type_mask = mavlink_msg_set_position_target_local_ned_get_type_mask(msg);
580 set_position_target_local_ned->target_system = mavlink_msg_set_position_target_local_ned_get_target_system(msg);
581 set_position_target_local_ned->target_component = mavlink_msg_set_position_target_local_ned_get_target_component(msg);
582 set_position_target_local_ned->coordinate_frame = mavlink_msg_set_position_target_local_ned_get_coordinate_frame(msg);
583#else
584 uint8_t len = msg->len < MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN? msg->len : MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN;
585 memset(set_position_target_local_ned, 0, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
586 memcpy(set_position_target_local_ned, _MAV_PAYLOAD(msg), len);
587#endif
588}