00001
00002
00003 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED 32
00004
00005 typedef struct __mavlink_local_position_ned_t
00006 {
00007 uint32_t time_boot_ms;
00008 float x;
00009 float y;
00010 float z;
00011 float vx;
00012 float vy;
00013 float vz;
00014 } mavlink_local_position_ned_t;
00015
00016 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN 28
00017 #define MAVLINK_MSG_ID_32_LEN 28
00018
00019 #define MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC 185
00020 #define MAVLINK_MSG_ID_32_CRC 185
00021
00022
00023
00024 #define MAVLINK_MESSAGE_INFO_LOCAL_POSITION_NED { \
00025 "LOCAL_POSITION_NED", \
00026 7, \
00027 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_local_position_ned_t, time_boot_ms) }, \
00028 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_local_position_ned_t, x) }, \
00029 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_local_position_ned_t, y) }, \
00030 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_local_position_ned_t, z) }, \
00031 { "vx", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_local_position_ned_t, vx) }, \
00032 { "vy", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_local_position_ned_t, vy) }, \
00033 { "vz", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_local_position_ned_t, vz) }, \
00034 } \
00035 }
00036
00037
00053 static inline uint16_t mavlink_msg_local_position_ned_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
00054 uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
00055 {
00056 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00057 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
00058 _mav_put_uint32_t(buf, 0, time_boot_ms);
00059 _mav_put_float(buf, 4, x);
00060 _mav_put_float(buf, 8, y);
00061 _mav_put_float(buf, 12, z);
00062 _mav_put_float(buf, 16, vx);
00063 _mav_put_float(buf, 20, vy);
00064 _mav_put_float(buf, 24, vz);
00065
00066 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00067 #else
00068 mavlink_local_position_ned_t packet;
00069 packet.time_boot_ms = time_boot_ms;
00070 packet.x = x;
00071 packet.y = y;
00072 packet.z = z;
00073 packet.vx = vx;
00074 packet.vy = vy;
00075 packet.vz = vz;
00076
00077 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00078 #endif
00079
00080 msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
00081 #if MAVLINK_CRC_EXTRA
00082 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
00083 #else
00084 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00085 #endif
00086 }
00087
00103 static inline uint16_t mavlink_msg_local_position_ned_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
00104 mavlink_message_t* msg,
00105 uint32_t time_boot_ms,float x,float y,float z,float vx,float vy,float vz)
00106 {
00107 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00108 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
00109 _mav_put_uint32_t(buf, 0, time_boot_ms);
00110 _mav_put_float(buf, 4, x);
00111 _mav_put_float(buf, 8, y);
00112 _mav_put_float(buf, 12, z);
00113 _mav_put_float(buf, 16, vx);
00114 _mav_put_float(buf, 20, vy);
00115 _mav_put_float(buf, 24, vz);
00116
00117 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00118 #else
00119 mavlink_local_position_ned_t packet;
00120 packet.time_boot_ms = time_boot_ms;
00121 packet.x = x;
00122 packet.y = y;
00123 packet.z = z;
00124 packet.vx = vx;
00125 packet.vy = vy;
00126 packet.vz = vz;
00127
00128 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00129 #endif
00130
00131 msg->msgid = MAVLINK_MSG_ID_LOCAL_POSITION_NED;
00132 #if MAVLINK_CRC_EXTRA
00133 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
00134 #else
00135 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00136 #endif
00137 }
00138
00147 static inline uint16_t mavlink_msg_local_position_ned_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned)
00148 {
00149 return mavlink_msg_local_position_ned_pack(system_id, component_id, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
00150 }
00151
00161 static inline uint16_t mavlink_msg_local_position_ned_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_local_position_ned_t* local_position_ned)
00162 {
00163 return mavlink_msg_local_position_ned_pack_chan(system_id, component_id, chan, msg, local_position_ned->time_boot_ms, local_position_ned->x, local_position_ned->y, local_position_ned->z, local_position_ned->vx, local_position_ned->vy, local_position_ned->vz);
00164 }
00165
00178 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
00179
00180 static inline void mavlink_msg_local_position_ned_send(mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
00181 {
00182 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00183 char buf[MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN];
00184 _mav_put_uint32_t(buf, 0, time_boot_ms);
00185 _mav_put_float(buf, 4, x);
00186 _mav_put_float(buf, 8, y);
00187 _mav_put_float(buf, 12, z);
00188 _mav_put_float(buf, 16, vx);
00189 _mav_put_float(buf, 20, vy);
00190 _mav_put_float(buf, 24, vz);
00191
00192 #if MAVLINK_CRC_EXTRA
00193 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
00194 #else
00195 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00196 #endif
00197 #else
00198 mavlink_local_position_ned_t packet;
00199 packet.time_boot_ms = time_boot_ms;
00200 packet.x = x;
00201 packet.y = y;
00202 packet.z = z;
00203 packet.vx = vx;
00204 packet.vy = vy;
00205 packet.vz = vz;
00206
00207 #if MAVLINK_CRC_EXTRA
00208 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
00209 #else
00210 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)&packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00211 #endif
00212 #endif
00213 }
00214
00215 #if MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
00216
00217
00218
00219
00220
00221
00222
00223 static inline void mavlink_msg_local_position_ned_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, float x, float y, float z, float vx, float vy, float vz)
00224 {
00225 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00226 char *buf = (char *)msgbuf;
00227 _mav_put_uint32_t(buf, 0, time_boot_ms);
00228 _mav_put_float(buf, 4, x);
00229 _mav_put_float(buf, 8, y);
00230 _mav_put_float(buf, 12, z);
00231 _mav_put_float(buf, 16, vx);
00232 _mav_put_float(buf, 20, vy);
00233 _mav_put_float(buf, 24, vz);
00234
00235 #if MAVLINK_CRC_EXTRA
00236 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
00237 #else
00238 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, buf, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00239 #endif
00240 #else
00241 mavlink_local_position_ned_t *packet = (mavlink_local_position_ned_t *)msgbuf;
00242 packet->time_boot_ms = time_boot_ms;
00243 packet->x = x;
00244 packet->y = y;
00245 packet->z = z;
00246 packet->vx = vx;
00247 packet->vy = vy;
00248 packet->vz = vz;
00249
00250 #if MAVLINK_CRC_EXTRA
00251 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN, MAVLINK_MSG_ID_LOCAL_POSITION_NED_CRC);
00252 #else
00253 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LOCAL_POSITION_NED, (const char *)packet, MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00254 #endif
00255 #endif
00256 }
00257 #endif
00258
00259 #endif
00260
00261
00262
00263
00269 static inline uint32_t mavlink_msg_local_position_ned_get_time_boot_ms(const mavlink_message_t* msg)
00270 {
00271 return _MAV_RETURN_uint32_t(msg, 0);
00272 }
00273
00279 static inline float mavlink_msg_local_position_ned_get_x(const mavlink_message_t* msg)
00280 {
00281 return _MAV_RETURN_float(msg, 4);
00282 }
00283
00289 static inline float mavlink_msg_local_position_ned_get_y(const mavlink_message_t* msg)
00290 {
00291 return _MAV_RETURN_float(msg, 8);
00292 }
00293
00299 static inline float mavlink_msg_local_position_ned_get_z(const mavlink_message_t* msg)
00300 {
00301 return _MAV_RETURN_float(msg, 12);
00302 }
00303
00309 static inline float mavlink_msg_local_position_ned_get_vx(const mavlink_message_t* msg)
00310 {
00311 return _MAV_RETURN_float(msg, 16);
00312 }
00313
00319 static inline float mavlink_msg_local_position_ned_get_vy(const mavlink_message_t* msg)
00320 {
00321 return _MAV_RETURN_float(msg, 20);
00322 }
00323
00329 static inline float mavlink_msg_local_position_ned_get_vz(const mavlink_message_t* msg)
00330 {
00331 return _MAV_RETURN_float(msg, 24);
00332 }
00333
00340 static inline void mavlink_msg_local_position_ned_decode(const mavlink_message_t* msg, mavlink_local_position_ned_t* local_position_ned)
00341 {
00342 #if MAVLINK_NEED_BYTE_SWAP
00343 local_position_ned->time_boot_ms = mavlink_msg_local_position_ned_get_time_boot_ms(msg);
00344 local_position_ned->x = mavlink_msg_local_position_ned_get_x(msg);
00345 local_position_ned->y = mavlink_msg_local_position_ned_get_y(msg);
00346 local_position_ned->z = mavlink_msg_local_position_ned_get_z(msg);
00347 local_position_ned->vx = mavlink_msg_local_position_ned_get_vx(msg);
00348 local_position_ned->vy = mavlink_msg_local_position_ned_get_vy(msg);
00349 local_position_ned->vz = mavlink_msg_local_position_ned_get_vz(msg);
00350 #else
00351 memcpy(local_position_ned, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LOCAL_POSITION_NED_LEN);
00352 #endif
00353 }