Merge pull request #10476 from radiolinkW/RADIOLINKF722
[inav.git] / lib / main / MAVLink / common / mavlink_msg_position_target_local_ned.h
blobf3cfde26e3d38e1871e3f3970f1ebb9aaa4df71b
1 #pragma once
2 // MESSAGE POSITION_TARGET_LOCAL_NED PACKING
4 #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED 85
7 typedef struct __mavlink_position_target_local_ned_t {
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
9 float x; /*< [m] X Position in NED frame*/
10 float y; /*< [m] Y Position in NED frame*/
11 float z; /*< [m] Z Position in NED frame (note, altitude is negative in NED)*/
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 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*/
22 } mavlink_position_target_local_ned_t;
24 #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN 51
25 #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN 51
26 #define MAVLINK_MSG_ID_85_LEN 51
27 #define MAVLINK_MSG_ID_85_MIN_LEN 51
29 #define MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC 140
30 #define MAVLINK_MSG_ID_85_CRC 140
34 #if MAVLINK_COMMAND_24BIT
35 #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED { \
36 85, \
37 "POSITION_TARGET_LOCAL_NED", \
38 14, \
39 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \
40 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \
41 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \
42 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \
43 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \
44 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \
45 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_local_ned_t, vx) }, \
46 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_local_ned_t, vy) }, \
47 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_local_ned_t, vz) }, \
48 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_local_ned_t, afx) }, \
49 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_local_ned_t, afy) }, \
50 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \
51 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \
52 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \
53 } \
55 #else
56 #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_LOCAL_NED { \
57 "POSITION_TARGET_LOCAL_NED", \
58 14, \
59 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_local_ned_t, time_boot_ms) }, \
60 { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_local_ned_t, coordinate_frame) }, \
61 { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_local_ned_t, type_mask) }, \
62 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_position_target_local_ned_t, x) }, \
63 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_position_target_local_ned_t, y) }, \
64 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_local_ned_t, z) }, \
65 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_local_ned_t, vx) }, \
66 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_local_ned_t, vy) }, \
67 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_local_ned_t, vz) }, \
68 { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_local_ned_t, afx) }, \
69 { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_local_ned_t, afy) }, \
70 { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_local_ned_t, afz) }, \
71 { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_local_ned_t, yaw) }, \
72 { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_local_ned_t, yaw_rate) }, \
73 } \
75 #endif
77 /**
78 * @brief Pack a position_target_local_ned message
79 * @param system_id ID of this system
80 * @param component_id ID of this component (e.g. 200 for IMU)
81 * @param msg The MAVLink message to compress the data into
83 * @param time_boot_ms [ms] Timestamp (time since system boot).
84 * @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
85 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
86 * @param x [m] X Position in NED frame
87 * @param y [m] Y Position in NED frame
88 * @param z [m] Z Position in NED frame (note, altitude is negative in NED)
89 * @param vx [m/s] X velocity in NED frame
90 * @param vy [m/s] Y velocity in NED frame
91 * @param vz [m/s] Z velocity in NED frame
92 * @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
93 * @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
94 * @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
95 * @param yaw [rad] yaw setpoint
96 * @param yaw_rate [rad/s] yaw rate setpoint
97 * @return length of the message in bytes (excluding serial stream start sign)
99 static inline uint16_t mavlink_msg_position_target_local_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
100 uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, float x, float y, float z, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
102 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103 char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN];
104 _mav_put_uint32_t(buf, 0, time_boot_ms);
105 _mav_put_float(buf, 4, x);
106 _mav_put_float(buf, 8, y);
107 _mav_put_float(buf, 12, z);
108 _mav_put_float(buf, 16, vx);
109 _mav_put_float(buf, 20, vy);
110 _mav_put_float(buf, 24, vz);
111 _mav_put_float(buf, 28, afx);
112 _mav_put_float(buf, 32, afy);
113 _mav_put_float(buf, 36, afz);
114 _mav_put_float(buf, 40, yaw);
115 _mav_put_float(buf, 44, yaw_rate);
116 _mav_put_uint16_t(buf, 48, type_mask);
117 _mav_put_uint8_t(buf, 50, coordinate_frame);
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
120 #else
121 mavlink_position_target_local_ned_t packet;
122 packet.time_boot_ms = time_boot_ms;
123 packet.x = x;
124 packet.y = y;
125 packet.z = z;
126 packet.vx = vx;
127 packet.vy = vy;
128 packet.vz = vz;
129 packet.afx = afx;
130 packet.afy = afy;
131 packet.afz = afz;
132 packet.yaw = yaw;
133 packet.yaw_rate = yaw_rate;
134 packet.type_mask = type_mask;
135 packet.coordinate_frame = coordinate_frame;
137 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
138 #endif
140 msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED;
141 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
145 * @brief Pack a position_target_local_ned message on a channel
146 * @param system_id ID of this system
147 * @param component_id ID of this component (e.g. 200 for IMU)
148 * @param chan The MAVLink channel this message will be sent over
149 * @param msg The MAVLink message to compress the data into
150 * @param time_boot_ms [ms] Timestamp (time since system boot).
151 * @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
152 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
153 * @param x [m] X Position in NED frame
154 * @param y [m] Y Position in NED frame
155 * @param z [m] Z Position in NED frame (note, altitude is negative in NED)
156 * @param vx [m/s] X velocity in NED frame
157 * @param vy [m/s] Y velocity in NED frame
158 * @param vz [m/s] Z velocity in NED frame
159 * @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
160 * @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
161 * @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
162 * @param yaw [rad] yaw setpoint
163 * @param yaw_rate [rad/s] yaw rate setpoint
164 * @return length of the message in bytes (excluding serial stream start sign)
166 static inline uint16_t mavlink_msg_position_target_local_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
167 mavlink_message_t* msg,
168 uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,float x,float y,float z,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN];
172 _mav_put_uint32_t(buf, 0, time_boot_ms);
173 _mav_put_float(buf, 4, x);
174 _mav_put_float(buf, 8, y);
175 _mav_put_float(buf, 12, z);
176 _mav_put_float(buf, 16, vx);
177 _mav_put_float(buf, 20, vy);
178 _mav_put_float(buf, 24, vz);
179 _mav_put_float(buf, 28, afx);
180 _mav_put_float(buf, 32, afy);
181 _mav_put_float(buf, 36, afz);
182 _mav_put_float(buf, 40, yaw);
183 _mav_put_float(buf, 44, yaw_rate);
184 _mav_put_uint16_t(buf, 48, type_mask);
185 _mav_put_uint8_t(buf, 50, coordinate_frame);
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
188 #else
189 mavlink_position_target_local_ned_t packet;
190 packet.time_boot_ms = time_boot_ms;
191 packet.x = x;
192 packet.y = y;
193 packet.z = z;
194 packet.vx = vx;
195 packet.vy = vy;
196 packet.vz = vz;
197 packet.afx = afx;
198 packet.afy = afy;
199 packet.afz = afz;
200 packet.yaw = yaw;
201 packet.yaw_rate = yaw_rate;
202 packet.type_mask = type_mask;
203 packet.coordinate_frame = coordinate_frame;
205 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
206 #endif
208 msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED;
209 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
213 * @brief Encode a position_target_local_ned struct
215 * @param system_id ID of this system
216 * @param component_id ID of this component (e.g. 200 for IMU)
217 * @param msg The MAVLink message to compress the data into
218 * @param position_target_local_ned C-struct to read the message contents from
220 static inline uint16_t mavlink_msg_position_target_local_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_local_ned_t* position_target_local_ned)
222 return mavlink_msg_position_target_local_ned_pack(system_id, component_id, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate);
226 * @brief Encode a position_target_local_ned struct on a channel
228 * @param system_id ID of this system
229 * @param component_id ID of this component (e.g. 200 for IMU)
230 * @param chan The MAVLink channel this message will be sent over
231 * @param msg The MAVLink message to compress the data into
232 * @param position_target_local_ned C-struct to read the message contents from
234 static inline uint16_t mavlink_msg_position_target_local_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_local_ned_t* position_target_local_ned)
236 return mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, chan, msg, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate);
240 * @brief Send a position_target_local_ned message
241 * @param chan MAVLink channel to send the message
243 * @param time_boot_ms [ms] Timestamp (time since system boot).
244 * @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
245 * @param type_mask Bitmap to indicate which dimensions should be ignored by the vehicle.
246 * @param x [m] X Position in NED frame
247 * @param y [m] Y Position in NED frame
248 * @param z [m] Z Position in NED frame (note, altitude is negative in NED)
249 * @param vx [m/s] X velocity in NED frame
250 * @param vy [m/s] Y velocity in NED frame
251 * @param vz [m/s] Z velocity in NED frame
252 * @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
253 * @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
254 * @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
255 * @param yaw [rad] yaw setpoint
256 * @param yaw_rate [rad/s] yaw rate setpoint
258 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
260 static inline void mavlink_msg_position_target_local_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, 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)
262 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
263 char buf[MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN];
264 _mav_put_uint32_t(buf, 0, time_boot_ms);
265 _mav_put_float(buf, 4, x);
266 _mav_put_float(buf, 8, y);
267 _mav_put_float(buf, 12, z);
268 _mav_put_float(buf, 16, vx);
269 _mav_put_float(buf, 20, vy);
270 _mav_put_float(buf, 24, vz);
271 _mav_put_float(buf, 28, afx);
272 _mav_put_float(buf, 32, afy);
273 _mav_put_float(buf, 36, afz);
274 _mav_put_float(buf, 40, yaw);
275 _mav_put_float(buf, 44, yaw_rate);
276 _mav_put_uint16_t(buf, 48, type_mask);
277 _mav_put_uint8_t(buf, 50, coordinate_frame);
279 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
280 #else
281 mavlink_position_target_local_ned_t packet;
282 packet.time_boot_ms = time_boot_ms;
283 packet.x = x;
284 packet.y = y;
285 packet.z = z;
286 packet.vx = vx;
287 packet.vy = vy;
288 packet.vz = vz;
289 packet.afx = afx;
290 packet.afy = afy;
291 packet.afz = afz;
292 packet.yaw = yaw;
293 packet.yaw_rate = yaw_rate;
294 packet.type_mask = type_mask;
295 packet.coordinate_frame = coordinate_frame;
297 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
298 #endif
302 * @brief Send a position_target_local_ned message
303 * @param chan MAVLink channel to send the message
304 * @param struct The MAVLink struct to serialize
306 static inline void mavlink_msg_position_target_local_ned_send_struct(mavlink_channel_t chan, const mavlink_position_target_local_ned_t* position_target_local_ned)
308 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
309 mavlink_msg_position_target_local_ned_send(chan, position_target_local_ned->time_boot_ms, position_target_local_ned->coordinate_frame, position_target_local_ned->type_mask, position_target_local_ned->x, position_target_local_ned->y, position_target_local_ned->z, position_target_local_ned->vx, position_target_local_ned->vy, position_target_local_ned->vz, position_target_local_ned->afx, position_target_local_ned->afy, position_target_local_ned->afz, position_target_local_ned->yaw, position_target_local_ned->yaw_rate);
310 #else
311 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)position_target_local_ned, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
312 #endif
315 #if MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
317 This varient of _send() can be used to save stack space by re-using
318 memory from the receive buffer. The caller provides a
319 mavlink_message_t which is the size of a full mavlink message. This
320 is usually the receive buffer for the channel, and allows a reply to an
321 incoming message with minimum stack space usage.
323 static inline void mavlink_msg_position_target_local_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, 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)
325 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
326 char *buf = (char *)msgbuf;
327 _mav_put_uint32_t(buf, 0, time_boot_ms);
328 _mav_put_float(buf, 4, x);
329 _mav_put_float(buf, 8, y);
330 _mav_put_float(buf, 12, z);
331 _mav_put_float(buf, 16, vx);
332 _mav_put_float(buf, 20, vy);
333 _mav_put_float(buf, 24, vz);
334 _mav_put_float(buf, 28, afx);
335 _mav_put_float(buf, 32, afy);
336 _mav_put_float(buf, 36, afz);
337 _mav_put_float(buf, 40, yaw);
338 _mav_put_float(buf, 44, yaw_rate);
339 _mav_put_uint16_t(buf, 48, type_mask);
340 _mav_put_uint8_t(buf, 50, coordinate_frame);
342 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, buf, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
343 #else
344 mavlink_position_target_local_ned_t *packet = (mavlink_position_target_local_ned_t *)msgbuf;
345 packet->time_boot_ms = time_boot_ms;
346 packet->x = x;
347 packet->y = y;
348 packet->z = z;
349 packet->vx = vx;
350 packet->vy = vy;
351 packet->vz = vz;
352 packet->afx = afx;
353 packet->afy = afy;
354 packet->afz = afz;
355 packet->yaw = yaw;
356 packet->yaw_rate = yaw_rate;
357 packet->type_mask = type_mask;
358 packet->coordinate_frame = coordinate_frame;
360 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_CRC);
361 #endif
363 #endif
365 #endif
367 // MESSAGE POSITION_TARGET_LOCAL_NED UNPACKING
371 * @brief Get field time_boot_ms from position_target_local_ned message
373 * @return [ms] Timestamp (time since system boot).
375 static inline uint32_t mavlink_msg_position_target_local_ned_get_time_boot_ms(const mavlink_message_t* msg)
377 return _MAV_RETURN_uint32_t(msg, 0);
381 * @brief Get field coordinate_frame from position_target_local_ned message
383 * @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
385 static inline uint8_t mavlink_msg_position_target_local_ned_get_coordinate_frame(const mavlink_message_t* msg)
387 return _MAV_RETURN_uint8_t(msg, 50);
391 * @brief Get field type_mask from position_target_local_ned message
393 * @return Bitmap to indicate which dimensions should be ignored by the vehicle.
395 static inline uint16_t mavlink_msg_position_target_local_ned_get_type_mask(const mavlink_message_t* msg)
397 return _MAV_RETURN_uint16_t(msg, 48);
401 * @brief Get field x from position_target_local_ned message
403 * @return [m] X Position in NED frame
405 static inline float mavlink_msg_position_target_local_ned_get_x(const mavlink_message_t* msg)
407 return _MAV_RETURN_float(msg, 4);
411 * @brief Get field y from position_target_local_ned message
413 * @return [m] Y Position in NED frame
415 static inline float mavlink_msg_position_target_local_ned_get_y(const mavlink_message_t* msg)
417 return _MAV_RETURN_float(msg, 8);
421 * @brief Get field z from position_target_local_ned message
423 * @return [m] Z Position in NED frame (note, altitude is negative in NED)
425 static inline float mavlink_msg_position_target_local_ned_get_z(const mavlink_message_t* msg)
427 return _MAV_RETURN_float(msg, 12);
431 * @brief Get field vx from position_target_local_ned message
433 * @return [m/s] X velocity in NED frame
435 static inline float mavlink_msg_position_target_local_ned_get_vx(const mavlink_message_t* msg)
437 return _MAV_RETURN_float(msg, 16);
441 * @brief Get field vy from position_target_local_ned message
443 * @return [m/s] Y velocity in NED frame
445 static inline float mavlink_msg_position_target_local_ned_get_vy(const mavlink_message_t* msg)
447 return _MAV_RETURN_float(msg, 20);
451 * @brief Get field vz from position_target_local_ned message
453 * @return [m/s] Z velocity in NED frame
455 static inline float mavlink_msg_position_target_local_ned_get_vz(const mavlink_message_t* msg)
457 return _MAV_RETURN_float(msg, 24);
461 * @brief Get field afx from position_target_local_ned message
463 * @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
465 static inline float mavlink_msg_position_target_local_ned_get_afx(const mavlink_message_t* msg)
467 return _MAV_RETURN_float(msg, 28);
471 * @brief Get field afy from position_target_local_ned message
473 * @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
475 static inline float mavlink_msg_position_target_local_ned_get_afy(const mavlink_message_t* msg)
477 return _MAV_RETURN_float(msg, 32);
481 * @brief Get field afz from position_target_local_ned message
483 * @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
485 static inline float mavlink_msg_position_target_local_ned_get_afz(const mavlink_message_t* msg)
487 return _MAV_RETURN_float(msg, 36);
491 * @brief Get field yaw from position_target_local_ned message
493 * @return [rad] yaw setpoint
495 static inline float mavlink_msg_position_target_local_ned_get_yaw(const mavlink_message_t* msg)
497 return _MAV_RETURN_float(msg, 40);
501 * @brief Get field yaw_rate from position_target_local_ned message
503 * @return [rad/s] yaw rate setpoint
505 static inline float mavlink_msg_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg)
507 return _MAV_RETURN_float(msg, 44);
511 * @brief Decode a position_target_local_ned message into a struct
513 * @param msg The message to decode
514 * @param position_target_local_ned C-struct to decode the message contents into
516 static inline void mavlink_msg_position_target_local_ned_decode(const mavlink_message_t* msg, mavlink_position_target_local_ned_t* position_target_local_ned)
518 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
519 position_target_local_ned->time_boot_ms = mavlink_msg_position_target_local_ned_get_time_boot_ms(msg);
520 position_target_local_ned->x = mavlink_msg_position_target_local_ned_get_x(msg);
521 position_target_local_ned->y = mavlink_msg_position_target_local_ned_get_y(msg);
522 position_target_local_ned->z = mavlink_msg_position_target_local_ned_get_z(msg);
523 position_target_local_ned->vx = mavlink_msg_position_target_local_ned_get_vx(msg);
524 position_target_local_ned->vy = mavlink_msg_position_target_local_ned_get_vy(msg);
525 position_target_local_ned->vz = mavlink_msg_position_target_local_ned_get_vz(msg);
526 position_target_local_ned->afx = mavlink_msg_position_target_local_ned_get_afx(msg);
527 position_target_local_ned->afy = mavlink_msg_position_target_local_ned_get_afy(msg);
528 position_target_local_ned->afz = mavlink_msg_position_target_local_ned_get_afz(msg);
529 position_target_local_ned->yaw = mavlink_msg_position_target_local_ned_get_yaw(msg);
530 position_target_local_ned->yaw_rate = mavlink_msg_position_target_local_ned_get_yaw_rate(msg);
531 position_target_local_ned->type_mask = mavlink_msg_position_target_local_ned_get_type_mask(msg);
532 position_target_local_ned->coordinate_frame = mavlink_msg_position_target_local_ned_get_coordinate_frame(msg);
533 #else
534 uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN;
535 memset(position_target_local_ned, 0, MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_LEN);
536 memcpy(position_target_local_ned, _MAV_PAYLOAD(msg), len);
537 #endif