[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / MAVLink / common / mavlink_msg_set_home_position.h
blobcd7c8d34c41d1db9cc8b4540585f45687a60b8ad
1 #pragma once
2 // MESSAGE SET_HOME_POSITION PACKING
4 #define MAVLINK_MSG_ID_SET_HOME_POSITION 243
6 MAVPACKED(
7 typedef struct __mavlink_set_home_position_t {
8 int32_t latitude; /*< Latitude (WGS84), in degrees * 1E7*/
9 int32_t longitude; /*< Longitude (WGS84, in degrees * 1E7*/
10 int32_t altitude; /*< Altitude (AMSL), in meters * 1000 (positive for up)*/
11 float x; /*< Local X position of this position in the local coordinate frame*/
12 float y; /*< Local Y position of this position in the local coordinate frame*/
13 float z; /*< Local Z position of this position in the local coordinate frame*/
14 float q[4]; /*< World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground*/
15 float approach_x; /*< Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
16 float approach_y; /*< Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
17 float approach_z; /*< Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.*/
18 uint8_t target_system; /*< System ID.*/
19 }) mavlink_set_home_position_t;
21 #define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 53
22 #define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN 53
23 #define MAVLINK_MSG_ID_243_LEN 53
24 #define MAVLINK_MSG_ID_243_MIN_LEN 53
26 #define MAVLINK_MSG_ID_SET_HOME_POSITION_CRC 85
27 #define MAVLINK_MSG_ID_243_CRC 85
29 #define MAVLINK_MSG_SET_HOME_POSITION_FIELD_Q_LEN 4
31 #if MAVLINK_COMMAND_24BIT
32 #define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \
33 243, \
34 "SET_HOME_POSITION", \
35 11, \
36 { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \
37 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \
38 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \
39 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \
40 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \
41 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \
42 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \
43 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
44 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
45 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
46 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \
47 } \
49 #else
50 #define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \
51 "SET_HOME_POSITION", \
52 11, \
53 { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \
54 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \
55 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \
56 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \
57 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \
58 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \
59 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \
60 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
61 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
62 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
63 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \
64 } \
66 #endif
68 /**
69 * @brief Pack a set_home_position message
70 * @param system_id ID of this system
71 * @param component_id ID of this component (e.g. 200 for IMU)
72 * @param msg The MAVLink message to compress the data into
74 * @param target_system System ID.
75 * @param latitude Latitude (WGS84), in degrees * 1E7
76 * @param longitude Longitude (WGS84, in degrees * 1E7
77 * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
78 * @param x Local X position of this position in the local coordinate frame
79 * @param y Local Y position of this position in the local coordinate frame
80 * @param z Local Z position of this position in the local coordinate frame
81 * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
82 * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
83 * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
84 * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
85 * @return length of the message in bytes (excluding serial stream start sign)
87 static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
90 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
92 _mav_put_int32_t(buf, 0, latitude);
93 _mav_put_int32_t(buf, 4, longitude);
94 _mav_put_int32_t(buf, 8, altitude);
95 _mav_put_float(buf, 12, x);
96 _mav_put_float(buf, 16, y);
97 _mav_put_float(buf, 20, z);
98 _mav_put_float(buf, 40, approach_x);
99 _mav_put_float(buf, 44, approach_y);
100 _mav_put_float(buf, 48, approach_z);
101 _mav_put_uint8_t(buf, 52, target_system);
102 _mav_put_float_array(buf, 24, q, 4);
103 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
104 #else
105 mavlink_set_home_position_t packet;
106 packet.latitude = latitude;
107 packet.longitude = longitude;
108 packet.altitude = altitude;
109 packet.x = x;
110 packet.y = y;
111 packet.z = z;
112 packet.approach_x = approach_x;
113 packet.approach_y = approach_y;
114 packet.approach_z = approach_z;
115 packet.target_system = target_system;
116 mav_array_memcpy(packet.q, q, sizeof(float)*4);
117 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
118 #endif
120 msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION;
121 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
125 * @brief Pack a set_home_position message on a channel
126 * @param system_id ID of this system
127 * @param component_id ID of this component (e.g. 200 for IMU)
128 * @param chan The MAVLink channel this message will be sent over
129 * @param msg The MAVLink message to compress the data into
130 * @param target_system System ID.
131 * @param latitude Latitude (WGS84), in degrees * 1E7
132 * @param longitude Longitude (WGS84, in degrees * 1E7
133 * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
134 * @param x Local X position of this position in the local coordinate frame
135 * @param y Local Y position of this position in the local coordinate frame
136 * @param z Local Z position of this position in the local coordinate frame
137 * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
138 * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
139 * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
140 * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
141 * @return length of the message in bytes (excluding serial stream start sign)
143 static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
144 mavlink_message_t* msg,
145 uint8_t target_system,int32_t latitude,int32_t longitude,int32_t altitude,float x,float y,float z,const float *q,float approach_x,float approach_y,float approach_z)
147 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
148 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
149 _mav_put_int32_t(buf, 0, latitude);
150 _mav_put_int32_t(buf, 4, longitude);
151 _mav_put_int32_t(buf, 8, altitude);
152 _mav_put_float(buf, 12, x);
153 _mav_put_float(buf, 16, y);
154 _mav_put_float(buf, 20, z);
155 _mav_put_float(buf, 40, approach_x);
156 _mav_put_float(buf, 44, approach_y);
157 _mav_put_float(buf, 48, approach_z);
158 _mav_put_uint8_t(buf, 52, target_system);
159 _mav_put_float_array(buf, 24, q, 4);
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
161 #else
162 mavlink_set_home_position_t packet;
163 packet.latitude = latitude;
164 packet.longitude = longitude;
165 packet.altitude = altitude;
166 packet.x = x;
167 packet.y = y;
168 packet.z = z;
169 packet.approach_x = approach_x;
170 packet.approach_y = approach_y;
171 packet.approach_z = approach_z;
172 packet.target_system = target_system;
173 mav_array_memcpy(packet.q, q, sizeof(float)*4);
174 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
175 #endif
177 msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION;
178 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
182 * @brief Encode a set_home_position struct
184 * @param system_id ID of this system
185 * @param component_id ID of this component (e.g. 200 for IMU)
186 * @param msg The MAVLink message to compress the data into
187 * @param set_home_position C-struct to read the message contents from
189 static inline uint16_t mavlink_msg_set_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
191 return mavlink_msg_set_home_position_pack(system_id, component_id, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z);
195 * @brief Encode a set_home_position struct on a channel
197 * @param system_id ID of this system
198 * @param component_id ID of this component (e.g. 200 for IMU)
199 * @param chan The MAVLink channel this message will be sent over
200 * @param msg The MAVLink message to compress the data into
201 * @param set_home_position C-struct to read the message contents from
203 static inline uint16_t mavlink_msg_set_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_home_position_t* set_home_position)
205 return mavlink_msg_set_home_position_pack_chan(system_id, component_id, chan, msg, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z);
209 * @brief Send a set_home_position message
210 * @param chan MAVLink channel to send the message
212 * @param target_system System ID.
213 * @param latitude Latitude (WGS84), in degrees * 1E7
214 * @param longitude Longitude (WGS84, in degrees * 1E7
215 * @param altitude Altitude (AMSL), in meters * 1000 (positive for up)
216 * @param x Local X position of this position in the local coordinate frame
217 * @param y Local Y position of this position in the local coordinate frame
218 * @param z Local Z position of this position in the local coordinate frame
219 * @param q World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
220 * @param approach_x Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
221 * @param approach_y Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
222 * @param approach_z Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
224 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
226 static inline void mavlink_msg_set_home_position_send(mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
228 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
229 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
230 _mav_put_int32_t(buf, 0, latitude);
231 _mav_put_int32_t(buf, 4, longitude);
232 _mav_put_int32_t(buf, 8, altitude);
233 _mav_put_float(buf, 12, x);
234 _mav_put_float(buf, 16, y);
235 _mav_put_float(buf, 20, z);
236 _mav_put_float(buf, 40, approach_x);
237 _mav_put_float(buf, 44, approach_y);
238 _mav_put_float(buf, 48, approach_z);
239 _mav_put_uint8_t(buf, 52, target_system);
240 _mav_put_float_array(buf, 24, q, 4);
241 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
242 #else
243 mavlink_set_home_position_t packet;
244 packet.latitude = latitude;
245 packet.longitude = longitude;
246 packet.altitude = altitude;
247 packet.x = x;
248 packet.y = y;
249 packet.z = z;
250 packet.approach_x = approach_x;
251 packet.approach_y = approach_y;
252 packet.approach_z = approach_z;
253 packet.target_system = target_system;
254 mav_array_memcpy(packet.q, q, sizeof(float)*4);
255 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)&packet, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
256 #endif
260 * @brief Send a set_home_position message
261 * @param chan MAVLink channel to send the message
262 * @param struct The MAVLink struct to serialize
264 static inline void mavlink_msg_set_home_position_send_struct(mavlink_channel_t chan, const mavlink_set_home_position_t* set_home_position)
266 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
267 mavlink_msg_set_home_position_send(chan, set_home_position->target_system, set_home_position->latitude, set_home_position->longitude, set_home_position->altitude, set_home_position->x, set_home_position->y, set_home_position->z, set_home_position->q, set_home_position->approach_x, set_home_position->approach_y, set_home_position->approach_z);
268 #else
269 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)set_home_position, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
270 #endif
273 #if MAVLINK_MSG_ID_SET_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
275 This varient of _send() can be used to save stack space by re-using
276 memory from the receive buffer. The caller provides a
277 mavlink_message_t which is the size of a full mavlink message. This
278 is usually the receive buffer for the channel, and allows a reply to an
279 incoming message with minimum stack space usage.
281 static inline void mavlink_msg_set_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, int32_t latitude, int32_t longitude, int32_t altitude, float x, float y, float z, const float *q, float approach_x, float approach_y, float approach_z)
283 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
284 char *buf = (char *)msgbuf;
285 _mav_put_int32_t(buf, 0, latitude);
286 _mav_put_int32_t(buf, 4, longitude);
287 _mav_put_int32_t(buf, 8, altitude);
288 _mav_put_float(buf, 12, x);
289 _mav_put_float(buf, 16, y);
290 _mav_put_float(buf, 20, z);
291 _mav_put_float(buf, 40, approach_x);
292 _mav_put_float(buf, 44, approach_y);
293 _mav_put_float(buf, 48, approach_z);
294 _mav_put_uint8_t(buf, 52, target_system);
295 _mav_put_float_array(buf, 24, q, 4);
296 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, buf, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
297 #else
298 mavlink_set_home_position_t *packet = (mavlink_set_home_position_t *)msgbuf;
299 packet->latitude = latitude;
300 packet->longitude = longitude;
301 packet->altitude = altitude;
302 packet->x = x;
303 packet->y = y;
304 packet->z = z;
305 packet->approach_x = approach_x;
306 packet->approach_y = approach_y;
307 packet->approach_z = approach_z;
308 packet->target_system = target_system;
309 mav_array_memcpy(packet->q, q, sizeof(float)*4);
310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_HOME_POSITION, (const char *)packet, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
311 #endif
313 #endif
315 #endif
317 // MESSAGE SET_HOME_POSITION UNPACKING
321 * @brief Get field target_system from set_home_position message
323 * @return System ID.
325 static inline uint8_t mavlink_msg_set_home_position_get_target_system(const mavlink_message_t* msg)
327 return _MAV_RETURN_uint8_t(msg, 52);
331 * @brief Get field latitude from set_home_position message
333 * @return Latitude (WGS84), in degrees * 1E7
335 static inline int32_t mavlink_msg_set_home_position_get_latitude(const mavlink_message_t* msg)
337 return _MAV_RETURN_int32_t(msg, 0);
341 * @brief Get field longitude from set_home_position message
343 * @return Longitude (WGS84, in degrees * 1E7
345 static inline int32_t mavlink_msg_set_home_position_get_longitude(const mavlink_message_t* msg)
347 return _MAV_RETURN_int32_t(msg, 4);
351 * @brief Get field altitude from set_home_position message
353 * @return Altitude (AMSL), in meters * 1000 (positive for up)
355 static inline int32_t mavlink_msg_set_home_position_get_altitude(const mavlink_message_t* msg)
357 return _MAV_RETURN_int32_t(msg, 8);
361 * @brief Get field x from set_home_position message
363 * @return Local X position of this position in the local coordinate frame
365 static inline float mavlink_msg_set_home_position_get_x(const mavlink_message_t* msg)
367 return _MAV_RETURN_float(msg, 12);
371 * @brief Get field y from set_home_position message
373 * @return Local Y position of this position in the local coordinate frame
375 static inline float mavlink_msg_set_home_position_get_y(const mavlink_message_t* msg)
377 return _MAV_RETURN_float(msg, 16);
381 * @brief Get field z from set_home_position message
383 * @return Local Z position of this position in the local coordinate frame
385 static inline float mavlink_msg_set_home_position_get_z(const mavlink_message_t* msg)
387 return _MAV_RETURN_float(msg, 20);
391 * @brief Get field q from set_home_position message
393 * @return World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground
395 static inline uint16_t mavlink_msg_set_home_position_get_q(const mavlink_message_t* msg, float *q)
397 return _MAV_RETURN_float_array(msg, q, 4, 24);
401 * @brief Get field approach_x from set_home_position message
403 * @return Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
405 static inline float mavlink_msg_set_home_position_get_approach_x(const mavlink_message_t* msg)
407 return _MAV_RETURN_float(msg, 40);
411 * @brief Get field approach_y from set_home_position message
413 * @return Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
415 static inline float mavlink_msg_set_home_position_get_approach_y(const mavlink_message_t* msg)
417 return _MAV_RETURN_float(msg, 44);
421 * @brief Get field approach_z from set_home_position message
423 * @return Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone.
425 static inline float mavlink_msg_set_home_position_get_approach_z(const mavlink_message_t* msg)
427 return _MAV_RETURN_float(msg, 48);
431 * @brief Decode a set_home_position message into a struct
433 * @param msg The message to decode
434 * @param set_home_position C-struct to decode the message contents into
436 static inline void mavlink_msg_set_home_position_decode(const mavlink_message_t* msg, mavlink_set_home_position_t* set_home_position)
438 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
439 set_home_position->latitude = mavlink_msg_set_home_position_get_latitude(msg);
440 set_home_position->longitude = mavlink_msg_set_home_position_get_longitude(msg);
441 set_home_position->altitude = mavlink_msg_set_home_position_get_altitude(msg);
442 set_home_position->x = mavlink_msg_set_home_position_get_x(msg);
443 set_home_position->y = mavlink_msg_set_home_position_get_y(msg);
444 set_home_position->z = mavlink_msg_set_home_position_get_z(msg);
445 mavlink_msg_set_home_position_get_q(msg, set_home_position->q);
446 set_home_position->approach_x = mavlink_msg_set_home_position_get_approach_x(msg);
447 set_home_position->approach_y = mavlink_msg_set_home_position_get_approach_y(msg);
448 set_home_position->approach_z = mavlink_msg_set_home_position_get_approach_z(msg);
449 set_home_position->target_system = mavlink_msg_set_home_position_get_target_system(msg);
450 #else
451 uint8_t len = msg->len < MAVLINK_MSG_ID_SET_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_SET_HOME_POSITION_LEN;
452 memset(set_home_position, 0, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
453 memcpy(set_home_position, _MAV_PAYLOAD(msg), len);
454 #endif