Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_set_position_target_local_ned.h
blob4e16b2ab34cb6afa9f6913e2215ebe168293b64b
1 #pragma once
2 // MESSAGE SET_POSITION_TARGET_LOCAL_NED PACKING
4 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED 84
7 typedef struct __mavlink_set_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 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;
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
31 #define MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_CRC 143
32 #define MAVLINK_MSG_ID_84_CRC 143
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 } \
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 } \
81 #endif
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
89 * @param time_boot_ms [ms] Timestamp (time 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 Bitmap to indicate which dimensions should be ignored by the vehicle.
94 * @param x [m] X Position in NED frame
95 * @param y [m] Y Position in NED frame
96 * @param z [m] Z Position in NED frame (note, altitude is negative in NED)
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_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)
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);
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;
149 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
150 #endif
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);
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 [ms] Timestamp (time 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 Bitmap to indicate which dimensions should be ignored by the vehicle.
167 * @param x [m] X Position in NED frame
168 * @param y [m] Y Position in NED frame
169 * @param z [m] Z Position in NED frame (note, altitude is negative in NED)
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_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)
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);
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;
223 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_LEN);
224 #endif
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);
231 * @brief Encode a set_position_target_local_ned 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_local_ned C-struct to read the message contents from
238 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)
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);
244 * @brief Encode a set_position_target_local_ned 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_local_ned C-struct to read the message contents from
252 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)
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);
258 * @brief Send a set_position_target_local_ned message
259 * @param chan MAVLink channel to send the message
261 * @param time_boot_ms [ms] Timestamp (time 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 Bitmap to indicate which dimensions should be ignored by the vehicle.
266 * @param x [m] X Position in NED frame
267 * @param y [m] Y Position in NED frame
268 * @param z [m] Z Position in NED frame (note, altitude is negative in NED)
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_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)
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);
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;
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
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
330 static 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)
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
339 #if MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_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_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)
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);
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;
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
391 #endif
393 #endif
395 // MESSAGE SET_POSITION_TARGET_LOCAL_NED UNPACKING
399 * @brief Get field time_boot_ms from set_position_target_local_ned message
401 * @return [ms] Timestamp (time since system boot).
403 static inline uint32_t mavlink_msg_set_position_target_local_ned_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_local_ned message
411 * @return System ID
413 static inline uint8_t mavlink_msg_set_position_target_local_ned_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_local_ned message
421 * @return Component ID
423 static inline uint8_t mavlink_msg_set_position_target_local_ned_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_local_ned message
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
433 static inline uint8_t mavlink_msg_set_position_target_local_ned_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_local_ned message
441 * @return Bitmap to indicate which dimensions should be ignored by the vehicle.
443 static inline uint16_t mavlink_msg_set_position_target_local_ned_get_type_mask(const mavlink_message_t* msg)
445 return _MAV_RETURN_uint16_t(msg, 48);
449 * @brief Get field x from set_position_target_local_ned message
451 * @return [m] X Position in NED frame
453 static inline float mavlink_msg_set_position_target_local_ned_get_x(const mavlink_message_t* msg)
455 return _MAV_RETURN_float(msg, 4);
459 * @brief Get field y from set_position_target_local_ned message
461 * @return [m] Y Position in NED frame
463 static inline float mavlink_msg_set_position_target_local_ned_get_y(const mavlink_message_t* msg)
465 return _MAV_RETURN_float(msg, 8);
469 * @brief Get field z from set_position_target_local_ned message
471 * @return [m] Z Position in NED frame (note, altitude is negative in NED)
473 static inline float mavlink_msg_set_position_target_local_ned_get_z(const mavlink_message_t* msg)
475 return _MAV_RETURN_float(msg, 12);
479 * @brief Get field vx from set_position_target_local_ned message
481 * @return [m/s] X velocity in NED frame
483 static inline float mavlink_msg_set_position_target_local_ned_get_vx(const mavlink_message_t* msg)
485 return _MAV_RETURN_float(msg, 16);
489 * @brief Get field vy from set_position_target_local_ned message
491 * @return [m/s] Y velocity in NED frame
493 static inline float mavlink_msg_set_position_target_local_ned_get_vy(const mavlink_message_t* msg)
495 return _MAV_RETURN_float(msg, 20);
499 * @brief Get field vz from set_position_target_local_ned message
501 * @return [m/s] Z velocity in NED frame
503 static inline float mavlink_msg_set_position_target_local_ned_get_vz(const mavlink_message_t* msg)
505 return _MAV_RETURN_float(msg, 24);
509 * @brief Get field afx from set_position_target_local_ned 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_local_ned_get_afx(const mavlink_message_t* msg)
515 return _MAV_RETURN_float(msg, 28);
519 * @brief Get field afy from set_position_target_local_ned 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_local_ned_get_afy(const mavlink_message_t* msg)
525 return _MAV_RETURN_float(msg, 32);
529 * @brief Get field afz from set_position_target_local_ned 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_local_ned_get_afz(const mavlink_message_t* msg)
535 return _MAV_RETURN_float(msg, 36);
539 * @brief Get field yaw from set_position_target_local_ned message
541 * @return [rad] yaw setpoint
543 static inline float mavlink_msg_set_position_target_local_ned_get_yaw(const mavlink_message_t* msg)
545 return _MAV_RETURN_float(msg, 40);
549 * @brief Get field yaw_rate from set_position_target_local_ned message
551 * @return [rad/s] yaw rate setpoint
553 static inline float mavlink_msg_set_position_target_local_ned_get_yaw_rate(const mavlink_message_t* msg)
555 return _MAV_RETURN_float(msg, 44);
559 * @brief Decode a set_position_target_local_ned message into a struct
561 * @param msg The message to decode
562 * @param set_position_target_local_ned C-struct to decode the message contents into
564 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)
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