source: flair-src/branches/mavlink/tools/Controller/Mavlink/src/include/common/mavlink_msg_set_position_target_global_int.h @ 75

Last change on this file since 75 was 75, checked in by Thomas Fuhrmann, 5 years ago

Change the version of mavlink generated messages and rename it to include

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