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 {
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) },
50}
52#define MAVLINK_MESSAGE_INFO_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) },
68}
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
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);
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);
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151static inline uint16_t mavlink_msg_set_home_position_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, 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
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);
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);
188 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN, MAVLINK_MSG_ID_SET_HOME_POSITION_CRC);
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214static inline uint16_t mavlink_msg_set_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
215 mavlink_message_t* msg,
216 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)
218#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
220 _mav_put_int32_t(buf, 0, latitude);
221 _mav_put_int32_t(buf, 4, longitude);
222 _mav_put_int32_t(buf, 8, altitude);
223 _mav_put_float(buf, 12, x);
224 _mav_put_float(buf, 16, y);
225 _mav_put_float(buf, 20, z);
226 _mav_put_float(buf, 40, approach_x);
227 _mav_put_float(buf, 44, approach_y);
228 _mav_put_float(buf, 48, approach_z);
229 _mav_put_uint8_t(buf, 52, target_system);
230 _mav_put_uint64_t(buf, 53, time_usec);
231 _mav_put_float_array(buf, 24, q, 4);
234 mavlink_set_home_position_t packet;
235 packet.latitude = latitude;
236 packet.longitude = longitude;
237 packet.altitude = altitude;
241 packet.approach_x = approach_x;
242 packet.approach_y = approach_y;
243 packet.approach_z = approach_z;
244 packet.target_system = target_system;
245 packet.time_usec = time_usec;
246 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
247 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
255
256
257
258
259
260
261
262static 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)
264 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);
268
269
270
271
272
273
274
275
276static 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)
278 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);
282
283
284
285
286
287
288
289
290static inline uint16_t mavlink_msg_set_home_position_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_set_home_position_t* set_home_position)
292 return mavlink_msg_set_home_position_pack_status(system_id, component_id, _status, 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);
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
314static 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)
316#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
317 char buf[MAVLINK_MSG_ID_SET_HOME_POSITION_LEN];
318 _mav_put_int32_t(buf, 0, latitude);
319 _mav_put_int32_t(buf, 4, longitude);
320 _mav_put_int32_t(buf, 8, altitude);
321 _mav_put_float(buf, 12, x);
322 _mav_put_float(buf, 16, y);
323 _mav_put_float(buf, 20, z);
324 _mav_put_float(buf, 40, approach_x);
325 _mav_put_float(buf, 44, approach_y);
326 _mav_put_float(buf, 48, approach_z);
327 _mav_put_uint8_t(buf, 52, target_system);
328 _mav_put_uint64_t(buf, 53, time_usec);
329 _mav_put_float_array(buf, 24, q, 4);
330 _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);
332 mavlink_set_home_position_t packet;
333 packet.latitude = latitude;
334 packet.longitude = longitude;
335 packet.altitude = altitude;
339 packet.approach_x = approach_x;
340 packet.approach_y = approach_y;
341 packet.approach_z = approach_z;
342 packet.target_system = target_system;
343 packet.time_usec = time_usec;
344 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
345 _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);
350
351
352
353
354static inline void mavlink_msg_set_home_position_send_struct(mavlink_channel_t chan,
const mavlink_set_home_position_t* set_home_position)
356#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
357 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);
359 _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);
363#if MAVLINK_MSG_ID_SET_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
365
366
367
368
369
370
371static 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)
373#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
374 char *buf = (
char *)msgbuf;
375 _mav_put_int32_t(buf, 0, latitude);
376 _mav_put_int32_t(buf, 4, longitude);
377 _mav_put_int32_t(buf, 8, altitude);
378 _mav_put_float(buf, 12, x);
379 _mav_put_float(buf, 16, y);
380 _mav_put_float(buf, 20, z);
381 _mav_put_float(buf, 40, approach_x);
382 _mav_put_float(buf, 44, approach_y);
383 _mav_put_float(buf, 48, approach_z);
384 _mav_put_uint8_t(buf, 52, target_system);
385 _mav_put_uint64_t(buf, 53, time_usec);
386 _mav_put_float_array(buf, 24, q, 4);
387 _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);
389 mavlink_set_home_position_t *packet = (mavlink_set_home_position_t *)msgbuf;
390 packet->latitude = latitude;
391 packet->longitude = longitude;
392 packet->altitude = altitude;
396 packet->approach_x = approach_x;
397 packet->approach_y = approach_y;
398 packet->approach_z = approach_z;
399 packet->target_system = target_system;
400 packet->time_usec = time_usec;
401 mav_array_memcpy(packet->q, q,
sizeof(
float)*4);
402 _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);
413
414
415
416
417static inline uint8_t mavlink_msg_set_home_position_get_target_system(
const mavlink_message_t* msg)
419 return _MAV_RETURN_uint8_t(msg, 52);
423
424
425
426
427static inline int32_t mavlink_msg_set_home_position_get_latitude(
const mavlink_message_t* msg)
429 return _MAV_RETURN_int32_t(msg, 0);
433
434
435
436
437static inline int32_t mavlink_msg_set_home_position_get_longitude(
const mavlink_message_t* msg)
439 return _MAV_RETURN_int32_t(msg, 4);
443
444
445
446
447static inline int32_t mavlink_msg_set_home_position_get_altitude(
const mavlink_message_t* msg)
449 return _MAV_RETURN_int32_t(msg, 8);
453
454
455
456
457static inline float mavlink_msg_set_home_position_get_x(
const mavlink_message_t* msg)
459 return _MAV_RETURN_float(msg, 12);
463
464
465
466
467static inline float mavlink_msg_set_home_position_get_y(
const mavlink_message_t* msg)
469 return _MAV_RETURN_float(msg, 16);
473
474
475
476
477static inline float mavlink_msg_set_home_position_get_z(
const mavlink_message_t* msg)
479 return _MAV_RETURN_float(msg, 20);
483
484
485
486
487static inline uint16_t mavlink_msg_set_home_position_get_q(
const mavlink_message_t* msg,
float *q)
489 return _MAV_RETURN_float_array(msg, q, 4, 24);
493
494
495
496
497static inline float mavlink_msg_set_home_position_get_approach_x(
const mavlink_message_t* msg)
499 return _MAV_RETURN_float(msg, 40);
503
504
505
506
507static inline float mavlink_msg_set_home_position_get_approach_y(
const mavlink_message_t* msg)
509 return _MAV_RETURN_float(msg, 44);
513
514
515
516
517static inline float mavlink_msg_set_home_position_get_approach_z(
const mavlink_message_t* msg)
519 return _MAV_RETURN_float(msg, 48);
523
524
525
526
527static inline uint64_t mavlink_msg_set_home_position_get_time_usec(
const mavlink_message_t* msg)
529 return _MAV_RETURN_uint64_t(msg, 53);
533
534
535
536
537
538static inline void mavlink_msg_set_home_position_decode(
const mavlink_message_t* msg, mavlink_set_home_position_t* set_home_position)
540#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
541 set_home_position->latitude = mavlink_msg_set_home_position_get_latitude(msg);
542 set_home_position->longitude = mavlink_msg_set_home_position_get_longitude(msg);
543 set_home_position->altitude = mavlink_msg_set_home_position_get_altitude(msg);
544 set_home_position->x = mavlink_msg_set_home_position_get_x(msg);
545 set_home_position->y = mavlink_msg_set_home_position_get_y(msg);
546 set_home_position->z = mavlink_msg_set_home_position_get_z(msg);
547 mavlink_msg_set_home_position_get_q(msg, set_home_position->q);
548 set_home_position->approach_x = mavlink_msg_set_home_position_get_approach_x(msg);
549 set_home_position->approach_y = mavlink_msg_set_home_position_get_approach_y(msg);
550 set_home_position->approach_z = mavlink_msg_set_home_position_get_approach_z(msg);
551 set_home_position->target_system = mavlink_msg_set_home_position_get_target_system(msg);
552 set_home_position->time_usec = mavlink_msg_set_home_position_get_time_usec(msg);
554 uint8_t len = msg->len < MAVLINK_MSG_ID_SET_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_SET_HOME_POSITION_LEN;
555 memset(set_home_position, 0, MAVLINK_MSG_ID_SET_HOME_POSITION_LEN);
556 memcpy(set_home_position, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN
Definition: mavlink_msg_set_home_position.h:23
#define MAVLINK_MSG_ID_SET_HOME_POSITION_CRC
Definition: mavlink_msg_set_home_position.h:27
#define MAVLINK_MSG_ID_SET_HOME_POSITION
Definition: mavlink_msg_set_home_position.h:4
#define MAVLINK_MSG_ID_SET_HOME_POSITION_LEN
Definition: mavlink_msg_set_home_position.h:22