Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_set_position_target_local_ned.h
blob8fcc3cbc14a4ac3e25935826af8a7ba431aec1c9
1 // MESSAGE SET_POSITION_TARGET_LOCAL_NED PACKING
3 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED 84
5 typedef struct __mavlink_set_position_target_local_ned_t
7 uint32_t time_boot_ms; ///< Timestamp in milliseconds since system boot
8 float x; ///< X Position in NED frame in meters
9 float y; ///< Y Position in NED frame in meters
10 float z; ///< Z Position in NED frame in meters (note, altitude is negative in NED)
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 target_system; ///< System ID
21 uint8_t target_component; ///< Component ID
22 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
23 } mavlink_set_position_target_local_ned_t;
25 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN 53
26 #define MAVLINK_MSG_ID_84_LEN 53
28 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC 143
29 #define MAVLINK_MSG_ID_84_CRC 143
33 #define MAVLINK_MESSAGE_INFO_SET_POSITION_TARGET_LOCAL_NED { \
34 "SET_POSITION_TARGET_LOCAL_NED", \
35 16, \
36 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_set_position_target_local_ned_t, time_boot_ms) }, \
37 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_set_position_target_local_ned_t, x) }, \
38 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_set_position_target_local_ned_t, y) }, \
39 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_position_target_local_ned_t, z) }, \
40 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_position_target_local_ned_t, vx) }, \
41 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_position_target_local_ned_t, vy) }, \
42 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_set_position_target_local_ned_t, vz) }, \
43 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_set_position_target_local_ned_t, afx) }, \
44 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_set_position_target_local_ned_t, afy) }, \
45 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_set_position_target_local_ned_t, afz) }, \
46 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_position_target_local_ned_t, yaw) }, \
47 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_position_target_local_ned_t, yaw_rate) }, \
48 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_set_position_target_local_ned_t, type_mask) }, \
49 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_set_position_target_local_ned_t, target_system) }, \
50 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_set_position_target_local_ned_t, target_component) }, \
51 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_position_target_local_ned_t, coordinate_frame) }, \
52 } \
56 /**
57 * @brief Pack a set_position_target_local_ned message
58 * @param system_id ID of this system
59 * @param component_id ID of this component (e.g. 200 for IMU)
60 * @param msg The MAVLink message to compress the data into
62 * @param time_boot_ms Timestamp in milliseconds since system boot
63 * @param target_system System ID
64 * @param target_component Component ID
65 * @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
66 * @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
67 * @param x X Position in NED frame in meters
68 * @param y Y Position in NED frame in meters
69 * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
70 * @param vx X velocity in NED frame in meter / s
71 * @param vy Y velocity in NED frame in meter / s
72 * @param vz Z velocity in NED frame in meter / s
73 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
74 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
75 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
76 * @param yaw yaw setpoint in rad
77 * @param yaw_rate yaw rate setpoint in rad/s
78 * @return length of the message in bytes (excluding serial stream start sign)
80 static inline uint16_t mavlink_msg_set_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
81 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)
83 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
85 _mav_put_uint32_t(buf, 0, time_boot_ms);
86 _mav_put_float(buf, 4, x);
87 _mav_put_float(buf, 8, y);
88 _mav_put_float(buf, 12, z);
89 _mav_put_float(buf, 16, vx);
90 _mav_put_float(buf, 20, vy);
91 _mav_put_float(buf, 24, vz);
92 _mav_put_float(buf, 28, afx);
93 _mav_put_float(buf, 32, afy);
94 _mav_put_float(buf, 36, afz);
95 _mav_put_float(buf, 40, yaw);
96 _mav_put_float(buf, 44, yaw_rate);
97 _mav_put_uint16_t(buf, 48, type_mask);
98 _mav_put_uint8_t(buf, 50, target_system);
99 _mav_put_uint8_t(buf, 51, target_component);
100 _mav_put_uint8_t(buf, 52, coordinate_frame);
102 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
103 #else
104 mavlink_set_position_target_local_ned_t packet;
105 packet.time_boot_ms = time_boot_ms;
106 packet.x = x;
107 packet.y = y;
108 packet.z = z;
109 packet.vx = vx;
110 packet.vy = vy;
111 packet.vz = vz;
112 packet.afx = afx;
113 packet.afy = afy;
114 packet.afz = afz;
115 packet.yaw = yaw;
116 packet.yaw_rate = yaw_rate;
117 packet.type_mask = type_mask;
118 packet.target_system = target_system;
119 packet.target_component = target_component;
120 packet.coordinate_frame = coordinate_frame;
122 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
123 #endif
125 msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED;
126 #if MAVLINK_CRC_EXTRA
127 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
128 #else
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
130 #endif
134 * @brief Pack a set_position_target_local_ned message on a channel
135 * @param system_id ID of this system
136 * @param component_id ID of this component (e.g. 200 for IMU)
137 * @param chan The MAVLink channel this message will be sent over
138 * @param msg The MAVLink message to compress the data into
139 * @param time_boot_ms Timestamp in milliseconds since system boot
140 * @param target_system System ID
141 * @param target_component Component ID
142 * @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
143 * @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
144 * @param x X Position in NED frame in meters
145 * @param y Y Position in NED frame in meters
146 * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
147 * @param vx X velocity in NED frame in meter / s
148 * @param vy Y velocity in NED frame in meter / s
149 * @param vz Z velocity in NED frame in meter / s
150 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
151 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
152 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
153 * @param yaw yaw setpoint in rad
154 * @param yaw_rate yaw rate setpoint in rad/s
155 * @return length of the message in bytes (excluding serial stream start sign)
157 static inline uint16_t mavlink_msg_set_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
158 mavlink_message_t* msg,
159 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)
161 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
162 char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
163 _mav_put_uint32_t(buf, 0, time_boot_ms);
164 _mav_put_float(buf, 4, x);
165 _mav_put_float(buf, 8, y);
166 _mav_put_float(buf, 12, z);
167 _mav_put_float(buf, 16, vx);
168 _mav_put_float(buf, 20, vy);
169 _mav_put_float(buf, 24, vz);
170 _mav_put_float(buf, 28, afx);
171 _mav_put_float(buf, 32, afy);
172 _mav_put_float(buf, 36, afz);
173 _mav_put_float(buf, 40, yaw);
174 _mav_put_float(buf, 44, yaw_rate);
175 _mav_put_uint16_t(buf, 48, type_mask);
176 _mav_put_uint8_t(buf, 50, target_system);
177 _mav_put_uint8_t(buf, 51, target_component);
178 _mav_put_uint8_t(buf, 52, coordinate_frame);
180 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
181 #else
182 mavlink_set_position_target_local_ned_t packet;
183 packet.time_boot_ms = time_boot_ms;
184 packet.x = x;
185 packet.y = y;
186 packet.z = z;
187 packet.vx = vx;
188 packet.vy = vy;
189 packet.vz = vz;
190 packet.afx = afx;
191 packet.afy = afy;
192 packet.afz = afz;
193 packet.yaw = yaw;
194 packet.yaw_rate = yaw_rate;
195 packet.type_mask = type_mask;
196 packet.target_system = target_system;
197 packet.target_component = target_component;
198 packet.coordinate_frame = coordinate_frame;
200 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
201 #endif
203 msg->msgid = MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED;
204 #if MAVLINK_CRC_EXTRA
205 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
206 #else
207 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
208 #endif
212 * @brief Encode a set_position_target_local_ned struct
214 * @param system_id ID of this system
215 * @param component_id ID of this component (e.g. 200 for IMU)
216 * @param msg The MAVLink message to compress the data into
217 * @param set_position_target_local_ned C-struct to read the message contents from
219 static 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)
221 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);
225 * @brief Encode a set_position_target_local_ned struct on a channel
227 * @param system_id ID of this system
228 * @param component_id ID of this component (e.g. 200 for IMU)
229 * @param chan The MAVLink channel this message will be sent over
230 * @param msg The MAVLink message to compress the data into
231 * @param set_position_target_local_ned C-struct to read the message contents from
233 static 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)
235 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);
239 * @brief Send a set_position_target_local_ned message
240 * @param chan MAVLink channel to send the message
242 * @param time_boot_ms Timestamp in milliseconds since system boot
243 * @param target_system System ID
244 * @param target_component Component ID
245 * @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
246 * @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
247 * @param x X Position in NED frame in meters
248 * @param y Y Position in NED frame in meters
249 * @param z Z Position in NED frame in meters (note, altitude is negative in NED)
250 * @param vx X velocity in NED frame in meter / s
251 * @param vy Y velocity in NED frame in meter / s
252 * @param vz Z velocity in NED frame in meter / s
253 * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
254 * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
255 * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
256 * @param yaw yaw setpoint in rad
257 * @param yaw_rate yaw rate setpoint in rad/s
259 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
261 static 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)
263 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
264 char buf[MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN];
265 _mav_put_uint32_t(buf, 0, time_boot_ms);
266 _mav_put_float(buf, 4, x);
267 _mav_put_float(buf, 8, y);
268 _mav_put_float(buf, 12, z);
269 _mav_put_float(buf, 16, vx);
270 _mav_put_float(buf, 20, vy);
271 _mav_put_float(buf, 24, vz);
272 _mav_put_float(buf, 28, afx);
273 _mav_put_float(buf, 32, afy);
274 _mav_put_float(buf, 36, afz);
275 _mav_put_float(buf, 40, yaw);
276 _mav_put_float(buf, 44, yaw_rate);
277 _mav_put_uint16_t(buf, 48, type_mask);
278 _mav_put_uint8_t(buf, 50, target_system);
279 _mav_put_uint8_t(buf, 51, target_component);
280 _mav_put_uint8_t(buf, 52, coordinate_frame);
282 #if MAVLINK_CRC_EXTRA
283 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
284 #else
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
286 #endif
287 #else
288 mavlink_set_position_target_local_ned_t packet;
289 packet.time_boot_ms = time_boot_ms;
290 packet.x = x;
291 packet.y = y;
292 packet.z = z;
293 packet.vx = vx;
294 packet.vy = vy;
295 packet.vz = vz;
296 packet.afx = afx;
297 packet.afy = afy;
298 packet.afz = afz;
299 packet.yaw = yaw;
300 packet.yaw_rate = yaw_rate;
301 packet.type_mask = type_mask;
302 packet.target_system = target_system;
303 packet.target_component = target_component;
304 packet.coordinate_frame = coordinate_frame;
306 #if MAVLINK_CRC_EXTRA
307 _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_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
308 #else
309 _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_LEN);
310 #endif
311 #endif
314 #if MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
316 This varient of _send() can be used to save stack space by re-using
317 memory from the receive buffer. The caller provides a
318 mavlink_message_t which is the size of a full mavlink message. This
319 is usually the receive buffer for the channel, and allows a reply to an
320 incoming message with minimum stack space usage.
322 static 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)
324 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
325 char *buf = (char *)msgbuf;
326 _mav_put_uint32_t(buf, 0, time_boot_ms);
327 _mav_put_float(buf, 4, x);
328 _mav_put_float(buf, 8, y);
329 _mav_put_float(buf, 12, z);
330 _mav_put_float(buf, 16, vx);
331 _mav_put_float(buf, 20, vy);
332 _mav_put_float(buf, 24, vz);
333 _mav_put_float(buf, 28, afx);
334 _mav_put_float(buf, 32, afy);
335 _mav_put_float(buf, 36, afz);
336 _mav_put_float(buf, 40, yaw);
337 _mav_put_float(buf, 44, yaw_rate);
338 _mav_put_uint16_t(buf, 48, type_mask);
339 _mav_put_uint8_t(buf, 50, target_system);
340 _mav_put_uint8_t(buf, 51, target_component);
341 _mav_put_uint8_t(buf, 52, coordinate_frame);
343 #if MAVLINK_CRC_EXTRA
344 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
345 #else
346 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
347 #endif
348 #else
349 mavlink_set_position_target_local_ned_t *packet = (mavlink_set_position_target_local_ned_t *)msgbuf;
350 packet->time_boot_ms = time_boot_ms;
351 packet->x = x;
352 packet->y = y;
353 packet->z = z;
354 packet->vx = vx;
355 packet->vy = vy;
356 packet->vz = vz;
357 packet->afx = afx;
358 packet->afy = afy;
359 packet->afz = afz;
360 packet->yaw = yaw;
361 packet->yaw_rate = yaw_rate;
362 packet->type_mask = type_mask;
363 packet->target_system = target_system;
364 packet->target_component = target_component;
365 packet->coordinate_frame = coordinate_frame;
367 #if MAVLINK_CRC_EXTRA
368 _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_LEN, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC);
369 #else
370 _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_LEN);
371 #endif
372 #endif
374 #endif
376 #endif
378 // MESSAGE SET_POSITION_TARGET_LOCAL_NED UNPACKING
382 * @brief Get field time_boot_ms from set_position_target_local_ned message
384 * @return Timestamp in milliseconds since system boot
386 static inline uint32_t mavlink_msg_set_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg)
388 return _MAV_RETURN_uint32_t(msg, 0);
392 * @brief Get field target_system from set_position_target_local_ned message
394 * @return System ID
396 static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_system(const mavlink_message_t* msg)
398 return _MAV_RETURN_uint8_t(msg, 50);
402 * @brief Get field target_component from set_position_target_local_ned message
404 * @return Component ID
406 static inline uint8_t mavlink_msg_set_position_target_local_ned_get_target_component(const mavlink_message_t* msg)
408 return _MAV_RETURN_uint8_t(msg, 51);
412 * @brief Get field coordinate_frame from set_position_target_local_ned message
414 * @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
416 static inline uint8_t mavlink_msg_set_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg)
418 return _MAV_RETURN_uint8_t(msg, 52);
422 * @brief Get field type_mask from set_position_target_local_ned message
424 * @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
426 static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(const mavlink_message_t* msg)
428 return _MAV_RETURN_uint16_t(msg, 48);
432 * @brief Get field x from set_position_target_local_ned message
434 * @return X Position in NED frame in meters
436 static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlink_message_t* msg)
438 return _MAV_RETURN_float(msg, 4);
442 * @brief Get field y from set_position_target_local_ned message
444 * @return Y Position in NED frame in meters
446 static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlink_message_t* msg)
448 return _MAV_RETURN_float(msg, 8);
452 * @brief Get field z from set_position_target_local_ned message
454 * @return Z Position in NED frame in meters (note, altitude is negative in NED)
456 static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlink_message_t* msg)
458 return _MAV_RETURN_float(msg, 12);
462 * @brief Get field vx from set_position_target_local_ned message
464 * @return X velocity in NED frame in meter / s
466 static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavlink_message_t* msg)
468 return _MAV_RETURN_float(msg, 16);
472 * @brief Get field vy from set_position_target_local_ned message
474 * @return Y velocity in NED frame in meter / s
476 static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavlink_message_t* msg)
478 return _MAV_RETURN_float(msg, 20);
482 * @brief Get field vz from set_position_target_local_ned message
484 * @return Z velocity in NED frame in meter / s
486 static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavlink_message_t* msg)
488 return _MAV_RETURN_float(msg, 24);
492 * @brief Get field afx from set_position_target_local_ned message
494 * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
496 static inline float mavlink_msg_set_position_target_local_ned_get_afx(const mavlink_message_t* msg)
498 return _MAV_RETURN_float(msg, 28);
502 * @brief Get field afy from set_position_target_local_ned message
504 * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
506 static inline float mavlink_msg_set_position_target_local_ned_get_afy(const mavlink_message_t* msg)
508 return _MAV_RETURN_float(msg, 32);
512 * @brief Get field afz from set_position_target_local_ned message
514 * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
516 static inline float mavlink_msg_set_position_target_local_ned_get_afz(const mavlink_message_t* msg)
518 return _MAV_RETURN_float(msg, 36);
522 * @brief Get field yaw from set_position_target_local_ned message
524 * @return yaw setpoint in rad
526 static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavlink_message_t* msg)
528 return _MAV_RETURN_float(msg, 40);
532 * @brief Get field yaw_rate from set_position_target_local_ned message
534 * @return yaw rate setpoint in rad/s
536 static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg)
538 return _MAV_RETURN_float(msg, 44);
542 * @brief Decode a set_position_target_local_ned message into a struct
544 * @param msg The message to decode
545 * @param set_position_target_local_ned C-struct to decode the message contents into
547 static 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)
549 #if MAVLINK_NEED_BYTE_SWAP
550 set_position_target_local_ned->time_boot_ms = mavlink_msg_set_position_target_local_ned_get_time_boot_ms(msg);
551 set_position_target_local_ned->x = mavlink_msg_set_position_target_local_ned_get_x(msg);
552 set_position_target_local_ned->y = mavlink_msg_set_position_target_local_ned_get_y(msg);
553 set_position_target_local_ned->z = mavlink_msg_set_position_target_local_ned_get_z(msg);
554 set_position_target_local_ned->vx = mavlink_msg_set_position_target_local_ned_get_vx(msg);
555 set_position_target_local_ned->vy = mavlink_msg_set_position_target_local_ned_get_vy(msg);
556 set_position_target_local_ned->vz = mavlink_msg_set_position_target_local_ned_get_vz(msg);
557 set_position_target_local_ned->afx = mavlink_msg_set_position_target_local_ned_get_afx(msg);
558 set_position_target_local_ned->afy = mavlink_msg_set_position_target_local_ned_get_afy(msg);
559 set_position_target_local_ned->afz = mavlink_msg_set_position_target_local_ned_get_afz(msg);
560 set_position_target_local_ned->yaw = mavlink_msg_set_position_target_local_ned_get_yaw(msg);
561 set_position_target_local_ned->yaw_rate = mavlink_msg_set_position_target_local_ned_get_yaw_rate(msg);
562 set_position_target_local_ned->type_mask = mavlink_msg_set_position_target_local_ned_get_type_mask(msg);
563 set_position_target_local_ned->target_system = mavlink_msg_set_position_target_local_ned_get_target_system(msg);
564 set_position_target_local_ned->target_component = mavlink_msg_set_position_target_local_ned_get_target_component(msg);
565 set_position_target_local_ned->coordinate_frame = mavlink_msg_set_position_target_local_ned_get_coordinate_frame(msg);
566 #else
567 memcpy(set_position_target_local_ned, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
568 #endif