MAVLink HIGHRES_IMU: Read Updated-Field Flags Before Comparing Drone Log Values
Decode fields_updated with its own HIGHRES_IMU table, preserve unmapped bits, and distinguish reported updates from numerical changes, sensor health, and timing guarantees.

Identify the bitmap before comparing successive values
A drone telemetry log may display acceleration, angular velocity, magnetic readings, pressure information, and temperature in one HIGHRES_IMU row. A reviewer comparing successive rows should inspect the accompanying fields_updated bitmap before assuming that every displayed quantity represents a newly reported update. The bitmap describes selected fields, rather than an ordinal field number or a percentage score. Interpreting it as a single category can miss combinations of flags and produce an incomplete explanation of what the recorded message reports.
This tutorial decodes one already extracted unsigned bitmap using the current MAVLink common definitions. It does not connect to an aircraft, parse packets, command a sensor, validate a calibration, or assess an actual NiVO flight. The input is constructed to make three selected bits easy to inspect. The product photograph is separate catalogue context. A successful bit decoding establishes only the mapping between that supplied integer and the recorded table, rather than proving that an IMU is healthy or that survey observations meet an acceptance requirement.
Use the HIGHRES_IMU update table for this message
The MAVLink definition describes HIGHRES_IMU message 105 and gives fields_updated an unsigned sixteen-bit type with the HIGHRES_IMU_UPDATED_FLAGS enumeration. The documented flags identify which fields have updated since the last message. The table assigns successive powers of two to thirteen named fields, beginning with xacc and ending with temperature. Testing each power of two with a bitwise AND reveals the selected combination. Preserve both the raw integer and the table revision when presenting this interpretation in a review.
Use this message-specific definition rather than borrowing a convenient bitmap table from a different MAVLink message. An ignore mask, a sensor-health bitmap, and an updated-field bitmap can all contain similar-looking integers while assigning different meanings to their set bits. The example below names each field explicitly and reports any remaining bits that its recorded table does not map. It does not silently discard those bits or invent names for them. A future or implementation-specific definition needs its own evidence before such bits can be interpreted.

Product context only; this photograph does not depict the constructed examples in this article.
Decode a constructed mask without contacting a vehicle
Run the following function locally with Python. It accepts only an actual integer in the unsigned sixteen-bit range, rejecting Boolean values, strings, floats, and numbers outside that range. The field-name tuple follows the documented order and the function tests each corresponding bit. The result includes the selected names in table order and a separate integer for bits outside that mapping. It does not modify sensor values, derive sample ages, or alter a recording. Keeping the original mask alongside the output makes the result auditable.
The constructed value 4101 combines one, four, and 4096. It should report xacc, zacc, and temperature, with zero unmapped bits. The expression uses the bitmap values, not the numeric measurement values in those fields. Replacing 4101 with zero produces an empty selected-name list under this table; it does not erase the other fields from the message or establish that the sensor failed. The meaning of a displayed scalar and the meaning of its update flag remain separate parts of the log evidence.
HIGHRES_FIELDS = (
"xacc", "yacc", "zacc", "xgyro", "ygyro", "zgyro",
"xmag", "ymag", "zmag", "abs_pressure", "diff_pressure",
"pressure_alt", "temperature",
)
def decode_highres_updates(mask):
if type(mask) is not int or not 0 <= mask <= 65535:
raise ValueError("Expected decoded uint16 fields_updated")
known_mask = (1 << len(HIGHRES_FIELDS)) - 1
return {"mask": mask,
"updated_fields": [name for bit, name in enumerate(HIGHRES_FIELDS)
if mask & (1 << bit)],
"unmapped_bits": mask & ~known_mask}
# Constructed decoded mask, not received flight telemetry.
print(decode_highres_updates(1 | 4 | 4096))Do not equate an update flag with a numerical change
A field can be reported as updated while its numerical value happens to equal the preceding displayed value. Conversely, a comparison between two exported rows may reflect a conversion or presentation rule that the export tool applied. The update flag is a statement carried by the message definition; it is not a substitute for inspecting the actual values and decoder behavior. Preserve the raw fields and the exporter contract before concluding that repeated numbers prove a stale sensor or that different numbers prove a new independent observation.
The bitmap also does not provide a complete sensor-health diagnosis, a calibration result, or the uncertainty of an acceleration or pressure reading. Do not convert the number of set bits into an invented quality percentage. The thirteen mapped flags name different quantities, so their count is not a general confidence score. If the project needs a health or quality assessment, identify the appropriate independent records and evaluation method. Keep those conclusions separate from the straightforward flag decoding performed by this small function.
Retain sender and timing context through the review
The documented update relationship refers to the preceding message context, while an offline recording may contain missing, reordered, filtered, or merged rows. Do not assume that two adjacent rows in an export necessarily represent consecutive original messages from the same source. Retain sender identity, recording order, message type, timestamps, and the relevant decoder details before making a sequence-level interpretation. HIGHRES_IMU also includes an IMU identifier field in its definition; the surrounding source context matters when more than one stream is being reviewed.
This tutorial does not infer the timestamp origin, estimate update frequency, reconstruct missing messages, or assign an age to each field. A set update bit alone does not establish precise synchronization among all quantities in the row or with an image exposure. Test unmapped bits explicitly: a mask containing bit thirteen should retain its value in unmapped_bits without assigning a field name. That result preserves evidence of a definition mismatch or unsupported interpretation, while leaving its cause for a separate investigation rather than silently normalizing the recording.
Deliver a flag interpretation with its limits attached
For an actual telemetry handoff, record the unchanged recording identity, selected sender and IMU context, message-definition revision, raw fields_updated value, mapped names, unmapped bits, and reader version. Include one independently checked combination and a rejected out-of-range example. If a report compares scalar values across rows, state the selection and continuity assumptions used for that additional comparison. A correct bitmap expansion should be labeled as such, rather than being presented as an aircraft performance, calibration, or operational safety conclusion.
In a NiVO-related telemetry review, this method makes one compact field explainable without inventing a larger result. Another reviewer can reproduce why 4101 selects three named updates and why unrecognized bits remain visible. Preserve the original message evidence and continue any required timing, calibration, uncertainty, or survey analysis using the appropriate methods. The practical outcome is a precise interpretation of the recorded flag combination and a clear boundary around what that interpretation can establish about the underlying sensor data.
Check every individual mapped bit as well as one combined mask. This exposes an off-by-one table error that a single example could miss, especially near the pressure and temperature entries. Also test an all-mapped-bits value and a mask with only an unmapped bit. These cases verify the reader mapping and evidence preservation without needing any actual flight stream. They do not demonstrate that a particular firmware emits the flags correctly, which remains a separate implementation question.



