Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_trajectory_representation_bezier.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE TRAJECTORY_REPRESENTATION_BEZIER PACKING
3
4#define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER 333
5
6
8 uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 float pos_x[5]; /*< [m] X-coordinate of bezier control points. Set to NaN if not being used*/
10 float pos_y[5]; /*< [m] Y-coordinate of bezier control points. Set to NaN if not being used*/
11 float pos_z[5]; /*< [m] Z-coordinate of bezier control points. Set to NaN if not being used*/
12 float delta[5]; /*< [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated*/
13 float pos_yaw[5]; /*< [rad] Yaw. Set to NaN for unchanged*/
14 uint8_t valid_points; /*< Number of valid control points (up-to 5 points are possible)*/
15} mavlink_trajectory_representation_bezier_t;
16
17#define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN 109
18#define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN 109
19#define MAVLINK_MSG_ID_333_LEN 109
20#define MAVLINK_MSG_ID_333_MIN_LEN 109
21
22#define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC 231
23#define MAVLINK_MSG_ID_333_CRC 231
24
25#define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_X_LEN 5
26#define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_Y_LEN 5
27#define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_Z_LEN 5
28#define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_DELTA_LEN 5
29#define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_BEZIER_FIELD_POS_YAW_LEN 5
30
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_BEZIER {
33 333,
34 "TRAJECTORY_REPRESENTATION_BEZIER",
35 7,
36 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_bezier_t, time_usec) },
37 { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 108, offsetof(mavlink_trajectory_representation_bezier_t, valid_points) },
38 { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_bezier_t, pos_x) },
39 { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_bezier_t, pos_y) },
40 { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_bezier_t, pos_z) },
41 { "delta", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_bezier_t, delta) },
42 { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_bezier_t, pos_yaw) },
43 } \
44}
45#else
46#define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_BEZIER {
47 "TRAJECTORY_REPRESENTATION_BEZIER",
48 7,
49 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_bezier_t, time_usec) },
50 { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 108, offsetof(mavlink_trajectory_representation_bezier_t, valid_points) },
51 { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_bezier_t, pos_x) },
52 { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_bezier_t, pos_y) },
53 { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_bezier_t, pos_z) },
54 { "delta", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_bezier_t, delta) },
55 { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_bezier_t, pos_yaw) },
56 } \
57}
58#endif
59
60/**
61 * @brief Pack a trajectory_representation_bezier message
62 * @param system_id ID of this system
63 * @param component_id ID of this component (e.g. 200 for IMU)
64 * @param msg The MAVLink message to compress the data into
65 *
66 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
67 * @param valid_points Number of valid control points (up-to 5 points are possible)
68 * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
69 * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
70 * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
71 * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
72 * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
73 * @return length of the message in bytes (excluding serial stream start sign)
74 */
75static inline uint16_t mavlink_msg_trajectory_representation_bezier_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
76 uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
77{
78#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
80 _mav_put_uint64_t(buf, 0, time_usec);
81 _mav_put_uint8_t(buf, 108, valid_points);
82 _mav_put_float_array(buf, 8, pos_x, 5);
83 _mav_put_float_array(buf, 28, pos_y, 5);
84 _mav_put_float_array(buf, 48, pos_z, 5);
85 _mav_put_float_array(buf, 68, delta, 5);
86 _mav_put_float_array(buf, 88, pos_yaw, 5);
87 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
88#else
89 mavlink_trajectory_representation_bezier_t packet;
90 packet.time_usec = time_usec;
91 packet.valid_points = valid_points;
92 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
93 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
94 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
95 mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
96 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
97 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
98#endif
99
102}
103
104/**
105 * @brief Pack a trajectory_representation_bezier message
106 * @param system_id ID of this system
107 * @param component_id ID of this component (e.g. 200 for IMU)
108 * @param status MAVLink status structure
109 * @param msg The MAVLink message to compress the data into
110 *
111 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
112 * @param valid_points Number of valid control points (up-to 5 points are possible)
113 * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
114 * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
115 * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
116 * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
117 * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
118 * @return length of the message in bytes (excluding serial stream start sign)
119 */
120static inline uint16_t mavlink_msg_trajectory_representation_bezier_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
121 uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
122{
123#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
125 _mav_put_uint64_t(buf, 0, time_usec);
126 _mav_put_uint8_t(buf, 108, valid_points);
127 _mav_put_float_array(buf, 8, pos_x, 5);
128 _mav_put_float_array(buf, 28, pos_y, 5);
129 _mav_put_float_array(buf, 48, pos_z, 5);
130 _mav_put_float_array(buf, 68, delta, 5);
131 _mav_put_float_array(buf, 88, pos_yaw, 5);
132 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
133#else
134 mavlink_trajectory_representation_bezier_t packet;
135 packet.time_usec = time_usec;
136 packet.valid_points = valid_points;
137 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
138 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
139 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
140 mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
141 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
142 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
143#endif
144
146#if MAVLINK_CRC_EXTRA
147 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
148#else
149 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
150#endif
151}
152
153/**
154 * @brief Pack a trajectory_representation_bezier message on a channel
155 * @param system_id ID of this system
156 * @param component_id ID of this component (e.g. 200 for IMU)
157 * @param chan The MAVLink channel this message will be sent over
158 * @param msg The MAVLink message to compress the data into
159 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
160 * @param valid_points Number of valid control points (up-to 5 points are possible)
161 * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
162 * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
163 * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
164 * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
165 * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
166 * @return length of the message in bytes (excluding serial stream start sign)
167 */
168static inline uint16_t mavlink_msg_trajectory_representation_bezier_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
169 mavlink_message_t* msg,
170 uint64_t time_usec,uint8_t valid_points,const float *pos_x,const float *pos_y,const float *pos_z,const float *delta,const float *pos_yaw)
171{
172#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
174 _mav_put_uint64_t(buf, 0, time_usec);
175 _mav_put_uint8_t(buf, 108, valid_points);
176 _mav_put_float_array(buf, 8, pos_x, 5);
177 _mav_put_float_array(buf, 28, pos_y, 5);
178 _mav_put_float_array(buf, 48, pos_z, 5);
179 _mav_put_float_array(buf, 68, delta, 5);
180 _mav_put_float_array(buf, 88, pos_yaw, 5);
181 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
182#else
183 mavlink_trajectory_representation_bezier_t packet;
184 packet.time_usec = time_usec;
185 packet.valid_points = valid_points;
186 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
187 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
188 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
189 mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
190 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
191 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
192#endif
193
196}
197
198/**
199 * @brief Encode a trajectory_representation_bezier struct
200 *
201 * @param system_id ID of this system
202 * @param component_id ID of this component (e.g. 200 for IMU)
203 * @param msg The MAVLink message to compress the data into
204 * @param trajectory_representation_bezier C-struct to read the message contents from
205 */
206static inline uint16_t mavlink_msg_trajectory_representation_bezier_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
207{
208 return mavlink_msg_trajectory_representation_bezier_pack(system_id, component_id, msg, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
209}
210
211/**
212 * @brief Encode a trajectory_representation_bezier struct on a channel
213 *
214 * @param system_id ID of this system
215 * @param component_id ID of this component (e.g. 200 for IMU)
216 * @param chan The MAVLink channel this message will be sent over
217 * @param msg The MAVLink message to compress the data into
218 * @param trajectory_representation_bezier C-struct to read the message contents from
219 */
220static inline uint16_t mavlink_msg_trajectory_representation_bezier_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
221{
222 return mavlink_msg_trajectory_representation_bezier_pack_chan(system_id, component_id, chan, msg, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
223}
224
225/**
226 * @brief Encode a trajectory_representation_bezier struct with provided status structure
227 *
228 * @param system_id ID of this system
229 * @param component_id ID of this component (e.g. 200 for IMU)
230 * @param status MAVLink status structure
231 * @param msg The MAVLink message to compress the data into
232 * @param trajectory_representation_bezier C-struct to read the message contents from
233 */
234static inline uint16_t mavlink_msg_trajectory_representation_bezier_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
235{
236 return mavlink_msg_trajectory_representation_bezier_pack_status(system_id, component_id, _status, msg, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
237}
238
239/**
240 * @brief Send a trajectory_representation_bezier message
241 * @param chan MAVLink channel to send the message
242 *
243 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
244 * @param valid_points Number of valid control points (up-to 5 points are possible)
245 * @param pos_x [m] X-coordinate of bezier control points. Set to NaN if not being used
246 * @param pos_y [m] Y-coordinate of bezier control points. Set to NaN if not being used
247 * @param pos_z [m] Z-coordinate of bezier control points. Set to NaN if not being used
248 * @param delta [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
249 * @param pos_yaw [rad] Yaw. Set to NaN for unchanged
250 */
251#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
252
253static inline void mavlink_msg_trajectory_representation_bezier_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
254{
255#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
256 char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN];
257 _mav_put_uint64_t(buf, 0, time_usec);
258 _mav_put_uint8_t(buf, 108, valid_points);
259 _mav_put_float_array(buf, 8, pos_x, 5);
260 _mav_put_float_array(buf, 28, pos_y, 5);
261 _mav_put_float_array(buf, 48, pos_z, 5);
262 _mav_put_float_array(buf, 68, delta, 5);
263 _mav_put_float_array(buf, 88, pos_yaw, 5);
264 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
265#else
266 mavlink_trajectory_representation_bezier_t packet;
267 packet.time_usec = time_usec;
268 packet.valid_points = valid_points;
269 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
270 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
271 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
272 mav_array_memcpy(packet.delta, delta, sizeof(float)*5);
273 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
274 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, (const char *)&packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
275#endif
276}
277
278/**
279 * @brief Send a trajectory_representation_bezier message
280 * @param chan MAVLink channel to send the message
281 * @param struct The MAVLink struct to serialize
282 */
283static inline void mavlink_msg_trajectory_representation_bezier_send_struct(mavlink_channel_t chan, const mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
284{
285#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
286 mavlink_msg_trajectory_representation_bezier_send(chan, trajectory_representation_bezier->time_usec, trajectory_representation_bezier->valid_points, trajectory_representation_bezier->pos_x, trajectory_representation_bezier->pos_y, trajectory_representation_bezier->pos_z, trajectory_representation_bezier->delta, trajectory_representation_bezier->pos_yaw);
287#else
288 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, (const char *)trajectory_representation_bezier, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
289#endif
290}
291
292#if MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN <= MAVLINK_MAX_PAYLOAD_LEN
293/*
294 This variant of _send() can be used to save stack space by reusing
295 memory from the receive buffer. The caller provides a
296 mavlink_message_t which is the size of a full mavlink message. This
297 is usually the receive buffer for the channel, and allows a reply to an
298 incoming message with minimum stack space usage.
299 */
300static inline void mavlink_msg_trajectory_representation_bezier_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *delta, const float *pos_yaw)
301{
302#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
303 char *buf = (char *)msgbuf;
304 _mav_put_uint64_t(buf, 0, time_usec);
305 _mav_put_uint8_t(buf, 108, valid_points);
306 _mav_put_float_array(buf, 8, pos_x, 5);
307 _mav_put_float_array(buf, 28, pos_y, 5);
308 _mav_put_float_array(buf, 48, pos_z, 5);
309 _mav_put_float_array(buf, 68, delta, 5);
310 _mav_put_float_array(buf, 88, pos_yaw, 5);
311 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
312#else
313 mavlink_trajectory_representation_bezier_t *packet = (mavlink_trajectory_representation_bezier_t *)msgbuf;
314 packet->time_usec = time_usec;
315 packet->valid_points = valid_points;
316 mav_array_memcpy(packet->pos_x, pos_x, sizeof(float)*5);
317 mav_array_memcpy(packet->pos_y, pos_y, sizeof(float)*5);
318 mav_array_memcpy(packet->pos_z, pos_z, sizeof(float)*5);
319 mav_array_memcpy(packet->delta, delta, sizeof(float)*5);
320 mav_array_memcpy(packet->pos_yaw, pos_yaw, sizeof(float)*5);
321 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER, (const char *)packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_CRC);
322#endif
323}
324#endif
325
326#endif
327
328// MESSAGE TRAJECTORY_REPRESENTATION_BEZIER UNPACKING
329
330
331/**
332 * @brief Get field time_usec from trajectory_representation_bezier message
333 *
334 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
335 */
336static inline uint64_t mavlink_msg_trajectory_representation_bezier_get_time_usec(const mavlink_message_t* msg)
337{
338 return _MAV_RETURN_uint64_t(msg, 0);
339}
340
341/**
342 * @brief Get field valid_points from trajectory_representation_bezier message
343 *
344 * @return Number of valid control points (up-to 5 points are possible)
345 */
346static inline uint8_t mavlink_msg_trajectory_representation_bezier_get_valid_points(const mavlink_message_t* msg)
347{
348 return _MAV_RETURN_uint8_t(msg, 108);
349}
350
351/**
352 * @brief Get field pos_x from trajectory_representation_bezier message
353 *
354 * @return [m] X-coordinate of bezier control points. Set to NaN if not being used
355 */
356static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_x(const mavlink_message_t* msg, float *pos_x)
357{
358 return _MAV_RETURN_float_array(msg, pos_x, 5, 8);
359}
360
361/**
362 * @brief Get field pos_y from trajectory_representation_bezier message
363 *
364 * @return [m] Y-coordinate of bezier control points. Set to NaN if not being used
365 */
366static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_y(const mavlink_message_t* msg, float *pos_y)
367{
368 return _MAV_RETURN_float_array(msg, pos_y, 5, 28);
369}
370
371/**
372 * @brief Get field pos_z from trajectory_representation_bezier message
373 *
374 * @return [m] Z-coordinate of bezier control points. Set to NaN if not being used
375 */
376static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_z(const mavlink_message_t* msg, float *pos_z)
377{
378 return _MAV_RETURN_float_array(msg, pos_z, 5, 48);
379}
380
381/**
382 * @brief Get field delta from trajectory_representation_bezier message
383 *
384 * @return [s] Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated
385 */
386static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_delta(const mavlink_message_t* msg, float *delta)
387{
388 return _MAV_RETURN_float_array(msg, delta, 5, 68);
389}
390
391/**
392 * @brief Get field pos_yaw from trajectory_representation_bezier message
393 *
394 * @return [rad] Yaw. Set to NaN for unchanged
395 */
396static inline uint16_t mavlink_msg_trajectory_representation_bezier_get_pos_yaw(const mavlink_message_t* msg, float *pos_yaw)
397{
398 return _MAV_RETURN_float_array(msg, pos_yaw, 5, 88);
399}
400
401/**
402 * @brief Decode a trajectory_representation_bezier message into a struct
403 *
404 * @param msg The message to decode
405 * @param trajectory_representation_bezier C-struct to decode the message contents into
406 */
407static inline void mavlink_msg_trajectory_representation_bezier_decode(const mavlink_message_t* msg, mavlink_trajectory_representation_bezier_t* trajectory_representation_bezier)
408{
409#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
410 trajectory_representation_bezier->time_usec = mavlink_msg_trajectory_representation_bezier_get_time_usec(msg);
411 mavlink_msg_trajectory_representation_bezier_get_pos_x(msg, trajectory_representation_bezier->pos_x);
412 mavlink_msg_trajectory_representation_bezier_get_pos_y(msg, trajectory_representation_bezier->pos_y);
413 mavlink_msg_trajectory_representation_bezier_get_pos_z(msg, trajectory_representation_bezier->pos_z);
414 mavlink_msg_trajectory_representation_bezier_get_delta(msg, trajectory_representation_bezier->delta);
415 mavlink_msg_trajectory_representation_bezier_get_pos_yaw(msg, trajectory_representation_bezier->pos_yaw);
416 trajectory_representation_bezier->valid_points = mavlink_msg_trajectory_representation_bezier_get_valid_points(msg);
417#else
418 uint8_t len = msg->len < MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN? msg->len : MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN;
419 memset(trajectory_representation_bezier, 0, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_LEN);
420 memcpy(trajectory_representation_bezier, _MAV_PAYLOAD(msg), len);
421#endif
422}