Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_orbit_execution_status.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE ORBIT_EXECUTION_STATUS PACKING
3
4#define MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS 360
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 radius; /*< [m] Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.*/
10 int32_t x; /*< X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.*/
11 int32_t y; /*< Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.*/
12 float z; /*< [m] Altitude of center point. Coordinate system depends on frame field.*/
13 uint8_t frame; /*< The coordinate system of the fields: x, y, z.*/
14} mavlink_orbit_execution_status_t;
15
16#define MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN 25
17#define MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN 25
18#define MAVLINK_MSG_ID_360_LEN 25
19#define MAVLINK_MSG_ID_360_MIN_LEN 25
20
21#define MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC 11
22#define MAVLINK_MSG_ID_360_CRC 11
23
24
25
26#if MAVLINK_COMMAND_24BIT
27#define MAVLINK_MESSAGE_INFO_ORBIT_EXECUTION_STATUS {
28 360,
29 "ORBIT_EXECUTION_STATUS",
30 6,
31 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_orbit_execution_status_t, time_usec) },
32 { "radius", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_orbit_execution_status_t, radius) },
33 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_orbit_execution_status_t, frame) },
34 { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_orbit_execution_status_t, x) },
35 { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_orbit_execution_status_t, y) },
36 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_orbit_execution_status_t, z) },
37 } \
38}
39#else
40#define MAVLINK_MESSAGE_INFO_ORBIT_EXECUTION_STATUS {
41 "ORBIT_EXECUTION_STATUS",
42 6,
43 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_orbit_execution_status_t, time_usec) },
44 { "radius", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_orbit_execution_status_t, radius) },
45 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_orbit_execution_status_t, frame) },
46 { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_orbit_execution_status_t, x) },
47 { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_orbit_execution_status_t, y) },
48 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_orbit_execution_status_t, z) },
49 } \
50}
51#endif
52
53/**
54 * @brief Pack a orbit_execution_status message
55 * @param system_id ID of this system
56 * @param component_id ID of this component (e.g. 200 for IMU)
57 * @param msg The MAVLink message to compress the data into
58 *
59 * @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.
60 * @param radius [m] Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.
61 * @param frame The coordinate system of the fields: x, y, z.
62 * @param x X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
63 * @param y Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
64 * @param z [m] Altitude of center point. Coordinate system depends on frame field.
65 * @return length of the message in bytes (excluding serial stream start sign)
66 */
67static inline uint16_t mavlink_msg_orbit_execution_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
68 uint64_t time_usec, float radius, uint8_t frame, int32_t x, int32_t y, float z)
69{
70#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
72 _mav_put_uint64_t(buf, 0, time_usec);
73 _mav_put_float(buf, 8, radius);
74 _mav_put_int32_t(buf, 12, x);
75 _mav_put_int32_t(buf, 16, y);
76 _mav_put_float(buf, 20, z);
77 _mav_put_uint8_t(buf, 24, frame);
78
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
80#else
81 mavlink_orbit_execution_status_t packet;
82 packet.time_usec = time_usec;
83 packet.radius = radius;
84 packet.x = x;
85 packet.y = y;
86 packet.z = z;
87 packet.frame = frame;
88
89 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
90#endif
91
94}
95
96/**
97 * @brief Pack a orbit_execution_status message
98 * @param system_id ID of this system
99 * @param component_id ID of this component (e.g. 200 for IMU)
100 * @param status MAVLink status structure
101 * @param msg The MAVLink message to compress the data into
102 *
103 * @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.
104 * @param radius [m] Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.
105 * @param frame The coordinate system of the fields: x, y, z.
106 * @param x X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
107 * @param y Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
108 * @param z [m] Altitude of center point. Coordinate system depends on frame field.
109 * @return length of the message in bytes (excluding serial stream start sign)
110 */
111static inline uint16_t mavlink_msg_orbit_execution_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
112 uint64_t time_usec, float radius, uint8_t frame, int32_t x, int32_t y, float z)
113{
114#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
116 _mav_put_uint64_t(buf, 0, time_usec);
117 _mav_put_float(buf, 8, radius);
118 _mav_put_int32_t(buf, 12, x);
119 _mav_put_int32_t(buf, 16, y);
120 _mav_put_float(buf, 20, z);
121 _mav_put_uint8_t(buf, 24, frame);
122
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
124#else
125 mavlink_orbit_execution_status_t packet;
126 packet.time_usec = time_usec;
127 packet.radius = radius;
128 packet.x = x;
129 packet.y = y;
130 packet.z = z;
131 packet.frame = frame;
132
133 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
134#endif
135
137#if MAVLINK_CRC_EXTRA
138 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC);
139#else
140 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
141#endif
142}
143
144/**
145 * @brief Pack a orbit_execution_status message on a channel
146 * @param system_id ID of this system
147 * @param component_id ID of this component (e.g. 200 for IMU)
148 * @param chan The MAVLink channel this message will be sent over
149 * @param msg The MAVLink message to compress the data into
150 * @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.
151 * @param radius [m] Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.
152 * @param frame The coordinate system of the fields: x, y, z.
153 * @param x X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
154 * @param y Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
155 * @param z [m] Altitude of center point. Coordinate system depends on frame field.
156 * @return length of the message in bytes (excluding serial stream start sign)
157 */
158static inline uint16_t mavlink_msg_orbit_execution_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
159 mavlink_message_t* msg,
160 uint64_t time_usec,float radius,uint8_t frame,int32_t x,int32_t y,float z)
161{
162#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
164 _mav_put_uint64_t(buf, 0, time_usec);
165 _mav_put_float(buf, 8, radius);
166 _mav_put_int32_t(buf, 12, x);
167 _mav_put_int32_t(buf, 16, y);
168 _mav_put_float(buf, 20, z);
169 _mav_put_uint8_t(buf, 24, frame);
170
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
172#else
173 mavlink_orbit_execution_status_t packet;
174 packet.time_usec = time_usec;
175 packet.radius = radius;
176 packet.x = x;
177 packet.y = y;
178 packet.z = z;
179 packet.frame = frame;
180
181 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
182#endif
183
186}
187
188/**
189 * @brief Encode a orbit_execution_status struct
190 *
191 * @param system_id ID of this system
192 * @param component_id ID of this component (e.g. 200 for IMU)
193 * @param msg The MAVLink message to compress the data into
194 * @param orbit_execution_status C-struct to read the message contents from
195 */
196static inline uint16_t mavlink_msg_orbit_execution_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_orbit_execution_status_t* orbit_execution_status)
197{
198 return mavlink_msg_orbit_execution_status_pack(system_id, component_id, msg, orbit_execution_status->time_usec, orbit_execution_status->radius, orbit_execution_status->frame, orbit_execution_status->x, orbit_execution_status->y, orbit_execution_status->z);
199}
200
201/**
202 * @brief Encode a orbit_execution_status struct on a channel
203 *
204 * @param system_id ID of this system
205 * @param component_id ID of this component (e.g. 200 for IMU)
206 * @param chan The MAVLink channel this message will be sent over
207 * @param msg The MAVLink message to compress the data into
208 * @param orbit_execution_status C-struct to read the message contents from
209 */
210static inline uint16_t mavlink_msg_orbit_execution_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_orbit_execution_status_t* orbit_execution_status)
211{
212 return mavlink_msg_orbit_execution_status_pack_chan(system_id, component_id, chan, msg, orbit_execution_status->time_usec, orbit_execution_status->radius, orbit_execution_status->frame, orbit_execution_status->x, orbit_execution_status->y, orbit_execution_status->z);
213}
214
215/**
216 * @brief Encode a orbit_execution_status struct with provided status structure
217 *
218 * @param system_id ID of this system
219 * @param component_id ID of this component (e.g. 200 for IMU)
220 * @param status MAVLink status structure
221 * @param msg The MAVLink message to compress the data into
222 * @param orbit_execution_status C-struct to read the message contents from
223 */
224static inline uint16_t mavlink_msg_orbit_execution_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_orbit_execution_status_t* orbit_execution_status)
225{
226 return mavlink_msg_orbit_execution_status_pack_status(system_id, component_id, _status, msg, orbit_execution_status->time_usec, orbit_execution_status->radius, orbit_execution_status->frame, orbit_execution_status->x, orbit_execution_status->y, orbit_execution_status->z);
227}
228
229/**
230 * @brief Send a orbit_execution_status message
231 * @param chan MAVLink channel to send the message
232 *
233 * @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.
234 * @param radius [m] Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.
235 * @param frame The coordinate system of the fields: x, y, z.
236 * @param x X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
237 * @param y Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
238 * @param z [m] Altitude of center point. Coordinate system depends on frame field.
239 */
240#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
241
242static inline void mavlink_msg_orbit_execution_status_send(mavlink_channel_t chan, uint64_t time_usec, float radius, uint8_t frame, int32_t x, int32_t y, float z)
243{
244#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
245 char buf[MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN];
246 _mav_put_uint64_t(buf, 0, time_usec);
247 _mav_put_float(buf, 8, radius);
248 _mav_put_int32_t(buf, 12, x);
249 _mav_put_int32_t(buf, 16, y);
250 _mav_put_float(buf, 20, z);
251 _mav_put_uint8_t(buf, 24, frame);
252
253 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS, buf, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC);
254#else
255 mavlink_orbit_execution_status_t packet;
256 packet.time_usec = time_usec;
257 packet.radius = radius;
258 packet.x = x;
259 packet.y = y;
260 packet.z = z;
261 packet.frame = frame;
262
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC);
264#endif
265}
266
267/**
268 * @brief Send a orbit_execution_status message
269 * @param chan MAVLink channel to send the message
270 * @param struct The MAVLink struct to serialize
271 */
272static inline void mavlink_msg_orbit_execution_status_send_struct(mavlink_channel_t chan, const mavlink_orbit_execution_status_t* orbit_execution_status)
273{
274#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
275 mavlink_msg_orbit_execution_status_send(chan, orbit_execution_status->time_usec, orbit_execution_status->radius, orbit_execution_status->frame, orbit_execution_status->x, orbit_execution_status->y, orbit_execution_status->z);
276#else
277 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS, (const char *)orbit_execution_status, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC);
278#endif
279}
280
281#if MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
282/*
283 This variant of _send() can be used to save stack space by reusing
284 memory from the receive buffer. The caller provides a
285 mavlink_message_t which is the size of a full mavlink message. This
286 is usually the receive buffer for the channel, and allows a reply to an
287 incoming message with minimum stack space usage.
288 */
289static inline void mavlink_msg_orbit_execution_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float radius, uint8_t frame, int32_t x, int32_t y, float z)
290{
291#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
292 char *buf = (char *)msgbuf;
293 _mav_put_uint64_t(buf, 0, time_usec);
294 _mav_put_float(buf, 8, radius);
295 _mav_put_int32_t(buf, 12, x);
296 _mav_put_int32_t(buf, 16, y);
297 _mav_put_float(buf, 20, z);
298 _mav_put_uint8_t(buf, 24, frame);
299
300 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS, buf, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC);
301#else
302 mavlink_orbit_execution_status_t *packet = (mavlink_orbit_execution_status_t *)msgbuf;
303 packet->time_usec = time_usec;
304 packet->radius = radius;
305 packet->x = x;
306 packet->y = y;
307 packet->z = z;
308 packet->frame = frame;
309
310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS, (const char *)packet, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_CRC);
311#endif
312}
313#endif
314
315#endif
316
317// MESSAGE ORBIT_EXECUTION_STATUS UNPACKING
318
319
320/**
321 * @brief Get field time_usec from orbit_execution_status message
322 *
323 * @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.
324 */
325static inline uint64_t mavlink_msg_orbit_execution_status_get_time_usec(const mavlink_message_t* msg)
326{
327 return _MAV_RETURN_uint64_t(msg, 0);
328}
329
330/**
331 * @brief Get field radius from orbit_execution_status message
332 *
333 * @return [m] Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise.
334 */
335static inline float mavlink_msg_orbit_execution_status_get_radius(const mavlink_message_t* msg)
336{
337 return _MAV_RETURN_float(msg, 8);
338}
339
340/**
341 * @brief Get field frame from orbit_execution_status message
342 *
343 * @return The coordinate system of the fields: x, y, z.
344 */
345static inline uint8_t mavlink_msg_orbit_execution_status_get_frame(const mavlink_message_t* msg)
346{
347 return _MAV_RETURN_uint8_t(msg, 24);
348}
349
350/**
351 * @brief Get field x from orbit_execution_status message
352 *
353 * @return X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
354 */
355static inline int32_t mavlink_msg_orbit_execution_status_get_x(const mavlink_message_t* msg)
356{
357 return _MAV_RETURN_int32_t(msg, 12);
358}
359
360/**
361 * @brief Get field y from orbit_execution_status message
362 *
363 * @return Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7.
364 */
365static inline int32_t mavlink_msg_orbit_execution_status_get_y(const mavlink_message_t* msg)
366{
367 return _MAV_RETURN_int32_t(msg, 16);
368}
369
370/**
371 * @brief Get field z from orbit_execution_status message
372 *
373 * @return [m] Altitude of center point. Coordinate system depends on frame field.
374 */
375static inline float mavlink_msg_orbit_execution_status_get_z(const mavlink_message_t* msg)
376{
377 return _MAV_RETURN_float(msg, 20);
378}
379
380/**
381 * @brief Decode a orbit_execution_status message into a struct
382 *
383 * @param msg The message to decode
384 * @param orbit_execution_status C-struct to decode the message contents into
385 */
386static inline void mavlink_msg_orbit_execution_status_decode(const mavlink_message_t* msg, mavlink_orbit_execution_status_t* orbit_execution_status)
387{
388#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
389 orbit_execution_status->time_usec = mavlink_msg_orbit_execution_status_get_time_usec(msg);
390 orbit_execution_status->radius = mavlink_msg_orbit_execution_status_get_radius(msg);
391 orbit_execution_status->x = mavlink_msg_orbit_execution_status_get_x(msg);
392 orbit_execution_status->y = mavlink_msg_orbit_execution_status_get_y(msg);
393 orbit_execution_status->z = mavlink_msg_orbit_execution_status_get_z(msg);
394 orbit_execution_status->frame = mavlink_msg_orbit_execution_status_get_frame(msg);
395#else
396 uint8_t len = msg->len < MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN;
397 memset(orbit_execution_status, 0, MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_LEN);
398 memcpy(orbit_execution_status, _MAV_PAYLOAD(msg), len);
399#endif
400}