Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1702 - 1
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET PACKING
2
 
3
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET 89
4
 
5
typedef struct __mavlink_local_position_ned_system_global_offset_t
6
{
7
 uint32_t time_boot_ms; ///< Timestamp (milliseconds since system boot)
8
 float x; ///< X Position
9
 float y; ///< Y Position
10
 float z; ///< Z Position
11
 float roll; ///< Roll
12
 float pitch; ///< Pitch
13
 float yaw; ///< Yaw
14
} mavlink_local_position_ned_system_global_offset_t;
15
 
16
#define MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_LEN 28
17
#define MAVLINK_MSG_ID_89_LEN 28
18
 
19
 
20
 
21
#define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET { \
22
        "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET", \
23
        7, \
24
        {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_system_global_offset_t, time_boot_ms) }, \
25
         { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_system_global_offset_t, x) }, \
26
         { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_system_global_offset_t, y) }, \
27
         { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_system_global_offset_t, z) }, \
28
         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_system_global_offset_t, roll) }, \
29
         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_system_global_offset_t, pitch) }, \
30
         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_system_global_offset_t, yaw) }, \
31
         } \
32
}
33
 
34
 
35
/**
36
 * @brief Pack a local_position_ned_system_global_offset message
37
 * @param system_id ID of this system
38
 * @param component_id ID of this component (e.g. 200 for IMU)
39
 * @param msg The MAVLink message to compress the data into
40
 *
41
 * @param time_boot_ms Timestamp (milliseconds since system boot)
42
 * @param x X Position
43
 * @param y Y Position
44
 * @param z Z Position
45
 * @param roll Roll
46
 * @param pitch Pitch
47
 * @param yaw Yaw
48
 * @return length of the message in bytes (excluding serial stream start sign)
49
 */
50
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
51
                                                       uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
52
{
53
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
54
        char buf[28];
55
        _mav_put_uint32_t(buf, 0, time_boot_ms);
56
        _mav_put_float(buf, 4, x);
57
        _mav_put_float(buf, 8, y);
58
        _mav_put_float(buf, 12, z);
59
        _mav_put_float(buf, 16, roll);
60
        _mav_put_float(buf, 20, pitch);
61
        _mav_put_float(buf, 24, yaw);
62
 
63
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
64
#else
65
        mavlink_local_position_ned_system_global_offset_t packet;
66
        packet.time_boot_ms = time_boot_ms;
67
        packet.x = x;
68
        packet.y = y;
69
        packet.z = z;
70
        packet.roll = roll;
71
        packet.pitch = pitch;
72
        packet.yaw = yaw;
73
 
74
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
75
#endif
76
 
77
        msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
78
        return mavlink_finalize_message(msg, system_id, component_id, 28, 231);
79
}
80
 
81
/**
82
 * @brief Pack a local_position_ned_system_global_offset message on a channel
83
 * @param system_id ID of this system
84
 * @param component_id ID of this component (e.g. 200 for IMU)
85
 * @param chan The MAVLink channel this message was sent over
86
 * @param msg The MAVLink message to compress the data into
87
 * @param time_boot_ms Timestamp (milliseconds since system boot)
88
 * @param x X Position
89
 * @param y Y Position
90
 * @param z Z Position
91
 * @param roll Roll
92
 * @param pitch Pitch
93
 * @param yaw Yaw
94
 * @return length of the message in bytes (excluding serial stream start sign)
95
 */
96
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
97
                                                           mavlink_message_t* msg,
98
                                                           uint32_t time_boot_ms,float x,float y,float z,float roll,float pitch,float yaw)
99
{
100
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
101
        char buf[28];
102
        _mav_put_uint32_t(buf, 0, time_boot_ms);
103
        _mav_put_float(buf, 4, x);
104
        _mav_put_float(buf, 8, y);
105
        _mav_put_float(buf, 12, z);
106
        _mav_put_float(buf, 16, roll);
107
        _mav_put_float(buf, 20, pitch);
108
        _mav_put_float(buf, 24, yaw);
109
 
110
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 28);
111
#else
112
        mavlink_local_position_ned_system_global_offset_t packet;
113
        packet.time_boot_ms = time_boot_ms;
114
        packet.x = x;
115
        packet.y = y;
116
        packet.z = z;
117
        packet.roll = roll;
118
        packet.pitch = pitch;
119
        packet.yaw = yaw;
120
 
121
        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 28);
122
#endif
123
 
124
        msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET;
125
        return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 28, 231);
126
}
127
 
128
/**
129
 * @brief Encode a local_position_ned_system_global_offset struct into a message
130
 *
131
 * @param system_id ID of this system
132
 * @param component_id ID of this component (e.g. 200 for IMU)
133
 * @param msg The MAVLink message to compress the data into
134
 * @param local_position_ned_system_global_offset C-struct to read the message contents from
135
 */
136
static inline uint16_t mavlink_msg_local_position_ned_system_global_offset_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
137
{
138
        return mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, msg, local_position_ned_system_global_offset->time_boot_ms, local_position_ned_system_global_offset->x, local_position_ned_system_global_offset->y, local_position_ned_system_global_offset->z, local_position_ned_system_global_offset->roll, local_position_ned_system_global_offset->pitch, local_position_ned_system_global_offset->yaw);
139
}
140
 
