4#define MAVLINK_MSG_ID_SET_HOME_POSITION 243
7typedef struct __mavlink_set_home_position_t {
18 uint8_t target_system;
20}) mavlink_set_home_position_t;
22#define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN 61
23#define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN 53
24#define MAVLINK_MSG_ID_243_LEN 61
25#define MAVLINK_MSG_ID_243_MIN_LEN 53
27#define MAVLINK_MSG_ID_SET_HOME_POSITION_CRC 85
28#define MAVLINK_MSG_ID_243_CRC 85
30#define MAVLINK_MSG_SET_HOME_POSITION_FIELD_Q_LEN 4
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \
35 "SET_HOME_POSITION", \
37 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \
38 { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \
39 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \
40 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \
41 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \
42 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \
43 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \
44 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \
45 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
46 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
47 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
48 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 53, offsetof(mavlink_set_home_position_t, time_usec) }, \
52#define MAVLINK_MESSAGE_INFO_SET_HOME_POSITION { \
53 "SET_HOME_POSITION", \
55 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_set_home_position_t, target_system) }, \
56 { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_set_home_position_t, latitude) }, \
57 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_set_home_position_t, longitude) }, \
58 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_set_home_position_t, altitude) }, \
59 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_set_home_position_t, x) }, \
60 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_set_home_position_t, y) }, \
61 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_set_home_position_t, z) }, \
62 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 24, offsetof(mavlink_set_home_position_t, q) }, \
63 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_set_home_position_t, approach_x) }, \
64 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_set_home_position_t, approach_y) }, \
65 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_set_home_position_t, approach_z) }, \
66 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 53, offsetof(mavlink_set_home_position_t, time_usec) }, \
91static inline uint16_t mavlink_msg_set_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 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, uint64_t time_usec)
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
96 _mav_put_int32_t(buf, 0, latitude);
97 _mav_put_int32_t(buf, 4, longitude);
98 _mav_put_int32_t(buf, 8, altitude);
99 _mav_put_float(buf, 12, x);
100 _mav_put_float(buf, 16, y);
101 _mav_put_float(buf, 20, z);
102 _mav_put_float(buf, 40, approach_x);
103 _mav_put_float(buf, 44, approach_y);
104 _mav_put_float(buf, 48, approach_z);
105 _mav_put_uint8_t(buf, 52, target_system);
106 _mav_put_uint64_t(buf, 53, time_usec);
107 _mav_put_float_array(buf, 24, q, 4);
108 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
110 mavlink_set_home_position_t packet;
111 packet.latitude = latitude;
112 packet.longitude = longitude;
113 packet.altitude = altitude;
117 packet.approach_x = approach_x;
118 packet.approach_y = approach_y;
119 packet.approach_z = approach_z;
120 packet.target_system = target_system;
121 packet.time_usec = time_usec;
122 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
126 msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION;
127 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);
150static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
151 mavlink_message_t* msg,
152 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,uint64_t time_usec)
154#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
155 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
156 _mav_put_int32_t(buf, 0, latitude);
157 _mav_put_int32_t(buf, 4, longitude);
158 _mav_put_int32_t(buf, 8, altitude);
159 _mav_put_float(buf, 12, x);
160 _mav_put_float(buf, 16, y);
161 _mav_put_float(buf, 20, z);
162 _mav_put_float(buf, 40, approach_x);
163 _mav_put_float(buf, 44, approach_y);
164 _mav_put_float(buf, 48, approach_z);
165 _mav_put_uint8_t(buf, 52, target_system);
166 _mav_put_uint64_t(buf, 53, time_usec);
167 _mav_put_float_array(buf, 24, q, 4);
168 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
170 mavlink_set_home_position_t packet;
171 packet.latitude = latitude;
172 packet.longitude = longitude;
173 packet.altitude = altitude;
177 packet.approach_x = approach_x;
178 packet.approach_y = approach_y;
179 packet.approach_z = approach_z;
180 packet.target_system = target_system;
181 packet.time_usec = time_usec;
182 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
183 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
186 msg->msgid = MAVLINK_MSG_ID_SET_HOME_POSITION;
187 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);
198static 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)
200 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, set_home_position->time_usec);
212static 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)
214 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, set_home_position->time_usec);
234#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
236static 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, uint64_t time_usec)
238#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
239 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
240 _mav_put_int32_t(buf, 0, latitude);
241 _mav_put_int32_t(buf, 4, longitude);
242 _mav_put_int32_t(buf, 8, altitude);
243 _mav_put_float(buf, 12, x);
244 _mav_put_float(buf, 16, y);
245 _mav_put_float(buf, 20, z);
246 _mav_put_float(buf, 40, approach_x);
247 _mav_put_float(buf, 44, approach_y);
248 _mav_put_float(buf, 48, approach_z);
249 _mav_put_uint8_t(buf, 52, target_system);
250 _mav_put_uint64_t(buf, 53, time_usec);
251 _mav_put_float_array(buf, 24, q, 4);
252 _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);
254 mavlink_set_home_position_t packet;
255 packet.latitude = latitude;
256 packet.longitude = longitude;
257 packet.altitude = altitude;
261 packet.approach_x = approach_x;
262 packet.approach_y = approach_y;
263 packet.approach_z = approach_z;
264 packet.target_system = target_system;
265 packet.time_usec = time_usec;
266 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
267 _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);
276static inline void mavlink_msg_set_home_position_send_struct(mavlink_channel_t chan,
const mavlink_set_home_position_t* set_home_position)
278#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
279 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, set_home_position->time_usec);
281 _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);
285#if MAVLINK_MSG_ID_SET_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
293static 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, uint64_t time_usec)
295#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
296 char *buf = (
char *)msgbuf;
297 _mav_put_int32_t(buf, 0, latitude);
298 _mav_put_int32_t(buf, 4, longitude);
299 _mav_put_int32_t(buf, 8, altitude);
300 _mav_put_float(buf, 12, x);
301 _mav_put_float(buf, 16, y);
302 _mav_put_float(buf, 20, z);
303 _mav_put_float(buf, 40, approach_x);
304 _mav_put_float(buf, 44, approach_y);
305 _mav_put_float(buf, 48, approach_z);
306 _mav_put_uint8_t(buf, 52, target_system);
307 _mav_put_uint64_t(buf, 53, time_usec);
308 _mav_put_float_array(buf, 24, q, 4);
309 _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);
311 mavlink_set_home_position_t *packet = (mavlink_set_home_position_t *)msgbuf;
312 packet->latitude = latitude;
313 packet->longitude = longitude;
314 packet->altitude = altitude;
318 packet->approach_x = approach_x;
319 packet->approach_y = approach_y;
320 packet->approach_z = approach_z;
321 packet->target_system = target_system;
322 packet->time_usec = time_usec;
323 mav_array_memcpy(packet->q, q,
sizeof(
float)*4);
324 _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);
339static inline uint8_t mavlink_msg_set_home_position_get_target_system(
const mavlink_message_t* msg)
341 return _MAV_RETURN_uint8_t(msg, 52);
349static inline int32_t mavlink_msg_set_home_position_get_latitude(
const mavlink_message_t* msg)
351 return _MAV_RETURN_int32_t(msg, 0);
359static inline int32_t mavlink_msg_set_home_position_get_longitude(
const mavlink_message_t* msg)
361 return _MAV_RETURN_int32_t(msg, 4);
369static inline int32_t mavlink_msg_set_home_position_get_altitude(
const mavlink_message_t* msg)
371 return _MAV_RETURN_int32_t(msg, 8);
379static inline float mavlink_msg_set_home_position_get_x(
const mavlink_message_t* msg)
381 return _MAV_RETURN_float(msg, 12);
389static inline float mavlink_msg_set_home_position_get_y(
const mavlink_message_t* msg)
391 return _MAV_RETURN_float(msg, 16);
399static inline float mavlink_msg_set_home_position_get_z(
const mavlink_message_t* msg)
401 return _MAV_RETURN_float(msg, 20);
409static inline uint16_t mavlink_msg_set_home_position_get_q(
const mavlink_message_t* msg,
float *q)
411 return _MAV_RETURN_float_array(msg, q, 4, 24);
419static inline float mavlink_msg_set_home_position_get_approach_x(
const mavlink_message_t* msg)
421 return _MAV_RETURN_float(msg, 40);
429static inline float mavlink_msg_set_home_position_get_approach_y(
const mavlink_message_t* msg)
431 return _MAV_RETURN_float(msg, 44);
439static inline float mavlink_msg_set_home_position_get_approach_z(
const mavlink_message_t* msg)
441 return _MAV_RETURN_float(msg, 48);
449static inline uint64_t mavlink_msg_set_home_position_get_time_usec(
const mavlink_message_t* msg)
451 return _MAV_RETURN_uint64_t(msg, 53);
460static inline void mavlink_msg_set_home_position_decode(
const mavlink_message_t* msg, mavlink_set_home_position_t* set_home_position)
462#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
463 set_home_position->latitude = mavlink_msg_set_home_position_get_latitude(msg);
464 set_home_position->longitude = mavlink_msg_set_home_position_get_longitude(msg);
465 set_home_position->altitude = mavlink_msg_set_home_position_get_altitude(msg);
466 set_home_position->x = mavlink_msg_set_home_position_get_x(msg);
467 set_home_position->y = mavlink_msg_set_home_position_get_y(msg);
468 set_home_position->z = mavlink_msg_set_home_position_get_z(msg);
469 mavlink_msg_set_home_position_get_q(msg, set_home_position->q);
470 set_home_position->approach_x = mavlink_msg_set_home_position_get_approach_x(msg);
471 set_home_position->approach_y = mavlink_msg_set_home_position_get_approach_y(msg);
472 set_home_position->approach_z = mavlink_msg_set_home_position_get_approach_z(msg);
473 set_home_position->target_system = mavlink_msg_set_home_position_get_target_system(msg);
474 set_home_position->time_usec = mavlink_msg_set_home_position_get_time_usec(msg);
476 uint8_t len = msg->len < MAVLINK_MSG_ID_SET_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_SET_HOME_POSITION_LEN;
477 memset(set_home_position, 0, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
478 memcpy(set_home_position, _MAV_PAYLOAD(msg), len);