[88] | 1 | // MESSAGE ESTIMATOR_STATUS PACKING
|
---|
| 2 |
|
---|
| 3 | #define MAVLINK_MSG_ID_ESTIMATOR_STATUS 230
|
---|
| 4 |
|
---|
| 5 | typedef struct MAVLINK_PACKED __mavlink_estimator_status_t
|
---|
| 6 | {
|
---|
| 7 | uint64_t time_usec; /*< Timestamp (micros since boot or Unix epoch)*/
|
---|
| 8 | float vel_ratio; /*< Velocity innovation test ratio*/
|
---|
| 9 | float pos_horiz_ratio; /*< Horizontal position innovation test ratio*/
|
---|
| 10 | float pos_vert_ratio; /*< Vertical position innovation test ratio*/
|
---|
| 11 | float mag_ratio; /*< Magnetometer innovation test ratio*/
|
---|
| 12 | float hagl_ratio; /*< Height above terrain innovation test ratio*/
|
---|
| 13 | float tas_ratio; /*< True airspeed innovation test ratio*/
|
---|
| 14 | float pos_horiz_accuracy; /*< Horizontal position 1-STD accuracy relative to the EKF local origin (m)*/
|
---|
| 15 | float pos_vert_accuracy; /*< Vertical position 1-STD accuracy relative to the EKF local origin (m)*/
|
---|
| 16 | uint16_t flags; /*< Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.*/
|
---|
| 17 | } mavlink_estimator_status_t;
|
---|
| 18 |
|
---|
| 19 | #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN 42
|
---|
| 20 | #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN 42
|
---|
| 21 | #define MAVLINK_MSG_ID_230_LEN 42
|
---|
| 22 | #define MAVLINK_MSG_ID_230_MIN_LEN 42
|
---|
| 23 |
|
---|
| 24 | #define MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC 163
|
---|
| 25 | #define MAVLINK_MSG_ID_230_CRC 163
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | #if MAVLINK_COMMAND_24BIT
|
---|
| 30 | #define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
|
---|
| 31 | 230, \
|
---|
| 32 | "ESTIMATOR_STATUS", \
|
---|
| 33 | 10, \
|
---|
| 34 | { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
|
---|
| 35 | { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
|
---|
| 36 | { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
|
---|
| 37 | { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
|
---|
| 38 | { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
|
---|
| 39 | { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
|
---|
| 40 | { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
|
---|
| 41 | { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
|
---|
| 42 | { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
|
---|
| 43 | { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
|
---|
| 44 | } \
|
---|
| 45 | }
|
---|
| 46 | #else
|
---|
| 47 | #define MAVLINK_MESSAGE_INFO_ESTIMATOR_STATUS { \
|
---|
| 48 | "ESTIMATOR_STATUS", \
|
---|
| 49 | 10, \
|
---|
| 50 | { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_estimator_status_t, time_usec) }, \
|
---|
| 51 | { "vel_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_estimator_status_t, vel_ratio) }, \
|
---|
| 52 | { "pos_horiz_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_estimator_status_t, pos_horiz_ratio) }, \
|
---|
| 53 | { "pos_vert_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_estimator_status_t, pos_vert_ratio) }, \
|
---|
| 54 | { "mag_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_estimator_status_t, mag_ratio) }, \
|
---|
| 55 | { "hagl_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_estimator_status_t, hagl_ratio) }, \
|
---|
| 56 | { "tas_ratio", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_estimator_status_t, tas_ratio) }, \
|
---|
| 57 | { "pos_horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_estimator_status_t, pos_horiz_accuracy) }, \
|
---|
| 58 | { "pos_vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_estimator_status_t, pos_vert_accuracy) }, \
|
---|
| 59 | { "flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 40, offsetof(mavlink_estimator_status_t, flags) }, \
|
---|
| 60 | } \
|
---|
| 61 | }
|
---|
| 62 | #endif
|
---|
| 63 |
|
---|
| 64 | /**
|
---|
| 65 | * @brief Pack a estimator_status message
|
---|
| 66 | * @param system_id ID of this system
|
---|
| 67 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
| 68 | * @param msg The MAVLink message to compress the data into
|
---|
| 69 | *
|
---|
| 70 | * @param time_usec Timestamp (micros since boot or Unix epoch)
|
---|
| 71 | * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
---|
| 72 | * @param vel_ratio Velocity innovation test ratio
|
---|
| 73 | * @param pos_horiz_ratio Horizontal position innovation test ratio
|
---|
| 74 | * @param pos_vert_ratio Vertical position innovation test ratio
|
---|
| 75 | * @param mag_ratio Magnetometer innovation test ratio
|
---|
| 76 | * @param hagl_ratio Height above terrain innovation test ratio
|
---|
| 77 | * @param tas_ratio True airspeed innovation test ratio
|
---|
| 78 | * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 79 | * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 80 | * @return length of the message in bytes (excluding serial stream start sign)
|
---|
| 81 | */
|
---|
| 82 | static inline uint16_t mavlink_msg_estimator_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
---|
| 83 | uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
---|
| 84 | {
|
---|
| 85 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
| 86 | char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
---|
| 87 | _mav_put_uint64_t(buf, 0, time_usec);
|
---|
| 88 | _mav_put_float(buf, 8, vel_ratio);
|
---|
| 89 | _mav_put_float(buf, 12, pos_horiz_ratio);
|
---|
| 90 | _mav_put_float(buf, 16, pos_vert_ratio);
|
---|
| 91 | _mav_put_float(buf, 20, mag_ratio);
|
---|
| 92 | _mav_put_float(buf, 24, hagl_ratio);
|
---|
| 93 | _mav_put_float(buf, 28, tas_ratio);
|
---|
| 94 | _mav_put_float(buf, 32, pos_horiz_accuracy);
|
---|
| 95 | _mav_put_float(buf, 36, pos_vert_accuracy);
|
---|
| 96 | _mav_put_uint16_t(buf, 40, flags);
|
---|
| 97 |
|
---|
| 98 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
---|
| 99 | #else
|
---|
| 100 | mavlink_estimator_status_t packet;
|
---|
| 101 | packet.time_usec = time_usec;
|
---|
| 102 | packet.vel_ratio = vel_ratio;
|
---|
| 103 | packet.pos_horiz_ratio = pos_horiz_ratio;
|
---|
| 104 | packet.pos_vert_ratio = pos_vert_ratio;
|
---|
| 105 | packet.mag_ratio = mag_ratio;
|
---|
| 106 | packet.hagl_ratio = hagl_ratio;
|
---|
| 107 | packet.tas_ratio = tas_ratio;
|
---|
| 108 | packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
---|
| 109 | packet.pos_vert_accuracy = pos_vert_accuracy;
|
---|
| 110 | packet.flags = flags;
|
---|
| 111 |
|
---|
| 112 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
---|
| 113 | #endif
|
---|
| 114 |
|
---|
| 115 | msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
|
---|
| 116 | return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 117 | }
|
---|
| 118 |
|
---|
| 119 | /**
|
---|
| 120 | * @brief Pack a estimator_status message on a channel
|
---|
| 121 | * @param system_id ID of this system
|
---|
| 122 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
| 123 | * @param chan The MAVLink channel this message will be sent over
|
---|
| 124 | * @param msg The MAVLink message to compress the data into
|
---|
| 125 | * @param time_usec Timestamp (micros since boot or Unix epoch)
|
---|
| 126 | * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
---|
| 127 | * @param vel_ratio Velocity innovation test ratio
|
---|
| 128 | * @param pos_horiz_ratio Horizontal position innovation test ratio
|
---|
| 129 | * @param pos_vert_ratio Vertical position innovation test ratio
|
---|
| 130 | * @param mag_ratio Magnetometer innovation test ratio
|
---|
| 131 | * @param hagl_ratio Height above terrain innovation test ratio
|
---|
| 132 | * @param tas_ratio True airspeed innovation test ratio
|
---|
| 133 | * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 134 | * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 135 | * @return length of the message in bytes (excluding serial stream start sign)
|
---|
| 136 | */
|
---|
| 137 | static inline uint16_t mavlink_msg_estimator_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
---|
| 138 | mavlink_message_t* msg,
|
---|
| 139 | uint64_t time_usec,uint16_t flags,float vel_ratio,float pos_horiz_ratio,float pos_vert_ratio,float mag_ratio,float hagl_ratio,float tas_ratio,float pos_horiz_accuracy,float pos_vert_accuracy)
|
---|
| 140 | {
|
---|
| 141 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
| 142 | char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
---|
| 143 | _mav_put_uint64_t(buf, 0, time_usec);
|
---|
| 144 | _mav_put_float(buf, 8, vel_ratio);
|
---|
| 145 | _mav_put_float(buf, 12, pos_horiz_ratio);
|
---|
| 146 | _mav_put_float(buf, 16, pos_vert_ratio);
|
---|
| 147 | _mav_put_float(buf, 20, mag_ratio);
|
---|
| 148 | _mav_put_float(buf, 24, hagl_ratio);
|
---|
| 149 | _mav_put_float(buf, 28, tas_ratio);
|
---|
| 150 | _mav_put_float(buf, 32, pos_horiz_accuracy);
|
---|
| 151 | _mav_put_float(buf, 36, pos_vert_accuracy);
|
---|
| 152 | _mav_put_uint16_t(buf, 40, flags);
|
---|
| 153 |
|
---|
| 154 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
---|
| 155 | #else
|
---|
| 156 | mavlink_estimator_status_t packet;
|
---|
| 157 | packet.time_usec = time_usec;
|
---|
| 158 | packet.vel_ratio = vel_ratio;
|
---|
| 159 | packet.pos_horiz_ratio = pos_horiz_ratio;
|
---|
| 160 | packet.pos_vert_ratio = pos_vert_ratio;
|
---|
| 161 | packet.mag_ratio = mag_ratio;
|
---|
| 162 | packet.hagl_ratio = hagl_ratio;
|
---|
| 163 | packet.tas_ratio = tas_ratio;
|
---|
| 164 | packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
---|
| 165 | packet.pos_vert_accuracy = pos_vert_accuracy;
|
---|
| 166 | packet.flags = flags;
|
---|
| 167 |
|
---|
| 168 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
---|
| 169 | #endif
|
---|
| 170 |
|
---|
| 171 | msg->msgid = MAVLINK_MSG_ID_ESTIMATOR_STATUS;
|
---|
| 172 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 173 | }
|
---|
| 174 |
|
---|
| 175 | /**
|
---|
| 176 | * @brief Encode a estimator_status struct
|
---|
| 177 | *
|
---|
| 178 | * @param system_id ID of this system
|
---|
| 179 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
| 180 | * @param msg The MAVLink message to compress the data into
|
---|
| 181 | * @param estimator_status C-struct to read the message contents from
|
---|
| 182 | */
|
---|
| 183 | static inline uint16_t mavlink_msg_estimator_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
|
---|
| 184 | {
|
---|
| 185 | return mavlink_msg_estimator_status_pack(system_id, component_id, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
---|
| 186 | }
|
---|
| 187 |
|
---|
| 188 | /**
|
---|
| 189 | * @brief Encode a estimator_status struct on a channel
|
---|
| 190 | *
|
---|
| 191 | * @param system_id ID of this system
|
---|
| 192 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
| 193 | * @param chan The MAVLink channel this message will be sent over
|
---|
| 194 | * @param msg The MAVLink message to compress the data into
|
---|
| 195 | * @param estimator_status C-struct to read the message contents from
|
---|
| 196 | */
|
---|
| 197 | static inline uint16_t mavlink_msg_estimator_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_estimator_status_t* estimator_status)
|
---|
| 198 | {
|
---|
| 199 | return mavlink_msg_estimator_status_pack_chan(system_id, component_id, chan, msg, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
---|
| 200 | }
|
---|
| 201 |
|
---|
| 202 | /**
|
---|
| 203 | * @brief Send a estimator_status message
|
---|
| 204 | * @param chan MAVLink channel to send the message
|
---|
| 205 | *
|
---|
| 206 | * @param time_usec Timestamp (micros since boot or Unix epoch)
|
---|
| 207 | * @param flags Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
---|
| 208 | * @param vel_ratio Velocity innovation test ratio
|
---|
| 209 | * @param pos_horiz_ratio Horizontal position innovation test ratio
|
---|
| 210 | * @param pos_vert_ratio Vertical position innovation test ratio
|
---|
| 211 | * @param mag_ratio Magnetometer innovation test ratio
|
---|
| 212 | * @param hagl_ratio Height above terrain innovation test ratio
|
---|
| 213 | * @param tas_ratio True airspeed innovation test ratio
|
---|
| 214 | * @param pos_horiz_accuracy Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 215 | * @param pos_vert_accuracy Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 216 | */
|
---|
| 217 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
---|
| 218 |
|
---|
| 219 | static inline void mavlink_msg_estimator_status_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
---|
| 220 | {
|
---|
| 221 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
| 222 | char buf[MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN];
|
---|
| 223 | _mav_put_uint64_t(buf, 0, time_usec);
|
---|
| 224 | _mav_put_float(buf, 8, vel_ratio);
|
---|
| 225 | _mav_put_float(buf, 12, pos_horiz_ratio);
|
---|
| 226 | _mav_put_float(buf, 16, pos_vert_ratio);
|
---|
| 227 | _mav_put_float(buf, 20, mag_ratio);
|
---|
| 228 | _mav_put_float(buf, 24, hagl_ratio);
|
---|
| 229 | _mav_put_float(buf, 28, tas_ratio);
|
---|
| 230 | _mav_put_float(buf, 32, pos_horiz_accuracy);
|
---|
| 231 | _mav_put_float(buf, 36, pos_vert_accuracy);
|
---|
| 232 | _mav_put_uint16_t(buf, 40, flags);
|
---|
| 233 |
|
---|
| 234 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 235 | #else
|
---|
| 236 | mavlink_estimator_status_t packet;
|
---|
| 237 | packet.time_usec = time_usec;
|
---|
| 238 | packet.vel_ratio = vel_ratio;
|
---|
| 239 | packet.pos_horiz_ratio = pos_horiz_ratio;
|
---|
| 240 | packet.pos_vert_ratio = pos_vert_ratio;
|
---|
| 241 | packet.mag_ratio = mag_ratio;
|
---|
| 242 | packet.hagl_ratio = hagl_ratio;
|
---|
| 243 | packet.tas_ratio = tas_ratio;
|
---|
| 244 | packet.pos_horiz_accuracy = pos_horiz_accuracy;
|
---|
| 245 | packet.pos_vert_accuracy = pos_vert_accuracy;
|
---|
| 246 | packet.flags = flags;
|
---|
| 247 |
|
---|
| 248 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 249 | #endif
|
---|
| 250 | }
|
---|
| 251 |
|
---|
| 252 | /**
|
---|
| 253 | * @brief Send a estimator_status message
|
---|
| 254 | * @param chan MAVLink channel to send the message
|
---|
| 255 | * @param struct The MAVLink struct to serialize
|
---|
| 256 | */
|
---|
| 257 | static inline void mavlink_msg_estimator_status_send_struct(mavlink_channel_t chan, const mavlink_estimator_status_t* estimator_status)
|
---|
| 258 | {
|
---|
| 259 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
| 260 | mavlink_msg_estimator_status_send(chan, estimator_status->time_usec, estimator_status->flags, estimator_status->vel_ratio, estimator_status->pos_horiz_ratio, estimator_status->pos_vert_ratio, estimator_status->mag_ratio, estimator_status->hagl_ratio, estimator_status->tas_ratio, estimator_status->pos_horiz_accuracy, estimator_status->pos_vert_accuracy);
|
---|
| 261 | #else
|
---|
| 262 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)estimator_status, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 263 | #endif
|
---|
| 264 | }
|
---|
| 265 |
|
---|
| 266 | #if MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
---|
| 267 | /*
|
---|
| 268 | This varient of _send() can be used to save stack space by re-using
|
---|
| 269 | memory from the receive buffer. The caller provides a
|
---|
| 270 | mavlink_message_t which is the size of a full mavlink message. This
|
---|
| 271 | is usually the receive buffer for the channel, and allows a reply to an
|
---|
| 272 | incoming message with minimum stack space usage.
|
---|
| 273 | */
|
---|
| 274 | static inline void mavlink_msg_estimator_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint16_t flags, float vel_ratio, float pos_horiz_ratio, float pos_vert_ratio, float mag_ratio, float hagl_ratio, float tas_ratio, float pos_horiz_accuracy, float pos_vert_accuracy)
|
---|
| 275 | {
|
---|
| 276 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
| 277 | char *buf = (char *)msgbuf;
|
---|
| 278 | _mav_put_uint64_t(buf, 0, time_usec);
|
---|
| 279 | _mav_put_float(buf, 8, vel_ratio);
|
---|
| 280 | _mav_put_float(buf, 12, pos_horiz_ratio);
|
---|
| 281 | _mav_put_float(buf, 16, pos_vert_ratio);
|
---|
| 282 | _mav_put_float(buf, 20, mag_ratio);
|
---|
| 283 | _mav_put_float(buf, 24, hagl_ratio);
|
---|
| 284 | _mav_put_float(buf, 28, tas_ratio);
|
---|
| 285 | _mav_put_float(buf, 32, pos_horiz_accuracy);
|
---|
| 286 | _mav_put_float(buf, 36, pos_vert_accuracy);
|
---|
| 287 | _mav_put_uint16_t(buf, 40, flags);
|
---|
| 288 |
|
---|
| 289 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, buf, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 290 | #else
|
---|
| 291 | mavlink_estimator_status_t *packet = (mavlink_estimator_status_t *)msgbuf;
|
---|
| 292 | packet->time_usec = time_usec;
|
---|
| 293 | packet->vel_ratio = vel_ratio;
|
---|
| 294 | packet->pos_horiz_ratio = pos_horiz_ratio;
|
---|
| 295 | packet->pos_vert_ratio = pos_vert_ratio;
|
---|
| 296 | packet->mag_ratio = mag_ratio;
|
---|
| 297 | packet->hagl_ratio = hagl_ratio;
|
---|
| 298 | packet->tas_ratio = tas_ratio;
|
---|
| 299 | packet->pos_horiz_accuracy = pos_horiz_accuracy;
|
---|
| 300 | packet->pos_vert_accuracy = pos_vert_accuracy;
|
---|
| 301 | packet->flags = flags;
|
---|
| 302 |
|
---|
| 303 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESTIMATOR_STATUS, (const char *)packet, MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN, MAVLINK_MSG_ID_ESTIMATOR_STATUS_CRC);
|
---|
| 304 | #endif
|
---|
| 305 | }
|
---|
| 306 | #endif
|
---|
| 307 |
|
---|
| 308 | #endif
|
---|
| 309 |
|
---|
| 310 | // MESSAGE ESTIMATOR_STATUS UNPACKING
|
---|
| 311 |
|
---|
| 312 |
|
---|
| 313 | /**
|
---|
| 314 | * @brief Get field time_usec from estimator_status message
|
---|
| 315 | *
|
---|
| 316 | * @return Timestamp (micros since boot or Unix epoch)
|
---|
| 317 | */
|
---|
| 318 | static inline uint64_t mavlink_msg_estimator_status_get_time_usec(const mavlink_message_t* msg)
|
---|
| 319 | {
|
---|
| 320 | return _MAV_RETURN_uint64_t(msg, 0);
|
---|
| 321 | }
|
---|
| 322 |
|
---|
| 323 | /**
|
---|
| 324 | * @brief Get field flags from estimator_status message
|
---|
| 325 | *
|
---|
| 326 | * @return Integer bitmask indicating which EKF outputs are valid. See definition for ESTIMATOR_STATUS_FLAGS.
|
---|
| 327 | */
|
---|
| 328 | static inline uint16_t mavlink_msg_estimator_status_get_flags(const mavlink_message_t* msg)
|
---|
| 329 | {
|
---|
| 330 | return _MAV_RETURN_uint16_t(msg, 40);
|
---|
| 331 | }
|
---|
| 332 |
|
---|
| 333 | /**
|
---|
| 334 | * @brief Get field vel_ratio from estimator_status message
|
---|
| 335 | *
|
---|
| 336 | * @return Velocity innovation test ratio
|
---|
| 337 | */
|
---|
| 338 | static inline float mavlink_msg_estimator_status_get_vel_ratio(const mavlink_message_t* msg)
|
---|
| 339 | {
|
---|
| 340 | return _MAV_RETURN_float(msg, 8);
|
---|
| 341 | }
|
---|
| 342 |
|
---|
| 343 | /**
|
---|
| 344 | * @brief Get field pos_horiz_ratio from estimator_status message
|
---|
| 345 | *
|
---|
| 346 | * @return Horizontal position innovation test ratio
|
---|
| 347 | */
|
---|
| 348 | static inline float mavlink_msg_estimator_status_get_pos_horiz_ratio(const mavlink_message_t* msg)
|
---|
| 349 | {
|
---|
| 350 | return _MAV_RETURN_float(msg, 12);
|
---|
| 351 | }
|
---|
| 352 |
|
---|
| 353 | /**
|
---|
| 354 | * @brief Get field pos_vert_ratio from estimator_status message
|
---|
| 355 | *
|
---|
| 356 | * @return Vertical position innovation test ratio
|
---|
| 357 | */
|
---|
| 358 | static inline float mavlink_msg_estimator_status_get_pos_vert_ratio(const mavlink_message_t* msg)
|
---|
| 359 | {
|
---|
| 360 | return _MAV_RETURN_float(msg, 16);
|
---|
| 361 | }
|
---|
| 362 |
|
---|
| 363 | /**
|
---|
| 364 | * @brief Get field mag_ratio from estimator_status message
|
---|
| 365 | *
|
---|
| 366 | * @return Magnetometer innovation test ratio
|
---|
| 367 | */
|
---|
| 368 | static inline float mavlink_msg_estimator_status_get_mag_ratio(const mavlink_message_t* msg)
|
---|
| 369 | {
|
---|
| 370 | return _MAV_RETURN_float(msg, 20);
|
---|
| 371 | }
|
---|
| 372 |
|
---|
| 373 | /**
|
---|
| 374 | * @brief Get field hagl_ratio from estimator_status message
|
---|
| 375 | *
|
---|
| 376 | * @return Height above terrain innovation test ratio
|
---|
| 377 | */
|
---|
| 378 | static inline float mavlink_msg_estimator_status_get_hagl_ratio(const mavlink_message_t* msg)
|
---|
| 379 | {
|
---|
| 380 | return _MAV_RETURN_float(msg, 24);
|
---|
| 381 | }
|
---|
| 382 |
|
---|
| 383 | /**
|
---|
| 384 | * @brief Get field tas_ratio from estimator_status message
|
---|
| 385 | *
|
---|
| 386 | * @return True airspeed innovation test ratio
|
---|
| 387 | */
|
---|
| 388 | static inline float mavlink_msg_estimator_status_get_tas_ratio(const mavlink_message_t* msg)
|
---|
| 389 | {
|
---|
| 390 | return _MAV_RETURN_float(msg, 28);
|
---|
| 391 | }
|
---|
| 392 |
|
---|
| 393 | /**
|
---|
| 394 | * @brief Get field pos_horiz_accuracy from estimator_status message
|
---|
| 395 | *
|
---|
| 396 | * @return Horizontal position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 397 | */
|
---|
| 398 | static inline float mavlink_msg_estimator_status_get_pos_horiz_accuracy(const mavlink_message_t* msg)
|
---|
| 399 | {
|
---|
| 400 | return _MAV_RETURN_float(msg, 32);
|
---|
| 401 | }
|
---|
| 402 |
|
---|
| 403 | /**
|
---|
| 404 | * @brief Get field pos_vert_accuracy from estimator_status message
|
---|
| 405 | *
|
---|
| 406 | * @return Vertical position 1-STD accuracy relative to the EKF local origin (m)
|
---|
| 407 | */
|
---|
| 408 | static inline float mavlink_msg_estimator_status_get_pos_vert_accuracy(const mavlink_message_t* msg)
|
---|
| 409 | {
|
---|
| 410 | return _MAV_RETURN_float(msg, 36);
|
---|
| 411 | }
|
---|
| 412 |
|
---|
| 413 | /**
|
---|
| 414 | * @brief Decode a estimator_status message into a struct
|
---|
| 415 | *
|
---|
| 416 | * @param msg The message to decode
|
---|
| 417 | * @param estimator_status C-struct to decode the message contents into
|
---|
| 418 | */
|
---|
| 419 | static inline void mavlink_msg_estimator_status_decode(const mavlink_message_t* msg, mavlink_estimator_status_t* estimator_status)
|
---|
| 420 | {
|
---|
| 421 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
| 422 | estimator_status->time_usec = mavlink_msg_estimator_status_get_time_usec(msg);
|
---|
| 423 | estimator_status->vel_ratio = mavlink_msg_estimator_status_get_vel_ratio(msg);
|
---|
| 424 | estimator_status->pos_horiz_ratio = mavlink_msg_estimator_status_get_pos_horiz_ratio(msg);
|
---|
| 425 | estimator_status->pos_vert_ratio = mavlink_msg_estimator_status_get_pos_vert_ratio(msg);
|
---|
| 426 | estimator_status->mag_ratio = mavlink_msg_estimator_status_get_mag_ratio(msg);
|
---|
| 427 | estimator_status->hagl_ratio = mavlink_msg_estimator_status_get_hagl_ratio(msg);
|
---|
| 428 | estimator_status->tas_ratio = mavlink_msg_estimator_status_get_tas_ratio(msg);
|
---|
| 429 | estimator_status->pos_horiz_accuracy = mavlink_msg_estimator_status_get_pos_horiz_accuracy(msg);
|
---|
| 430 | estimator_status->pos_vert_accuracy = mavlink_msg_estimator_status_get_pos_vert_accuracy(msg);
|
---|
| 431 | estimator_status->flags = mavlink_msg_estimator_status_get_flags(msg);
|
---|
| 432 | #else
|
---|
| 433 | uint8_t len = msg->len < MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN;
|
---|
| 434 | memset(estimator_status, 0, MAVLINK_MSG_ID_ESTIMATOR_STATUS_LEN);
|
---|
| 435 | memcpy(estimator_status, _MAV_PAYLOAD(msg), len);
|
---|
| 436 | #endif
|
---|
| 437 | }
|
---|