4#define MAVLINK_MSG_ID_HOME_POSITION 242
7typedef struct __mavlink_home_position_t {
19}) mavlink_home_position_t;
21#define MAVLINK_MSG_ID_HOME_POSITION_LEN 60
22#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52
23#define MAVLINK_MSG_ID_242_LEN 60
24#define MAVLINK_MSG_ID_242_MIN_LEN 52
26#define MAVLINK_MSG_ID_HOME_POSITION_CRC 104
27#define MAVLINK_MSG_ID_242_CRC 104
29#define MAVLINK_MSG_HOME_POSITION_FIELD_Q_LEN 4
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \
36 { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \
37 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \
38 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \
39 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \
40 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \
41 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \
42 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \
43 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
44 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
45 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
46 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
50#define MAVLINK_MESSAGE_INFO_HOME_POSITION { \
53 { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_home_position_t, latitude) }, \
54 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_home_position_t, longitude) }, \
55 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_home_position_t, altitude) }, \
56 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_home_position_t, x) }, \
57 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_home_position_t, y) }, \
58 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_home_position_t, z) }, \
59 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_home_position_t, q) }, \
60 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_home_position_t, approach_x) }, \
61 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_home_position_t, approach_y) }, \
62 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_home_position_t, approach_z) }, \
63 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 52, offsetof(mavlink_home_position_t, time_usec) }, \
87static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 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, uint64_t time_usec)
90#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91 char buf[MAVLINK_MSG_ID_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_uint64_t(buf, 52, time_usec);
102 _mav_put_float_array(buf, 24, q, 4);
103 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
105 mavlink_home_position_t packet;
106 packet.latitude = latitude;
107 packet.longitude = longitude;
108 packet.altitude = altitude;
112 packet.approach_x = approach_x;
113 packet.approach_y = approach_y;
114 packet.approach_z = approach_z;
115 packet.time_usec = time_usec;
116 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
117 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
120 msg->msgid = MAVLINK_MSG_ID_HOME_POSITION;
121 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
143static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
144 mavlink_message_t* msg,
145 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,uint64_t time_usec)
147#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
148 char buf[MAVLINK_MSG_ID_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_uint64_t(buf, 52, time_usec);
159 _mav_put_float_array(buf, 24, q, 4);
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HOME_POSITION_LEN);
162 mavlink_home_position_t packet;
163 packet.latitude = latitude;
164 packet.longitude = longitude;
165 packet.altitude = altitude;
169 packet.approach_x = approach_x;
170 packet.approach_y = approach_y;
171 packet.approach_z = approach_z;
172 packet.time_usec = time_usec;
173 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
174 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
177 msg->msgid = MAVLINK_MSG_ID_HOME_POSITION;
178 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
189static inline uint16_t mavlink_msg_home_position_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_home_position_t* home_position)
191 return mavlink_msg_home_position_pack(system_id, component_id, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
203static inline uint16_t mavlink_msg_home_position_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_home_position_t* home_position)
205 return mavlink_msg_home_position_pack_chan(system_id, component_id, chan, msg, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
224#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
226static inline void mavlink_msg_home_position_send(mavlink_channel_t chan, 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, uint64_t time_usec)
228#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
229 char buf[MAVLINK_MSG_ID_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_uint64_t(buf, 52, time_usec);
240 _mav_put_float_array(buf, 24, q, 4);
241 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
243 mavlink_home_position_t packet;
244 packet.latitude = latitude;
245 packet.longitude = longitude;
246 packet.altitude = altitude;
250 packet.approach_x = approach_x;
251 packet.approach_y = approach_y;
252 packet.approach_z = approach_z;
253 packet.time_usec = time_usec;
254 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
255 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (
const char *)&packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
264static inline void mavlink_msg_home_position_send_struct(mavlink_channel_t chan,
const mavlink_home_position_t* home_position)
266#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
267 mavlink_msg_home_position_send(chan, home_position->latitude, home_position->longitude, home_position->altitude, home_position->x, home_position->y, home_position->z, home_position->q, home_position->approach_x, home_position->approach_y, home_position->approach_z, home_position->time_usec);
269 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (
const char *)home_position, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
273#if MAVLINK_MSG_ID_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
281static inline void mavlink_msg_home_position_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, 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, uint64_t time_usec)
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_uint64_t(buf, 52, time_usec);
295 _mav_put_float_array(buf, 24, q, 4);
296 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, buf, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
298 mavlink_home_position_t *packet = (mavlink_home_position_t *)msgbuf;
299 packet->latitude = latitude;
300 packet->longitude = longitude;
301 packet->altitude = altitude;
305 packet->approach_x = approach_x;
306 packet->approach_y = approach_y;
307 packet->approach_z = approach_z;
308 packet->time_usec = time_usec;
309 mav_array_memcpy(packet->q, q,
sizeof(
float)*4);
310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HOME_POSITION, (
const char *)packet, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
325static inline int32_t mavlink_msg_home_position_get_latitude(
const mavlink_message_t* msg)
327 return _MAV_RETURN_int32_t(msg, 0);
335static inline int32_t mavlink_msg_home_position_get_longitude(
const mavlink_message_t* msg)
337 return _MAV_RETURN_int32_t(msg, 4);
345static inline int32_t mavlink_msg_home_position_get_altitude(
const mavlink_message_t* msg)
347 return _MAV_RETURN_int32_t(msg, 8);
355static inline float mavlink_msg_home_position_get_x(
const mavlink_message_t* msg)
357 return _MAV_RETURN_float(msg, 12);
365static inline float mavlink_msg_home_position_get_y(
const mavlink_message_t* msg)
367 return _MAV_RETURN_float(msg, 16);
375static inline float mavlink_msg_home_position_get_z(
const mavlink_message_t* msg)
377 return _MAV_RETURN_float(msg, 20);
385static inline uint16_t mavlink_msg_home_position_get_q(
const mavlink_message_t* msg,
float *q)
387 return _MAV_RETURN_float_array(msg, q, 4, 24);
395static inline float mavlink_msg_home_position_get_approach_x(
const mavlink_message_t* msg)
397 return _MAV_RETURN_float(msg, 40);
405static inline float mavlink_msg_home_position_get_approach_y(
const mavlink_message_t* msg)
407 return _MAV_RETURN_float(msg, 44);
415static inline float mavlink_msg_home_position_get_approach_z(
const mavlink_message_t* msg)
417 return _MAV_RETURN_float(msg, 48);
425static inline uint64_t mavlink_msg_home_position_get_time_usec(
const mavlink_message_t* msg)
427 return _MAV_RETURN_uint64_t(msg, 52);
436static inline void mavlink_msg_home_position_decode(
const mavlink_message_t* msg, mavlink_home_position_t* home_position)
438#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
439 home_position->latitude = mavlink_msg_home_position_get_latitude(msg);
440 home_position->longitude = mavlink_msg_home_position_get_longitude(msg);
441 home_position->altitude = mavlink_msg_home_position_get_altitude(msg);
442 home_position->x = mavlink_msg_home_position_get_x(msg);
443 home_position->y = mavlink_msg_home_position_get_y(msg);
444 home_position->z = mavlink_msg_home_position_get_z(msg);
445 mavlink_msg_home_position_get_q(msg, home_position->q);
446 home_position->approach_x = mavlink_msg_home_position_get_approach_x(msg);
447 home_position->approach_y = mavlink_msg_home_position_get_approach_y(msg);
448 home_position->approach_z = mavlink_msg_home_position_get_approach_z(msg);
449 home_position->time_usec = mavlink_msg_home_position_get_time_usec(msg);
451 uint8_t len = msg->len < MAVLINK_MSG_ID_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_HOME_POSITION_LEN;
452 memset(home_position, 0, MAVLINK_MSG_ID_HOME_POSITION_LEN);
453 memcpy(home_position, _MAV_PAYLOAD(msg), len);