before merging master
[inav.git] / lib / main / MAVLink / common / mavlink_msg_trajectory_representation_waypoints.h
blob470c4626fa759d27daf1885b380c0167acb4025d
1 #pragma once
2 // MESSAGE TRAJECTORY_REPRESENTATION_WAYPOINTS PACKING
4 #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS 332
7 typedef struct __mavlink_trajectory_representation_waypoints_t {
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 waypoint, set to NaN if not being used*/
10 float pos_y[5]; /*< [m] Y-coordinate of waypoint, set to NaN if not being used*/
11 float pos_z[5]; /*< [m] Z-coordinate of waypoint, set to NaN if not being used*/
12 float vel_x[5]; /*< [m/s] X-velocity of waypoint, set to NaN if not being used*/
13 float vel_y[5]; /*< [m/s] Y-velocity of waypoint, set to NaN if not being used*/
14 float vel_z[5]; /*< [m/s] Z-velocity of waypoint, set to NaN if not being used*/
15 float acc_x[5]; /*< [m/s/s] X-acceleration of waypoint, set to NaN if not being used*/
16 float acc_y[5]; /*< [m/s/s] Y-acceleration of waypoint, set to NaN if not being used*/
17 float acc_z[5]; /*< [m/s/s] Z-acceleration of waypoint, set to NaN if not being used*/
18 float pos_yaw[5]; /*< [rad] Yaw angle, set to NaN if not being used*/
19 float vel_yaw[5]; /*< [rad/s] Yaw rate, set to NaN if not being used*/
20 uint16_t command[5]; /*< Scheduled action for each waypoint, UINT16_MAX if not being used.*/
21 uint8_t valid_points; /*< Number of valid points (up-to 5 waypoints are possible)*/
22 } mavlink_trajectory_representation_waypoints_t;
24 #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN 239
25 #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN 239
26 #define MAVLINK_MSG_ID_332_LEN 239
27 #define MAVLINK_MSG_ID_332_MIN_LEN 239
29 #define MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC 236
30 #define MAVLINK_MSG_ID_332_CRC 236
32 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_X_LEN 5
33 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_Y_LEN 5
34 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_Z_LEN 5
35 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_X_LEN 5
36 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_Y_LEN 5
37 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_Z_LEN 5
38 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_ACC_X_LEN 5
39 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_ACC_Y_LEN 5
40 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_ACC_Z_LEN 5
41 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_POS_YAW_LEN 5
42 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_VEL_YAW_LEN 5
43 #define MAVLINK_MSG_TRAJECTORY_REPRESENTATION_WAYPOINTS_FIELD_COMMAND_LEN 5
45 #if MAVLINK_COMMAND_24BIT
46 #define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_WAYPOINTS { \
47 332, \
48 "TRAJECTORY_REPRESENTATION_WAYPOINTS", \
49 14, \
50 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_waypoints_t, time_usec) }, \
51 { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 238, offsetof(mavlink_trajectory_representation_waypoints_t, valid_points) }, \
52 { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_waypoints_t, pos_x) }, \
53 { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_waypoints_t, pos_y) }, \
54 { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_waypoints_t, pos_z) }, \
55 { "vel_x", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_waypoints_t, vel_x) }, \
56 { "vel_y", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_waypoints_t, vel_y) }, \
57 { "vel_z", NULL, MAVLINK_TYPE_FLOAT, 5, 108, offsetof(mavlink_trajectory_representation_waypoints_t, vel_z) }, \
58 { "acc_x", NULL, MAVLINK_TYPE_FLOAT, 5, 128, offsetof(mavlink_trajectory_representation_waypoints_t, acc_x) }, \
59 { "acc_y", NULL, MAVLINK_TYPE_FLOAT, 5, 148, offsetof(mavlink_trajectory_representation_waypoints_t, acc_y) }, \
60 { "acc_z", NULL, MAVLINK_TYPE_FLOAT, 5, 168, offsetof(mavlink_trajectory_representation_waypoints_t, acc_z) }, \
61 { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 188, offsetof(mavlink_trajectory_representation_waypoints_t, pos_yaw) }, \
62 { "vel_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 208, offsetof(mavlink_trajectory_representation_waypoints_t, vel_yaw) }, \
63 { "command", NULL, MAVLINK_TYPE_UINT16_T, 5, 228, offsetof(mavlink_trajectory_representation_waypoints_t, command) }, \
64 } \
66 #else
67 #define MAVLINK_MESSAGE_INFO_TRAJECTORY_REPRESENTATION_WAYPOINTS { \
68 "TRAJECTORY_REPRESENTATION_WAYPOINTS", \
69 14, \
70 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_trajectory_representation_waypoints_t, time_usec) }, \
71 { "valid_points", NULL, MAVLINK_TYPE_UINT8_T, 0, 238, offsetof(mavlink_trajectory_representation_waypoints_t, valid_points) }, \
72 { "pos_x", NULL, MAVLINK_TYPE_FLOAT, 5, 8, offsetof(mavlink_trajectory_representation_waypoints_t, pos_x) }, \
73 { "pos_y", NULL, MAVLINK_TYPE_FLOAT, 5, 28, offsetof(mavlink_trajectory_representation_waypoints_t, pos_y) }, \
74 { "pos_z", NULL, MAVLINK_TYPE_FLOAT, 5, 48, offsetof(mavlink_trajectory_representation_waypoints_t, pos_z) }, \
75 { "vel_x", NULL, MAVLINK_TYPE_FLOAT, 5, 68, offsetof(mavlink_trajectory_representation_waypoints_t, vel_x) }, \
76 { "vel_y", NULL, MAVLINK_TYPE_FLOAT, 5, 88, offsetof(mavlink_trajectory_representation_waypoints_t, vel_y) }, \
77 { "vel_z", NULL, MAVLINK_TYPE_FLOAT, 5, 108, offsetof(mavlink_trajectory_representation_waypoints_t, vel_z) }, \
78 { "acc_x", NULL, MAVLINK_TYPE_FLOAT, 5, 128, offsetof(mavlink_trajectory_representation_waypoints_t, acc_x) }, \
79 { "acc_y", NULL, MAVLINK_TYPE_FLOAT, 5, 148, offsetof(mavlink_trajectory_representation_waypoints_t, acc_y) }, \
80 { "acc_z", NULL, MAVLINK_TYPE_FLOAT, 5, 168, offsetof(mavlink_trajectory_representation_waypoints_t, acc_z) }, \
81 { "pos_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 188, offsetof(mavlink_trajectory_representation_waypoints_t, pos_yaw) }, \
82 { "vel_yaw", NULL, MAVLINK_TYPE_FLOAT, 5, 208, offsetof(mavlink_trajectory_representation_waypoints_t, vel_yaw) }, \
83 { "command", NULL, MAVLINK_TYPE_UINT16_T, 5, 228, offsetof(mavlink_trajectory_representation_waypoints_t, command) }, \
84 } \
86 #endif
88 /**
89 * @brief Pack a trajectory_representation_waypoints message
90 * @param system_id ID of this system
91 * @param component_id ID of this component (e.g. 200 for IMU)
92 * @param msg The MAVLink message to compress the data into
94 * @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.
95 * @param valid_points Number of valid points (up-to 5 waypoints are possible)
96 * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
97 * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
98 * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
99 * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
100 * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
101 * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
102 * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
103 * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
104 * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
105 * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
106 * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
107 * @param command Scheduled action for each waypoint, UINT16_MAX if not being used.
108 * @return length of the message in bytes (excluding serial stream start sign)
110 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
111 uint64_t time_usec, uint8_t valid_points, const float *pos_x, const float *pos_y, const float *pos_z, const float *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
113 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
114 char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
115 _mav_put_uint64_t(buf, 0, time_usec);
116 _mav_put_uint8_t(buf, 238, valid_points);
117 _mav_put_float_array(buf, 8, pos_x, 5);
118 _mav_put_float_array(buf, 28, pos_y, 5);
119 _mav_put_float_array(buf, 48, pos_z, 5);
120 _mav_put_float_array(buf, 68, vel_x, 5);
121 _mav_put_float_array(buf, 88, vel_y, 5);
122 _mav_put_float_array(buf, 108, vel_z, 5);
123 _mav_put_float_array(buf, 128, acc_x, 5);
124 _mav_put_float_array(buf, 148, acc_y, 5);
125 _mav_put_float_array(buf, 168, acc_z, 5);
126 _mav_put_float_array(buf, 188, pos_yaw, 5);
127 _mav_put_float_array(buf, 208, vel_yaw, 5);
128 _mav_put_uint16_t_array(buf, 228, command, 5);
129 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
130 #else
131 mavlink_trajectory_representation_waypoints_t packet;
132 packet.time_usec = time_usec;
133 packet.valid_points = valid_points;
134 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
135 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
136 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
137 mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
138 mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
139 mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
140 mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
141 mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
142 mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
143 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
144 mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
145 mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
146 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
147 #endif
149 msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS;
150 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
154 * @brief Pack a trajectory_representation_waypoints 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 points (up-to 5 waypoints are possible)
161 * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
162 * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
163 * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
164 * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
165 * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
166 * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
167 * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
168 * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
169 * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
170 * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
171 * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
172 * @param command Scheduled action for each waypoint, UINT16_MAX if not being used.
173 * @return length of the message in bytes (excluding serial stream start sign)
175 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
176 mavlink_message_t* msg,
177 uint64_t time_usec,uint8_t valid_points,const float *pos_x,const float *pos_y,const float *pos_z,const float *vel_x,const float *vel_y,const float *vel_z,const float *acc_x,const float *acc_y,const float *acc_z,const float *pos_yaw,const float *vel_yaw,const uint16_t *command)
179 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
180 char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
181 _mav_put_uint64_t(buf, 0, time_usec);
182 _mav_put_uint8_t(buf, 238, valid_points);
183 _mav_put_float_array(buf, 8, pos_x, 5);
184 _mav_put_float_array(buf, 28, pos_y, 5);
185 _mav_put_float_array(buf, 48, pos_z, 5);
186 _mav_put_float_array(buf, 68, vel_x, 5);
187 _mav_put_float_array(buf, 88, vel_y, 5);
188 _mav_put_float_array(buf, 108, vel_z, 5);
189 _mav_put_float_array(buf, 128, acc_x, 5);
190 _mav_put_float_array(buf, 148, acc_y, 5);
191 _mav_put_float_array(buf, 168, acc_z, 5);
192 _mav_put_float_array(buf, 188, pos_yaw, 5);
193 _mav_put_float_array(buf, 208, vel_yaw, 5);
194 _mav_put_uint16_t_array(buf, 228, command, 5);
195 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
196 #else
197 mavlink_trajectory_representation_waypoints_t packet;
198 packet.time_usec = time_usec;
199 packet.valid_points = valid_points;
200 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
201 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
202 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
203 mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
204 mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
205 mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
206 mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
207 mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
208 mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
209 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
210 mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
211 mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
212 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
213 #endif
215 msg->msgid = MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS;
216 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
220 * @brief Encode a trajectory_representation_waypoints struct
222 * @param system_id ID of this system
223 * @param component_id ID of this component (e.g. 200 for IMU)
224 * @param msg The MAVLink message to compress the data into
225 * @param trajectory_representation_waypoints C-struct to read the message contents from
227 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
229 return mavlink_msg_trajectory_representation_waypoints_pack(system_id, component_id, msg, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
233 * @brief Encode a trajectory_representation_waypoints struct on a channel
235 * @param system_id ID of this system
236 * @param component_id ID of this component (e.g. 200 for IMU)
237 * @param chan The MAVLink channel this message will be sent over
238 * @param msg The MAVLink message to compress the data into
239 * @param trajectory_representation_waypoints C-struct to read the message contents from
241 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
243 return mavlink_msg_trajectory_representation_waypoints_pack_chan(system_id, component_id, chan, msg, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
247 * @brief Send a trajectory_representation_waypoints message
248 * @param chan MAVLink channel to send the message
250 * @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.
251 * @param valid_points Number of valid points (up-to 5 waypoints are possible)
252 * @param pos_x [m] X-coordinate of waypoint, set to NaN if not being used
253 * @param pos_y [m] Y-coordinate of waypoint, set to NaN if not being used
254 * @param pos_z [m] Z-coordinate of waypoint, set to NaN if not being used
255 * @param vel_x [m/s] X-velocity of waypoint, set to NaN if not being used
256 * @param vel_y [m/s] Y-velocity of waypoint, set to NaN if not being used
257 * @param vel_z [m/s] Z-velocity of waypoint, set to NaN if not being used
258 * @param acc_x [m/s/s] X-acceleration of waypoint, set to NaN if not being used
259 * @param acc_y [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
260 * @param acc_z [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
261 * @param pos_yaw [rad] Yaw angle, set to NaN if not being used
262 * @param vel_yaw [rad/s] Yaw rate, set to NaN if not being used
263 * @param command Scheduled action for each waypoint, UINT16_MAX if not being used.
265 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
267 static inline void mavlink_msg_trajectory_representation_waypoints_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 *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
269 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
270 char buf[MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN];
271 _mav_put_uint64_t(buf, 0, time_usec);
272 _mav_put_uint8_t(buf, 238, valid_points);
273 _mav_put_float_array(buf, 8, pos_x, 5);
274 _mav_put_float_array(buf, 28, pos_y, 5);
275 _mav_put_float_array(buf, 48, pos_z, 5);
276 _mav_put_float_array(buf, 68, vel_x, 5);
277 _mav_put_float_array(buf, 88, vel_y, 5);
278 _mav_put_float_array(buf, 108, vel_z, 5);
279 _mav_put_float_array(buf, 128, acc_x, 5);
280 _mav_put_float_array(buf, 148, acc_y, 5);
281 _mav_put_float_array(buf, 168, acc_z, 5);
282 _mav_put_float_array(buf, 188, pos_yaw, 5);
283 _mav_put_float_array(buf, 208, vel_yaw, 5);
284 _mav_put_uint16_t_array(buf, 228, command, 5);
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
286 #else
287 mavlink_trajectory_representation_waypoints_t packet;
288 packet.time_usec = time_usec;
289 packet.valid_points = valid_points;
290 mav_array_memcpy(packet.pos_x, pos_x, sizeof(float)*5);
291 mav_array_memcpy(packet.pos_y, pos_y, sizeof(float)*5);
292 mav_array_memcpy(packet.pos_z, pos_z, sizeof(float)*5);
293 mav_array_memcpy(packet.vel_x, vel_x, sizeof(float)*5);
294 mav_array_memcpy(packet.vel_y, vel_y, sizeof(float)*5);
295 mav_array_memcpy(packet.vel_z, vel_z, sizeof(float)*5);
296 mav_array_memcpy(packet.acc_x, acc_x, sizeof(float)*5);
297 mav_array_memcpy(packet.acc_y, acc_y, sizeof(float)*5);
298 mav_array_memcpy(packet.acc_z, acc_z, sizeof(float)*5);
299 mav_array_memcpy(packet.pos_yaw, pos_yaw, sizeof(float)*5);
300 mav_array_memcpy(packet.vel_yaw, vel_yaw, sizeof(float)*5);
301 mav_array_memcpy(packet.command, command, sizeof(uint16_t)*5);
302 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, (const char *)&packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
303 #endif
307 * @brief Send a trajectory_representation_waypoints message
308 * @param chan MAVLink channel to send the message
309 * @param struct The MAVLink struct to serialize
311 static inline void mavlink_msg_trajectory_representation_waypoints_send_struct(mavlink_channel_t chan, const mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
313 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
314 mavlink_msg_trajectory_representation_waypoints_send(chan, trajectory_representation_waypoints->time_usec, trajectory_representation_waypoints->valid_points, trajectory_representation_waypoints->pos_x, trajectory_representation_waypoints->pos_y, trajectory_representation_waypoints->pos_z, trajectory_representation_waypoints->vel_x, trajectory_representation_waypoints->vel_y, trajectory_representation_waypoints->vel_z, trajectory_representation_waypoints->acc_x, trajectory_representation_waypoints->acc_y, trajectory_representation_waypoints->acc_z, trajectory_representation_waypoints->pos_yaw, trajectory_representation_waypoints->vel_yaw, trajectory_representation_waypoints->command);
315 #else
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, (const char *)trajectory_representation_waypoints, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
317 #endif
320 #if MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
322 This varient of _send() can be used to save stack space by re-using
323 memory from the receive buffer. The caller provides a
324 mavlink_message_t which is the size of a full mavlink message. This
325 is usually the receive buffer for the channel, and allows a reply to an
326 incoming message with minimum stack space usage.
328 static inline void mavlink_msg_trajectory_representation_waypoints_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 *vel_x, const float *vel_y, const float *vel_z, const float *acc_x, const float *acc_y, const float *acc_z, const float *pos_yaw, const float *vel_yaw, const uint16_t *command)
330 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
331 char *buf = (char *)msgbuf;
332 _mav_put_uint64_t(buf, 0, time_usec);
333 _mav_put_uint8_t(buf, 238, valid_points);
334 _mav_put_float_array(buf, 8, pos_x, 5);
335 _mav_put_float_array(buf, 28, pos_y, 5);
336 _mav_put_float_array(buf, 48, pos_z, 5);
337 _mav_put_float_array(buf, 68, vel_x, 5);
338 _mav_put_float_array(buf, 88, vel_y, 5);
339 _mav_put_float_array(buf, 108, vel_z, 5);
340 _mav_put_float_array(buf, 128, acc_x, 5);
341 _mav_put_float_array(buf, 148, acc_y, 5);
342 _mav_put_float_array(buf, 168, acc_z, 5);
343 _mav_put_float_array(buf, 188, pos_yaw, 5);
344 _mav_put_float_array(buf, 208, vel_yaw, 5);
345 _mav_put_uint16_t_array(buf, 228, command, 5);
346 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, buf, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
347 #else
348 mavlink_trajectory_representation_waypoints_t *packet = (mavlink_trajectory_representation_waypoints_t *)msgbuf;
349 packet->time_usec = time_usec;
350 packet->valid_points = valid_points;
351 mav_array_memcpy(packet->pos_x, pos_x, sizeof(float)*5);
352 mav_array_memcpy(packet->pos_y, pos_y, sizeof(float)*5);
353 mav_array_memcpy(packet->pos_z, pos_z, sizeof(float)*5);
354 mav_array_memcpy(packet->vel_x, vel_x, sizeof(float)*5);
355 mav_array_memcpy(packet->vel_y, vel_y, sizeof(float)*5);
356 mav_array_memcpy(packet->vel_z, vel_z, sizeof(float)*5);
357 mav_array_memcpy(packet->acc_x, acc_x, sizeof(float)*5);
358 mav_array_memcpy(packet->acc_y, acc_y, sizeof(float)*5);
359 mav_array_memcpy(packet->acc_z, acc_z, sizeof(float)*5);
360 mav_array_memcpy(packet->pos_yaw, pos_yaw, sizeof(float)*5);
361 mav_array_memcpy(packet->vel_yaw, vel_yaw, sizeof(float)*5);
362 mav_array_memcpy(packet->command, command, sizeof(uint16_t)*5);
363 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS, (const char *)packet, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_CRC);
364 #endif
366 #endif
368 #endif
370 // MESSAGE TRAJECTORY_REPRESENTATION_WAYPOINTS UNPACKING
374 * @brief Get field time_usec from trajectory_representation_waypoints message
376 * @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.
378 static inline uint64_t mavlink_msg_trajectory_representation_waypoints_get_time_usec(const mavlink_message_t* msg)
380 return _MAV_RETURN_uint64_t(msg, 0);
384 * @brief Get field valid_points from trajectory_representation_waypoints message
386 * @return Number of valid points (up-to 5 waypoints are possible)
388 static inline uint8_t mavlink_msg_trajectory_representation_waypoints_get_valid_points(const mavlink_message_t* msg)
390 return _MAV_RETURN_uint8_t(msg, 238);
394 * @brief Get field pos_x from trajectory_representation_waypoints message
396 * @return [m] X-coordinate of waypoint, set to NaN if not being used
398 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_x(const mavlink_message_t* msg, float *pos_x)
400 return _MAV_RETURN_float_array(msg, pos_x, 5, 8);
404 * @brief Get field pos_y from trajectory_representation_waypoints message
406 * @return [m] Y-coordinate of waypoint, set to NaN if not being used
408 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_y(const mavlink_message_t* msg, float *pos_y)
410 return _MAV_RETURN_float_array(msg, pos_y, 5, 28);
414 * @brief Get field pos_z from trajectory_representation_waypoints message
416 * @return [m] Z-coordinate of waypoint, set to NaN if not being used
418 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_z(const mavlink_message_t* msg, float *pos_z)
420 return _MAV_RETURN_float_array(msg, pos_z, 5, 48);
424 * @brief Get field vel_x from trajectory_representation_waypoints message
426 * @return [m/s] X-velocity of waypoint, set to NaN if not being used
428 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_x(const mavlink_message_t* msg, float *vel_x)
430 return _MAV_RETURN_float_array(msg, vel_x, 5, 68);
434 * @brief Get field vel_y from trajectory_representation_waypoints message
436 * @return [m/s] Y-velocity of waypoint, set to NaN if not being used
438 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_y(const mavlink_message_t* msg, float *vel_y)
440 return _MAV_RETURN_float_array(msg, vel_y, 5, 88);
444 * @brief Get field vel_z from trajectory_representation_waypoints message
446 * @return [m/s] Z-velocity of waypoint, set to NaN if not being used
448 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_z(const mavlink_message_t* msg, float *vel_z)
450 return _MAV_RETURN_float_array(msg, vel_z, 5, 108);
454 * @brief Get field acc_x from trajectory_representation_waypoints message
456 * @return [m/s/s] X-acceleration of waypoint, set to NaN if not being used
458 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_acc_x(const mavlink_message_t* msg, float *acc_x)
460 return _MAV_RETURN_float_array(msg, acc_x, 5, 128);
464 * @brief Get field acc_y from trajectory_representation_waypoints message
466 * @return [m/s/s] Y-acceleration of waypoint, set to NaN if not being used
468 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_acc_y(const mavlink_message_t* msg, float *acc_y)
470 return _MAV_RETURN_float_array(msg, acc_y, 5, 148);
474 * @brief Get field acc_z from trajectory_representation_waypoints message
476 * @return [m/s/s] Z-acceleration of waypoint, set to NaN if not being used
478 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_acc_z(const mavlink_message_t* msg, float *acc_z)
480 return _MAV_RETURN_float_array(msg, acc_z, 5, 168);
484 * @brief Get field pos_yaw from trajectory_representation_waypoints message
486 * @return [rad] Yaw angle, set to NaN if not being used
488 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_pos_yaw(const mavlink_message_t* msg, float *pos_yaw)
490 return _MAV_RETURN_float_array(msg, pos_yaw, 5, 188);
494 * @brief Get field vel_yaw from trajectory_representation_waypoints message
496 * @return [rad/s] Yaw rate, set to NaN if not being used
498 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_vel_yaw(const mavlink_message_t* msg, float *vel_yaw)
500 return _MAV_RETURN_float_array(msg, vel_yaw, 5, 208);
504 * @brief Get field command from trajectory_representation_waypoints message
506 * @return Scheduled action for each waypoint, UINT16_MAX if not being used.
508 static inline uint16_t mavlink_msg_trajectory_representation_waypoints_get_command(const mavlink_message_t* msg, uint16_t *command)
510 return _MAV_RETURN_uint16_t_array(msg, command, 5, 228);
514 * @brief Decode a trajectory_representation_waypoints message into a struct
516 * @param msg The message to decode
517 * @param trajectory_representation_waypoints C-struct to decode the message contents into
519 static inline void mavlink_msg_trajectory_representation_waypoints_decode(const mavlink_message_t* msg, mavlink_trajectory_representation_waypoints_t* trajectory_representation_waypoints)
521 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
522 trajectory_representation_waypoints->time_usec = mavlink_msg_trajectory_representation_waypoints_get_time_usec(msg);
523 mavlink_msg_trajectory_representation_waypoints_get_pos_x(msg, trajectory_representation_waypoints->pos_x);
524 mavlink_msg_trajectory_representation_waypoints_get_pos_y(msg, trajectory_representation_waypoints->pos_y);
525 mavlink_msg_trajectory_representation_waypoints_get_pos_z(msg, trajectory_representation_waypoints->pos_z);
526 mavlink_msg_trajectory_representation_waypoints_get_vel_x(msg, trajectory_representation_waypoints->vel_x);
527 mavlink_msg_trajectory_representation_waypoints_get_vel_y(msg, trajectory_representation_waypoints->vel_y);
528 mavlink_msg_trajectory_representation_waypoints_get_vel_z(msg, trajectory_representation_waypoints->vel_z);
529 mavlink_msg_trajectory_representation_waypoints_get_acc_x(msg, trajectory_representation_waypoints->acc_x);
530 mavlink_msg_trajectory_representation_waypoints_get_acc_y(msg, trajectory_representation_waypoints->acc_y);
531 mavlink_msg_trajectory_representation_waypoints_get_acc_z(msg, trajectory_representation_waypoints->acc_z);
532 mavlink_msg_trajectory_representation_waypoints_get_pos_yaw(msg, trajectory_representation_waypoints->pos_yaw);
533 mavlink_msg_trajectory_representation_waypoints_get_vel_yaw(msg, trajectory_representation_waypoints->vel_yaw);
534 mavlink_msg_trajectory_representation_waypoints_get_command(msg, trajectory_representation_waypoints->command);
535 trajectory_representation_waypoints->valid_points = mavlink_msg_trajectory_representation_waypoints_get_valid_points(msg);
536 #else
537 uint8_t len = msg->len < MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN? msg->len : MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN;
538 memset(trajectory_representation_waypoints, 0, MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_LEN);
539 memcpy(trajectory_representation_waypoints, _MAV_PAYLOAD(msg), len);
540 #endif