141
/**
142
 * @brief Send a local_position_ned_system_global_offset message
143
 * @param chan MAVLink channel to send the message
144
 *
145
 * @param time_boot_ms Timestamp (milliseconds since system boot)
146
 * @param x X Position
147
 * @param y Y Position
148
 * @param z Z Position
149
 * @param roll Roll
150
 * @param pitch Pitch
151
 * @param yaw Yaw
152
 */
153
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
154
 
155
static inline void mavlink_msg_local_position_ned_system_global_offset_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float roll, float pitch, float yaw)
156
{
157
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
158
        char buf[28];
159
        _mav_put_uint32_t(buf, 0, time_boot_ms);
160
        _mav_put_float(buf, 4, x);
161
        _mav_put_float(buf, 8, y);
162
        _mav_put_float(buf, 12, z);
163
        _mav_put_float(buf, 16, roll);
164
        _mav_put_float(buf, 20, pitch);
165
        _mav_put_float(buf, 24, yaw);
166
 
167
        _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, buf, 28, 231);
168
#else
169
        mavlink_local_position_ned_system_global_offset_t packet;
170
        packet.time_boot_ms = time_boot_ms;
171
        packet.x = x;
172
        packet.y = y;
173
        packet.z = z;
174
        packet.roll = roll;
175
        packet.pitch = pitch;
176
        packet.yaw = yaw;
177
 
178
        _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, (const char *)&packet, 28, 231);
179
#endif
180
}
181
 
182
#endif
183
 
184
// MESSAGE LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET UNPACKING
185
 
186
 
187
/**
188
 * @brief Get field time_boot_ms from local_position_ned_system_global_offset message
189
 *
190
 * @return Timestamp (milliseconds since system boot)
191
 */
192
static inline uint32_t mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(const mavlink_message_t* msg)
193
{
194
        return _MAV_RETURN_uint32_t(msg,  0);
195
}
196
 
197
/**
198
 * @brief Get field x from local_position_ned_system_global_offset message
199
 *
200
 * @return X Position
201
 */
202
static inline float mavlink_msg_local_position_ned_system_global_offset_get_x(const mavlink_message_t* msg)
203
{
204
        return _MAV_RETURN_float(msg,  4);
205
}
206
 
207
/**
208
 * @brief Get field y from local_position_ned_system_global_offset message
209
 *
210
 * @return Y Position
211
 */
212
static inline float mavlink_msg_local_position_ned_system_global_offset_get_y(const mavlink_message_t* msg)
213
{
214
        return _MAV_RETURN_float(msg,  8);
215
}
216
 
217
/**
218
 * @brief Get field z from local_position_ned_system_global_offset message
219
 *
220
 * @return Z Position
221
 */
222
static inline float mavlink_msg_local_position_ned_system_global_offset_get_z(const mavlink_message_t* msg)
223
{
224
        return _MAV_RETURN_float(msg,  12);
225
}
226
 
227
/**
228
 * @brief Get field roll from local_position_ned_system_global_offset message
229
 *
230
 * @return Roll
231
 */
232
static inline float mavlink_msg_local_position_ned_system_global_offset_get_roll(const mavlink_message_t* msg)
233
{
234
        return _MAV_RETURN_float(msg,  16);
235
}
236
 
237
/**
238
 * @brief Get field pitch from local_position_ned_system_global_offset message
239
 *
240
 * @return Pitch
241
 */
242
static inline float mavlink_msg_local_position_ned_system_global_offset_get_pitch(const mavlink_message_t* msg)
243
{
244
        return _MAV_RETURN_float(msg,  20);
245
}
246
 
247
/**
248
 * @brief Get field yaw from local_position_ned_system_global_offset message
249
 *
250
 * @return Yaw
251
 */
252
static inline float mavlink_msg_local_position_ned_system_global_offset_get_yaw(const mavlink_message_t* msg)
253
{
254
        return _MAV_RETURN_float(msg,  24);
255
}
256
 
257
/**
258
 * @brief Decode a local_position_ned_system_global_offset message into a struct
259
 *
260
 * @param msg The message to decode
261
 * @param local_position_ned_system_global_offset C-struct to decode the message contents into
262
 */
263
static inline void mavlink_msg_local_position_ned_system_global_offset_decode(const mavlink_message_t* msg, mavlink_local_position_ned_system_global_offset_t* local_position_ned_system_global_offset)
264
{
265
#if MAVLINK_NEED_BYTE_SWAP
266
        local_position_ned_system_global_offset->time_boot_ms = mavlink_msg_local_position_ned_system_global_offset_get_time_boot_ms(msg);
267
        local_position_ned_system_global_offset->x = mavlink_msg_local_position_ned_system_global_offset_get_x(msg);
268
        local_position_ned_system_global_offset->y = mavlink_msg_local_position_ned_system_global_offset_get_y(msg);
269
        local_position_ned_system_global_offset->z = mavlink_msg_local_position_ned_system_global_offset_get_z(msg);
270
        local_position_ned_system_global_offset->roll = mavlink_msg_local_position_ned_system_global_offset_get_roll(msg);
271
        local_position_ned_system_global_offset->pitch = mavlink_msg_local_position_ned_system_global_offset_get_pitch(msg);
272
        local_position_ned_system_global_offset->yaw = mavlink_msg_local_position_ned_system_global_offset_get_yaw(msg);
273
#else
274
        memcpy(local_position_ned_system_global_offset, _MAV_PAYLOAD(msg), 28);
275
#endif
276
}