1 | // MESSAGE POSITION_TARGET_GLOBAL_INT PACKING
|
---|
2 |
|
---|
3 | #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT 87
|
---|
4 |
|
---|
5 | typedef struct MAVLINK_PACKED __mavlink_position_target_global_int_t
|
---|
6 | {
|
---|
7 | uint32_t time_boot_ms; /*< Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.*/
|
---|
8 | int32_t lat_int; /*< X Position in WGS84 frame in 1e7 * meters*/
|
---|
9 | int32_t lon_int; /*< Y Position in WGS84 frame in 1e7 * meters*/
|
---|
10 | float alt; /*< Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT*/
|
---|
11 | float vx; /*< X velocity in NED frame in meter / s*/
|
---|
12 | float vy; /*< Y velocity in NED frame in meter / s*/
|
---|
13 | float vz; /*< Z velocity in NED frame in meter / s*/
|
---|
14 | float afx; /*< X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
|
---|
15 | float afy; /*< Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
|
---|
16 | float afz; /*< Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N*/
|
---|
17 | float yaw; /*< yaw setpoint in rad*/
|
---|
18 | float yaw_rate; /*< yaw rate setpoint in rad/s*/
|
---|
19 | uint16_t type_mask; /*< Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate*/
|
---|
20 | uint8_t coordinate_frame; /*< Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11*/
|
---|
21 | } mavlink_position_target_global_int_t;
|
---|
22 |
|
---|
23 | #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN 51
|
---|
24 | #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN 51
|
---|
25 | #define MAVLINK_MSG_ID_87_LEN 51
|
---|
26 | #define MAVLINK_MSG_ID_87_MIN_LEN 51
|
---|
27 |
|
---|
28 | #define MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC 150
|
---|
29 | #define MAVLINK_MSG_ID_87_CRC 150
|
---|
30 |
|
---|
31 |
|
---|
32 |
|
---|
33 | #if MAVLINK_COMMAND_24BIT
|
---|
34 | #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \
|
---|
35 | 87, \
|
---|
36 | "POSITION_TARGET_GLOBAL_INT", \
|
---|
37 | 14, \
|
---|
38 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \
|
---|
39 | { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \
|
---|
40 | { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \
|
---|
41 | { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \
|
---|
42 | { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) }, \
|
---|
43 | { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) }, \
|
---|
44 | { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) }, \
|
---|
45 | { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) }, \
|
---|
46 | { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) }, \
|
---|
47 | { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \
|
---|
48 | { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \
|
---|
49 | { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \
|
---|
50 | { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \
|
---|
51 | { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \
|
---|
52 | } \
|
---|
53 | }
|
---|
54 | #else
|
---|
55 | #define MAVLINK_MESSAGE_INFO_POSITION_TARGET_GLOBAL_INT { \
|
---|
56 | "POSITION_TARGET_GLOBAL_INT", \
|
---|
57 | 14, \
|
---|
58 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_position_target_global_int_t, time_boot_ms) }, \
|
---|
59 | { "lat_int", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_position_target_global_int_t, lat_int) }, \
|
---|
60 | { "lon_int", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_position_target_global_int_t, lon_int) }, \
|
---|
61 | { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_position_target_global_int_t, alt) }, \
|
---|
62 | { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_position_target_global_int_t, vx) }, \
|
---|
63 | { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_position_target_global_int_t, vy) }, \
|
---|
64 | { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_position_target_global_int_t, vz) }, \
|
---|
65 | { "afx", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_position_target_global_int_t, afx) }, \
|
---|
66 | { "afy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_position_target_global_int_t, afy) }, \
|
---|
67 | { "afz", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_position_target_global_int_t, afz) }, \
|
---|
68 | { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_position_target_global_int_t, yaw) }, \
|
---|
69 | { "yaw_rate", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_position_target_global_int_t, yaw_rate) }, \
|
---|
70 | { "type_mask", NULL, MAVLINK_TYPE_UINT16_T, 0, 48, offsetof(mavlink_position_target_global_int_t, type_mask) }, \
|
---|
71 | { "coordinate_frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_position_target_global_int_t, coordinate_frame) }, \
|
---|
72 | } \
|
---|
73 | }
|
---|
74 | #endif
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * @brief Pack a position_target_global_int message
|
---|
78 | * @param system_id ID of this system
|
---|
79 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
80 | * @param msg The MAVLink message to compress the data into
|
---|
81 | *
|
---|
82 | * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
|
---|
83 | * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
|
---|
84 | * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
|
---|
85 | * @param lat_int X Position in WGS84 frame in 1e7 * meters
|
---|
86 | * @param lon_int Y Position in WGS84 frame in 1e7 * meters
|
---|
87 | * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
|
---|
88 | * @param vx X velocity in NED frame in meter / s
|
---|
89 | * @param vy Y velocity in NED frame in meter / s
|
---|
90 | * @param vz Z velocity in NED frame in meter / s
|
---|
91 | * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
92 | * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
93 | * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
94 | * @param yaw yaw setpoint in rad
|
---|
95 | * @param yaw_rate yaw rate setpoint in rad/s
|
---|
96 | * @return length of the message in bytes (excluding serial stream start sign)
|
---|
97 | */
|
---|
98 | static inline uint16_t mavlink_msg_position_target_global_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
---|
99 | uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
|
---|
100 | {
|
---|
101 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
102 | char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
|
---|
103 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
104 | _mav_put_int32_t(buf, 4, lat_int);
|
---|
105 | _mav_put_int32_t(buf, 8, lon_int);
|
---|
106 | _mav_put_float(buf, 12, alt);
|
---|
107 | _mav_put_float(buf, 16, vx);
|
---|
108 | _mav_put_float(buf, 20, vy);
|
---|
109 | _mav_put_float(buf, 24, vz);
|
---|
110 | _mav_put_float(buf, 28, afx);
|
---|
111 | _mav_put_float(buf, 32, afy);
|
---|
112 | _mav_put_float(buf, 36, afz);
|
---|
113 | _mav_put_float(buf, 40, yaw);
|
---|
114 | _mav_put_float(buf, 44, yaw_rate);
|
---|
115 | _mav_put_uint16_t(buf, 48, type_mask);
|
---|
116 | _mav_put_uint8_t(buf, 50, coordinate_frame);
|
---|
117 |
|
---|
118 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
|
---|
119 | #else
|
---|
120 | mavlink_position_target_global_int_t packet;
|
---|
121 | packet.time_boot_ms = time_boot_ms;
|
---|
122 | packet.lat_int = lat_int;
|
---|
123 | packet.lon_int = lon_int;
|
---|
124 | packet.alt = alt;
|
---|
125 | packet.vx = vx;
|
---|
126 | packet.vy = vy;
|
---|
127 | packet.vz = vz;
|
---|
128 | packet.afx = afx;
|
---|
129 | packet.afy = afy;
|
---|
130 | packet.afz = afz;
|
---|
131 | packet.yaw = yaw;
|
---|
132 | packet.yaw_rate = yaw_rate;
|
---|
133 | packet.type_mask = type_mask;
|
---|
134 | packet.coordinate_frame = coordinate_frame;
|
---|
135 |
|
---|
136 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
|
---|
137 | #endif
|
---|
138 |
|
---|
139 | msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
|
---|
140 | return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
141 | }
|
---|
142 |
|
---|
143 | /**
|
---|
144 | * @brief Pack a position_target_global_int message on a channel
|
---|
145 | * @param system_id ID of this system
|
---|
146 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
147 | * @param chan The MAVLink channel this message will be sent over
|
---|
148 | * @param msg The MAVLink message to compress the data into
|
---|
149 | * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
|
---|
150 | * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
|
---|
151 | * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
|
---|
152 | * @param lat_int X Position in WGS84 frame in 1e7 * meters
|
---|
153 | * @param lon_int Y Position in WGS84 frame in 1e7 * meters
|
---|
154 | * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
|
---|
155 | * @param vx X velocity in NED frame in meter / s
|
---|
156 | * @param vy Y velocity in NED frame in meter / s
|
---|
157 | * @param vz Z velocity in NED frame in meter / s
|
---|
158 | * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
159 | * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
160 | * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
161 | * @param yaw yaw setpoint in rad
|
---|
162 | * @param yaw_rate yaw rate setpoint in rad/s
|
---|
163 | * @return length of the message in bytes (excluding serial stream start sign)
|
---|
164 | */
|
---|
165 | static inline uint16_t mavlink_msg_position_target_global_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
---|
166 | mavlink_message_t* msg,
|
---|
167 | uint32_t time_boot_ms,uint8_t coordinate_frame,uint16_t type_mask,int32_t lat_int,int32_t lon_int,float alt,float vx,float vy,float vz,float afx,float afy,float afz,float yaw,float yaw_rate)
|
---|
168 | {
|
---|
169 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
170 | char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
|
---|
171 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
172 | _mav_put_int32_t(buf, 4, lat_int);
|
---|
173 | _mav_put_int32_t(buf, 8, lon_int);
|
---|
174 | _mav_put_float(buf, 12, alt);
|
---|
175 | _mav_put_float(buf, 16, vx);
|
---|
176 | _mav_put_float(buf, 20, vy);
|
---|
177 | _mav_put_float(buf, 24, vz);
|
---|
178 | _mav_put_float(buf, 28, afx);
|
---|
179 | _mav_put_float(buf, 32, afy);
|
---|
180 | _mav_put_float(buf, 36, afz);
|
---|
181 | _mav_put_float(buf, 40, yaw);
|
---|
182 | _mav_put_float(buf, 44, yaw_rate);
|
---|
183 | _mav_put_uint16_t(buf, 48, type_mask);
|
---|
184 | _mav_put_uint8_t(buf, 50, coordinate_frame);
|
---|
185 |
|
---|
186 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
|
---|
187 | #else
|
---|
188 | mavlink_position_target_global_int_t packet;
|
---|
189 | packet.time_boot_ms = time_boot_ms;
|
---|
190 | packet.lat_int = lat_int;
|
---|
191 | packet.lon_int = lon_int;
|
---|
192 | packet.alt = alt;
|
---|
193 | packet.vx = vx;
|
---|
194 | packet.vy = vy;
|
---|
195 | packet.vz = vz;
|
---|
196 | packet.afx = afx;
|
---|
197 | packet.afy = afy;
|
---|
198 | packet.afz = afz;
|
---|
199 | packet.yaw = yaw;
|
---|
200 | packet.yaw_rate = yaw_rate;
|
---|
201 | packet.type_mask = type_mask;
|
---|
202 | packet.coordinate_frame = coordinate_frame;
|
---|
203 |
|
---|
204 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
|
---|
205 | #endif
|
---|
206 |
|
---|
207 | msg->msgid = MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT;
|
---|
208 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
209 | }
|
---|
210 |
|
---|
211 | /**
|
---|
212 | * @brief Encode a position_target_global_int struct
|
---|
213 | *
|
---|
214 | * @param system_id ID of this system
|
---|
215 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
216 | * @param msg The MAVLink message to compress the data into
|
---|
217 | * @param position_target_global_int C-struct to read the message contents from
|
---|
218 | */
|
---|
219 | static inline uint16_t mavlink_msg_position_target_global_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
|
---|
220 | {
|
---|
221 | return mavlink_msg_position_target_global_int_pack(system_id, component_id, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
|
---|
222 | }
|
---|
223 |
|
---|
224 | /**
|
---|
225 | * @brief Encode a position_target_global_int struct on a channel
|
---|
226 | *
|
---|
227 | * @param system_id ID of this system
|
---|
228 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
229 | * @param chan The MAVLink channel this message will be sent over
|
---|
230 | * @param msg The MAVLink message to compress the data into
|
---|
231 | * @param position_target_global_int C-struct to read the message contents from
|
---|
232 | */
|
---|
233 | static inline uint16_t mavlink_msg_position_target_global_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_position_target_global_int_t* position_target_global_int)
|
---|
234 | {
|
---|
235 | return mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, chan, msg, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
|
---|
236 | }
|
---|
237 |
|
---|
238 | /**
|
---|
239 | * @brief Send a position_target_global_int message
|
---|
240 | * @param chan MAVLink channel to send the message
|
---|
241 | *
|
---|
242 | * @param time_boot_ms Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
|
---|
243 | * @param coordinate_frame Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
|
---|
244 | * @param type_mask Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
|
---|
245 | * @param lat_int X Position in WGS84 frame in 1e7 * meters
|
---|
246 | * @param lon_int Y Position in WGS84 frame in 1e7 * meters
|
---|
247 | * @param alt Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
|
---|
248 | * @param vx X velocity in NED frame in meter / s
|
---|
249 | * @param vy Y velocity in NED frame in meter / s
|
---|
250 | * @param vz Z velocity in NED frame in meter / s
|
---|
251 | * @param afx X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
252 | * @param afy Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
253 | * @param afz Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
254 | * @param yaw yaw setpoint in rad
|
---|
255 | * @param yaw_rate yaw rate setpoint in rad/s
|
---|
256 | */
|
---|
257 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
---|
258 |
|
---|
259 | static inline void mavlink_msg_position_target_global_int_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
|
---|
260 | {
|
---|
261 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
262 | char buf[MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN];
|
---|
263 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
264 | _mav_put_int32_t(buf, 4, lat_int);
|
---|
265 | _mav_put_int32_t(buf, 8, lon_int);
|
---|
266 | _mav_put_float(buf, 12, alt);
|
---|
267 | _mav_put_float(buf, 16, vx);
|
---|
268 | _mav_put_float(buf, 20, vy);
|
---|
269 | _mav_put_float(buf, 24, vz);
|
---|
270 | _mav_put_float(buf, 28, afx);
|
---|
271 | _mav_put_float(buf, 32, afy);
|
---|
272 | _mav_put_float(buf, 36, afz);
|
---|
273 | _mav_put_float(buf, 40, yaw);
|
---|
274 | _mav_put_float(buf, 44, yaw_rate);
|
---|
275 | _mav_put_uint16_t(buf, 48, type_mask);
|
---|
276 | _mav_put_uint8_t(buf, 50, coordinate_frame);
|
---|
277 |
|
---|
278 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
279 | #else
|
---|
280 | mavlink_position_target_global_int_t packet;
|
---|
281 | packet.time_boot_ms = time_boot_ms;
|
---|
282 | packet.lat_int = lat_int;
|
---|
283 | packet.lon_int = lon_int;
|
---|
284 | packet.alt = alt;
|
---|
285 | packet.vx = vx;
|
---|
286 | packet.vy = vy;
|
---|
287 | packet.vz = vz;
|
---|
288 | packet.afx = afx;
|
---|
289 | packet.afy = afy;
|
---|
290 | packet.afz = afz;
|
---|
291 | packet.yaw = yaw;
|
---|
292 | packet.yaw_rate = yaw_rate;
|
---|
293 | packet.type_mask = type_mask;
|
---|
294 | packet.coordinate_frame = coordinate_frame;
|
---|
295 |
|
---|
296 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)&packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
297 | #endif
|
---|
298 | }
|
---|
299 |
|
---|
300 | /**
|
---|
301 | * @brief Send a position_target_global_int message
|
---|
302 | * @param chan MAVLink channel to send the message
|
---|
303 | * @param struct The MAVLink struct to serialize
|
---|
304 | */
|
---|
305 | static inline void mavlink_msg_position_target_global_int_send_struct(mavlink_channel_t chan, const mavlink_position_target_global_int_t* position_target_global_int)
|
---|
306 | {
|
---|
307 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
308 | mavlink_msg_position_target_global_int_send(chan, position_target_global_int->time_boot_ms, position_target_global_int->coordinate_frame, position_target_global_int->type_mask, position_target_global_int->lat_int, position_target_global_int->lon_int, position_target_global_int->alt, position_target_global_int->vx, position_target_global_int->vy, position_target_global_int->vz, position_target_global_int->afx, position_target_global_int->afy, position_target_global_int->afz, position_target_global_int->yaw, position_target_global_int->yaw_rate);
|
---|
309 | #else
|
---|
310 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)position_target_global_int, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
311 | #endif
|
---|
312 | }
|
---|
313 |
|
---|
314 | #if MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
---|
315 | /*
|
---|
316 | This varient of _send() can be used to save stack space by re-using
|
---|
317 | memory from the receive buffer. The caller provides a
|
---|
318 | mavlink_message_t which is the size of a full mavlink message. This
|
---|
319 | is usually the receive buffer for the channel, and allows a reply to an
|
---|
320 | incoming message with minimum stack space usage.
|
---|
321 | */
|
---|
322 | static inline void mavlink_msg_position_target_global_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, int32_t lat_int, int32_t lon_int, float alt, float vx, float vy, float vz, float afx, float afy, float afz, float yaw, float yaw_rate)
|
---|
323 | {
|
---|
324 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
325 | char *buf = (char *)msgbuf;
|
---|
326 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
327 | _mav_put_int32_t(buf, 4, lat_int);
|
---|
328 | _mav_put_int32_t(buf, 8, lon_int);
|
---|
329 | _mav_put_float(buf, 12, alt);
|
---|
330 | _mav_put_float(buf, 16, vx);
|
---|
331 | _mav_put_float(buf, 20, vy);
|
---|
332 | _mav_put_float(buf, 24, vz);
|
---|
333 | _mav_put_float(buf, 28, afx);
|
---|
334 | _mav_put_float(buf, 32, afy);
|
---|
335 | _mav_put_float(buf, 36, afz);
|
---|
336 | _mav_put_float(buf, 40, yaw);
|
---|
337 | _mav_put_float(buf, 44, yaw_rate);
|
---|
338 | _mav_put_uint16_t(buf, 48, type_mask);
|
---|
339 | _mav_put_uint8_t(buf, 50, coordinate_frame);
|
---|
340 |
|
---|
341 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, buf, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
342 | #else
|
---|
343 | mavlink_position_target_global_int_t *packet = (mavlink_position_target_global_int_t *)msgbuf;
|
---|
344 | packet->time_boot_ms = time_boot_ms;
|
---|
345 | packet->lat_int = lat_int;
|
---|
346 | packet->lon_int = lon_int;
|
---|
347 | packet->alt = alt;
|
---|
348 | packet->vx = vx;
|
---|
349 | packet->vy = vy;
|
---|
350 | packet->vz = vz;
|
---|
351 | packet->afx = afx;
|
---|
352 | packet->afy = afy;
|
---|
353 | packet->afz = afz;
|
---|
354 | packet->yaw = yaw;
|
---|
355 | packet->yaw_rate = yaw_rate;
|
---|
356 | packet->type_mask = type_mask;
|
---|
357 | packet->coordinate_frame = coordinate_frame;
|
---|
358 |
|
---|
359 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT, (const char *)packet, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_CRC);
|
---|
360 | #endif
|
---|
361 | }
|
---|
362 | #endif
|
---|
363 |
|
---|
364 | #endif
|
---|
365 |
|
---|
366 | // MESSAGE POSITION_TARGET_GLOBAL_INT UNPACKING
|
---|
367 |
|
---|
368 |
|
---|
369 | /**
|
---|
370 | * @brief Get field time_boot_ms from position_target_global_int message
|
---|
371 | *
|
---|
372 | * @return Timestamp in milliseconds since system boot. The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency.
|
---|
373 | */
|
---|
374 | static inline uint32_t mavlink_msg_position_target_global_int_get_time_boot_ms(const mavlink_message_t* msg)
|
---|
375 | {
|
---|
376 | return _MAV_RETURN_uint32_t(msg, 0);
|
---|
377 | }
|
---|
378 |
|
---|
379 | /**
|
---|
380 | * @brief Get field coordinate_frame from position_target_global_int message
|
---|
381 | *
|
---|
382 | * @return Valid options are: MAV_FRAME_GLOBAL_INT = 5, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11
|
---|
383 | */
|
---|
384 | static inline uint8_t mavlink_msg_position_target_global_int_get_coordinate_frame(const mavlink_message_t* msg)
|
---|
385 | {
|
---|
386 | return _MAV_RETURN_uint8_t(msg, 50);
|
---|
387 | }
|
---|
388 |
|
---|
389 | /**
|
---|
390 | * @brief Get field type_mask from position_target_global_int message
|
---|
391 | *
|
---|
392 | * @return Bitmask to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 10 is set the floats afx afy afz should be interpreted as force instead of acceleration. Mapping: bit 1: x, bit 2: y, bit 3: z, bit 4: vx, bit 5: vy, bit 6: vz, bit 7: ax, bit 8: ay, bit 9: az, bit 10: is force setpoint, bit 11: yaw, bit 12: yaw rate
|
---|
393 | */
|
---|
394 | static inline uint16_t mavlink_msg_position_target_global_int_get_type_mask(const mavlink_message_t* msg)
|
---|
395 | {
|
---|
396 | return _MAV_RETURN_uint16_t(msg, 48);
|
---|
397 | }
|
---|
398 |
|
---|
399 | /**
|
---|
400 | * @brief Get field lat_int from position_target_global_int message
|
---|
401 | *
|
---|
402 | * @return X Position in WGS84 frame in 1e7 * meters
|
---|
403 | */
|
---|
404 | static inline int32_t mavlink_msg_position_target_global_int_get_lat_int(const mavlink_message_t* msg)
|
---|
405 | {
|
---|
406 | return _MAV_RETURN_int32_t(msg, 4);
|
---|
407 | }
|
---|
408 |
|
---|
409 | /**
|
---|
410 | * @brief Get field lon_int from position_target_global_int message
|
---|
411 | *
|
---|
412 | * @return Y Position in WGS84 frame in 1e7 * meters
|
---|
413 | */
|
---|
414 | static inline int32_t mavlink_msg_position_target_global_int_get_lon_int(const mavlink_message_t* msg)
|
---|
415 | {
|
---|
416 | return _MAV_RETURN_int32_t(msg, 8);
|
---|
417 | }
|
---|
418 |
|
---|
419 | /**
|
---|
420 | * @brief Get field alt from position_target_global_int message
|
---|
421 | *
|
---|
422 | * @return Altitude in meters in AMSL altitude, not WGS84 if absolute or relative, above terrain if GLOBAL_TERRAIN_ALT_INT
|
---|
423 | */
|
---|
424 | static inline float mavlink_msg_position_target_global_int_get_alt(const mavlink_message_t* msg)
|
---|
425 | {
|
---|
426 | return _MAV_RETURN_float(msg, 12);
|
---|
427 | }
|
---|
428 |
|
---|
429 | /**
|
---|
430 | * @brief Get field vx from position_target_global_int message
|
---|
431 | *
|
---|
432 | * @return X velocity in NED frame in meter / s
|
---|
433 | */
|
---|
434 | static inline float mavlink_msg_position_target_global_int_get_vx(const mavlink_message_t* msg)
|
---|
435 | {
|
---|
436 | return _MAV_RETURN_float(msg, 16);
|
---|
437 | }
|
---|
438 |
|
---|
439 | /**
|
---|
440 | * @brief Get field vy from position_target_global_int message
|
---|
441 | *
|
---|
442 | * @return Y velocity in NED frame in meter / s
|
---|
443 | */
|
---|
444 | static inline float mavlink_msg_position_target_global_int_get_vy(const mavlink_message_t* msg)
|
---|
445 | {
|
---|
446 | return _MAV_RETURN_float(msg, 20);
|
---|
447 | }
|
---|
448 |
|
---|
449 | /**
|
---|
450 | * @brief Get field vz from position_target_global_int message
|
---|
451 | *
|
---|
452 | * @return Z velocity in NED frame in meter / s
|
---|
453 | */
|
---|
454 | static inline float mavlink_msg_position_target_global_int_get_vz(const mavlink_message_t* msg)
|
---|
455 | {
|
---|
456 | return _MAV_RETURN_float(msg, 24);
|
---|
457 | }
|
---|
458 |
|
---|
459 | /**
|
---|
460 | * @brief Get field afx from position_target_global_int message
|
---|
461 | *
|
---|
462 | * @return X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
463 | */
|
---|
464 | static inline float mavlink_msg_position_target_global_int_get_afx(const mavlink_message_t* msg)
|
---|
465 | {
|
---|
466 | return _MAV_RETURN_float(msg, 28);
|
---|
467 | }
|
---|
468 |
|
---|
469 | /**
|
---|
470 | * @brief Get field afy from position_target_global_int message
|
---|
471 | *
|
---|
472 | * @return Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
473 | */
|
---|
474 | static inline float mavlink_msg_position_target_global_int_get_afy(const mavlink_message_t* msg)
|
---|
475 | {
|
---|
476 | return _MAV_RETURN_float(msg, 32);
|
---|
477 | }
|
---|
478 |
|
---|
479 | /**
|
---|
480 | * @brief Get field afz from position_target_global_int message
|
---|
481 | *
|
---|
482 | * @return Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N
|
---|
483 | */
|
---|
484 | static inline float mavlink_msg_position_target_global_int_get_afz(const mavlink_message_t* msg)
|
---|
485 | {
|
---|
486 | return _MAV_RETURN_float(msg, 36);
|
---|
487 | }
|
---|
488 |
|
---|
489 | /**
|
---|
490 | * @brief Get field yaw from position_target_global_int message
|
---|
491 | *
|
---|
492 | * @return yaw setpoint in rad
|
---|
493 | */
|
---|
494 | static inline float mavlink_msg_position_target_global_int_get_yaw(const mavlink_message_t* msg)
|
---|
495 | {
|
---|
496 | return _MAV_RETURN_float(msg, 40);
|
---|
497 | }
|
---|
498 |
|
---|
499 | /**
|
---|
500 | * @brief Get field yaw_rate from position_target_global_int message
|
---|
501 | *
|
---|
502 | * @return yaw rate setpoint in rad/s
|
---|
503 | */
|
---|
504 | static inline float mavlink_msg_position_target_global_int_get_yaw_rate(const mavlink_message_t* msg)
|
---|
505 | {
|
---|
506 | return _MAV_RETURN_float(msg, 44);
|
---|
507 | }
|
---|
508 |
|
---|
509 | /**
|
---|
510 | * @brief Decode a position_target_global_int message into a struct
|
---|
511 | *
|
---|
512 | * @param msg The message to decode
|
---|
513 | * @param position_target_global_int C-struct to decode the message contents into
|
---|
514 | */
|
---|
515 | static inline void mavlink_msg_position_target_global_int_decode(const mavlink_message_t* msg, mavlink_position_target_global_int_t* position_target_global_int)
|
---|
516 | {
|
---|
517 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
518 | position_target_global_int->time_boot_ms = mavlink_msg_position_target_global_int_get_time_boot_ms(msg);
|
---|
519 | position_target_global_int->lat_int = mavlink_msg_position_target_global_int_get_lat_int(msg);
|
---|
520 | position_target_global_int->lon_int = mavlink_msg_position_target_global_int_get_lon_int(msg);
|
---|
521 | position_target_global_int->alt = mavlink_msg_position_target_global_int_get_alt(msg);
|
---|
522 | position_target_global_int->vx = mavlink_msg_position_target_global_int_get_vx(msg);
|
---|
523 | position_target_global_int->vy = mavlink_msg_position_target_global_int_get_vy(msg);
|
---|
524 | position_target_global_int->vz = mavlink_msg_position_target_global_int_get_vz(msg);
|
---|
525 | position_target_global_int->afx = mavlink_msg_position_target_global_int_get_afx(msg);
|
---|
526 | position_target_global_int->afy = mavlink_msg_position_target_global_int_get_afy(msg);
|
---|
527 | position_target_global_int->afz = mavlink_msg_position_target_global_int_get_afz(msg);
|
---|
528 | position_target_global_int->yaw = mavlink_msg_position_target_global_int_get_yaw(msg);
|
---|
529 | position_target_global_int->yaw_rate = mavlink_msg_position_target_global_int_get_yaw_rate(msg);
|
---|
530 | position_target_global_int->type_mask = mavlink_msg_position_target_global_int_get_type_mask(msg);
|
---|
531 | position_target_global_int->coordinate_frame = mavlink_msg_position_target_global_int_get_coordinate_frame(msg);
|
---|
532 | #else
|
---|
533 | uint8_t len = msg->len < MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN? msg->len : MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN;
|
---|
534 | memset(position_target_global_int, 0, MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_LEN);
|
---|
535 | memcpy(position_target_global_int, _MAV_PAYLOAD(msg), len);
|
---|
536 | #endif
|
---|
537 | }
|
---|