4#define MAVLINK_MSG_ID_HOME_POSITION 242
7typedef struct __mavlink_home_position_t {
15
16
17
18
23}) mavlink_home_position_t;
25#define MAVLINK_MSG_ID_HOME_POSITION_LEN 60
26#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN 52
27#define MAVLINK_MSG_ID_242_LEN 60
28#define MAVLINK_MSG_ID_242_MIN_LEN 52
30#define MAVLINK_MSG_ID_HOME_POSITION_CRC 104
31#define MAVLINK_MSG_ID_242_CRC 104
33#define MAVLINK_MSG_HOME_POSITION_FIELD_Q_LEN 4
35#if MAVLINK_COMMAND_24BIT
36#define MAVLINK_MESSAGE_INFO_HOME_POSITION {
40 { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0
, 0
, offsetof(mavlink_home_position_t, latitude) },
41 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0
, 4
, offsetof(mavlink_home_position_t, longitude) },
42 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0
, 8
, offsetof(mavlink_home_position_t, altitude) },
43 { "x", NULL, MAVLINK_TYPE_FLOAT, 0
, 12
, offsetof(mavlink_home_position_t, x) },
44 { "y", NULL, MAVLINK_TYPE_FLOAT, 0
, 16
, offsetof(mavlink_home_position_t, y) },
45 { "z", NULL, MAVLINK_TYPE_FLOAT, 0
, 20
, offsetof(mavlink_home_position_t, z) },
46 { "q", NULL, MAVLINK_TYPE_FLOAT, 4
, 24
, offsetof(mavlink_home_position_t, q) },
47 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0
, 40
, offsetof(mavlink_home_position_t, approach_x) },
48 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0
, 44
, offsetof(mavlink_home_position_t, approach_y) },
49 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0
, 48
, offsetof(mavlink_home_position_t, approach_z) },
50 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0
, 52
, offsetof(mavlink_home_position_t, time_usec) },
52}
54#define MAVLINK_MESSAGE_INFO_HOME_POSITION {
57 { { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0
, 0
, offsetof(mavlink_home_position_t, latitude) },
58 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0
, 4
, offsetof(mavlink_home_position_t, longitude) },
59 { "altitude", NULL, MAVLINK_TYPE_INT32_T, 0
, 8
, offsetof(mavlink_home_position_t, altitude) },
60 { "x", NULL, MAVLINK_TYPE_FLOAT, 0
, 12
, offsetof(mavlink_home_position_t, x) },
61 { "y", NULL, MAVLINK_TYPE_FLOAT, 0
, 16
, offsetof(mavlink_home_position_t, y) },
62 { "z", NULL, MAVLINK_TYPE_FLOAT, 0
, 20
, offsetof(mavlink_home_position_t, z) },
63 { "q", NULL, MAVLINK_TYPE_FLOAT, 4
, 24
, offsetof(mavlink_home_position_t, q) },
64 { "approach_x", NULL, MAVLINK_TYPE_FLOAT, 0
, 40
, offsetof(mavlink_home_position_t, approach_x) },
65 { "approach_y", NULL, MAVLINK_TYPE_FLOAT, 0
, 44
, offsetof(mavlink_home_position_t, approach_y) },
66 { "approach_z", NULL, MAVLINK_TYPE_FLOAT, 0
, 48
, offsetof(mavlink_home_position_t, approach_z) },
67 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0
, 52
, offsetof(mavlink_home_position_t, time_usec) },
69}
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95static inline uint16_t mavlink_msg_home_position_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
96 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)
98#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
100 _mav_put_int32_t(buf, 0, latitude);
101 _mav_put_int32_t(buf, 4, longitude);
102 _mav_put_int32_t(buf, 8, altitude);
103 _mav_put_float(buf, 12, x);
104 _mav_put_float(buf, 16, y);
105 _mav_put_float(buf, 20, z);
106 _mav_put_float(buf, 40, approach_x);
107 _mav_put_float(buf, 44, approach_y);
108 _mav_put_float(buf, 48, approach_z);
109 _mav_put_uint64_t(buf, 52, time_usec);
110 _mav_put_float_array(buf, 24, q, 4);
113 mavlink_home_position_t packet;
114 packet.latitude = latitude;
115 packet.longitude = longitude;
116 packet.altitude = altitude;
120 packet.approach_x = approach_x;
121 packet.approach_y = approach_y;
122 packet.approach_z = approach_z;
123 packet.time_usec = time_usec;
124 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156static inline uint16_t mavlink_msg_home_position_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
157 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)
159#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
161 _mav_put_int32_t(buf, 0, latitude);
162 _mav_put_int32_t(buf, 4, longitude);
163 _mav_put_int32_t(buf, 8, altitude);
164 _mav_put_float(buf, 12, x);
165 _mav_put_float(buf, 16, y);
166 _mav_put_float(buf, 20, z);
167 _mav_put_float(buf, 40, approach_x);
168 _mav_put_float(buf, 44, approach_y);
169 _mav_put_float(buf, 48, approach_z);
170 _mav_put_uint64_t(buf, 52, time_usec);
171 _mav_put_float_array(buf, 24, q, 4);
174 mavlink_home_position_t packet;
175 packet.latitude = latitude;
176 packet.longitude = longitude;
177 packet.altitude = altitude;
181 packet.approach_x = approach_x;
182 packet.approach_y = approach_y;
183 packet.approach_z = approach_z;
184 packet.time_usec = time_usec;
185 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
186 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
191 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN, MAVLINK_MSG_ID_HOME_POSITION_LEN, MAVLINK_MSG_ID_HOME_POSITION_CRC);
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220static inline uint16_t mavlink_msg_home_position_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
221 mavlink_message_t* msg,
222 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)
224#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
226 _mav_put_int32_t(buf, 0, latitude);
227 _mav_put_int32_t(buf, 4, longitude);
228 _mav_put_int32_t(buf, 8, altitude);
229 _mav_put_float(buf, 12, x);
230 _mav_put_float(buf, 16, y);
231 _mav_put_float(buf, 20, z);
232 _mav_put_float(buf, 40, approach_x);
233 _mav_put_float(buf, 44, approach_y);
234 _mav_put_float(buf, 48, approach_z);
235 _mav_put_uint64_t(buf, 52, time_usec);
236 _mav_put_float_array(buf, 24, q, 4);
239 mavlink_home_position_t packet;
240 packet.latitude = latitude;
241 packet.longitude = longitude;
242 packet.altitude = altitude;
246 packet.approach_x = approach_x;
247 packet.approach_y = approach_y;
248 packet.approach_z = approach_z;
249 packet.time_usec = time_usec;
250 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
251 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HOME_POSITION_LEN);
259
260
261
262
263
264
265
266static 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)
268 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);
272
273
274
275
276
277
278
279
280static 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)
282 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);
286
287
288
289
290
291
292
293
294static inline uint16_t mavlink_msg_home_position_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_home_position_t* home_position)
296 return mavlink_msg_home_position_pack_status(system_id, component_id, _status, 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);
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
321static 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)
323#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
324 char buf[MAVLINK_MSG_ID_HOME_POSITION_LEN];
325 _mav_put_int32_t(buf, 0, latitude);
326 _mav_put_int32_t(buf, 4, longitude);
327 _mav_put_int32_t(buf, 8, altitude);
328 _mav_put_float(buf, 12, x);
329 _mav_put_float(buf, 16, y);
330 _mav_put_float(buf, 20, z);
331 _mav_put_float(buf, 40, approach_x);
332 _mav_put_float(buf, 44, approach_y);
333 _mav_put_float(buf, 48, approach_z);
334 _mav_put_uint64_t(buf, 52, time_usec);
335 _mav_put_float_array(buf, 24, q, 4);
336 _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);
338 mavlink_home_position_t packet;
339 packet.latitude = latitude;
340 packet.longitude = longitude;
341 packet.altitude = altitude;
345 packet.approach_x = approach_x;
346 packet.approach_y = approach_y;
347 packet.approach_z = approach_z;
348 packet.time_usec = time_usec;
349 mav_array_memcpy(packet.q, q,
sizeof(
float)*4);
350 _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);
355
356
357
358
359static inline void mavlink_msg_home_position_send_struct(mavlink_channel_t chan,
const mavlink_home_position_t* home_position)
361#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
362 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);
364 _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);
368#if MAVLINK_MSG_ID_HOME_POSITION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
370
371
372
373
374
375
376static 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)
378#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
379 char *buf = (
char *)msgbuf;
380 _mav_put_int32_t(buf, 0, latitude);
381 _mav_put_int32_t(buf, 4, longitude);
382 _mav_put_int32_t(buf, 8, altitude);
383 _mav_put_float(buf, 12, x);
384 _mav_put_float(buf, 16, y);
385 _mav_put_float(buf, 20, z);
386 _mav_put_float(buf, 40, approach_x);
387 _mav_put_float(buf, 44, approach_y);
388 _mav_put_float(buf, 48, approach_z);
389 _mav_put_uint64_t(buf, 52, time_usec);
390 _mav_put_float_array(buf, 24, q, 4);
391 _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);
393 mavlink_home_position_t *packet = (mavlink_home_position_t *)msgbuf;
394 packet->latitude = latitude;
395 packet->longitude = longitude;
396 packet->altitude = altitude;
400 packet->approach_x = approach_x;
401 packet->approach_y = approach_y;
402 packet->approach_z = approach_z;
403 packet->time_usec = time_usec;
404 mav_array_memcpy(packet->q, q,
sizeof(
float)*4);
405 _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);
416
417
418
419
420static inline int32_t mavlink_msg_home_position_get_latitude(
const mavlink_message_t* msg)
422 return _MAV_RETURN_int32_t(msg, 0);
426
427
428
429
430static inline int32_t mavlink_msg_home_position_get_longitude(
const mavlink_message_t* msg)
432 return _MAV_RETURN_int32_t(msg, 4);
436
437
438
439
440static inline int32_t mavlink_msg_home_position_get_altitude(
const mavlink_message_t* msg)
442 return _MAV_RETURN_int32_t(msg, 8);
446
447
448
449
450static inline float mavlink_msg_home_position_get_x(
const mavlink_message_t* msg)
452 return _MAV_RETURN_float(msg, 12);
456
457
458
459
460static inline float mavlink_msg_home_position_get_y(
const mavlink_message_t* msg)
462 return _MAV_RETURN_float(msg, 16);
466
467
468
469
470static inline float mavlink_msg_home_position_get_z(
const mavlink_message_t* msg)
472 return _MAV_RETURN_float(msg, 20);
476
477
478
479
480
481
482
483
484static inline uint16_t mavlink_msg_home_position_get_q(
const mavlink_message_t* msg,
float *q)
486 return _MAV_RETURN_float_array(msg, q, 4, 24);
490
491
492
493
494static inline float mavlink_msg_home_position_get_approach_x(
const mavlink_message_t* msg)
496 return _MAV_RETURN_float(msg, 40);
500
501
502
503
504static inline float mavlink_msg_home_position_get_approach_y(
const mavlink_message_t* msg)
506 return _MAV_RETURN_float(msg, 44);
510
511
512
513
514static inline float mavlink_msg_home_position_get_approach_z(
const mavlink_message_t* msg)
516 return _MAV_RETURN_float(msg, 48);
520
521
522
523
524static inline uint64_t mavlink_msg_home_position_get_time_usec(
const mavlink_message_t* msg)
526 return _MAV_RETURN_uint64_t(msg, 52);
530
531
532
533
534
535static inline void mavlink_msg_home_position_decode(
const mavlink_message_t* msg, mavlink_home_position_t* home_position)
537#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
538 home_position->latitude = mavlink_msg_home_position_get_latitude(msg);
539 home_position->longitude = mavlink_msg_home_position_get_longitude(msg);
540 home_position->altitude = mavlink_msg_home_position_get_altitude(msg);
541 home_position->x = mavlink_msg_home_position_get_x(msg);
542 home_position->y = mavlink_msg_home_position_get_y(msg);
543 home_position->z = mavlink_msg_home_position_get_z(msg);
544 mavlink_msg_home_position_get_q(msg, home_position->q);
545 home_position->approach_x = mavlink_msg_home_position_get_approach_x(msg);
546 home_position->approach_y = mavlink_msg_home_position_get_approach_y(msg);
547 home_position->approach_z = mavlink_msg_home_position_get_approach_z(msg);
548 home_position->time_usec = mavlink_msg_home_position_get_time_usec(msg);
550 uint8_t len = msg->len < MAVLINK_MSG_ID_HOME_POSITION_LEN? msg->len : MAVLINK_MSG_ID_HOME_POSITION_LEN;
551 memset(home_position, 0, MAVLINK_MSG_ID_HOME_POSITION_LEN);
552 memcpy(home_position, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_HOME_POSITION
Definition: mavlink_msg_home_position.h:4
#define MAVLINK_MSG_ID_HOME_POSITION_CRC
Definition: mavlink_msg_home_position.h:30
#define MAVLINK_MSG_ID_HOME_POSITION_LEN
Definition: mavlink_msg_home_position.h:25
#define MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN
Definition: mavlink_msg_home_position.h:26