NiVO / BY TECHNOGISGermany · Indonesia
Local frame tutorial

MAVLink LOCAL_POSITION_NED: Separate Local Height Direction from Vertical Motion

Label constructed local NED position and velocity fields with their units and signs, preserving the difference between local displacement, vertical rate and referenced altitude.

MAVLink LOCAL_POSITION_NED: Separate Local Height Direction from Vertical Motion

Keep location and motion in separate columns

A local drone telemetry chart can show a negative vertical position and a positive vertical velocity at the same instant without contradiction. In a down-positive frame, those values answer different questions: where the vehicle is relative to the local origin, and which vertical direction its velocity points. A reviewer who labels both numbers simply height can obscure that distinction. This tutorial inspects invented decoded MAVLink LOCAL_POSITION_NED fields and produces explicit labels. It does not inspect a flight, connect to an aircraft or establish a NiVO navigation capability. Its purpose is an offline interpretation exercise with clearly bounded inputs.

Start with the message identity, source system and component, file revision and local-frame context. A generic z column copied from an unknown table is insufficient evidence for a sign conversion. The function below assumes the input was actually decoded from LOCAL_POSITION_NED and retains the original triples. It does not verify packet integrity, choose a source or recover the local origin. Those dependencies belong in the surrounding log review. Keep the timestamp with the record as well, so the position and velocity being compared remain tied to the same supplied message rather than unrelated rows selected from a chart.

Read the local NED field definitions first

The MAVLink common definition describes LOCAL_POSITION_NED as filtered local position in a right-handed north-east-down frame with the Z axis directed down. Its x, y and z fields use meters; vx, vy and vz use meters per second. time_boot_ms is milliseconds since system boot. These definitions distinguish position from velocity and local coordinates from a global height reference. The tutorial derives a local up displacement by negating z and a local up velocity by negating vz. It does not transform the whole coordinate frame or supply a missing altitude datum.

Calling the derived scalar up displacement is deliberate. It describes the opposite direction along the same local vertical axis. It does not establish height above terrain, elevation above sea level, ellipsoidal height or distance from a takeoff point. Those references are not supplied by this message definition alone. Similarly, the boot-relative timestamp does not identify a calendar time without additional evidence. Keep the exact reference wording in a report. A clear numerical conversion can still mislead if its label silently substitutes a familiar reference that was never established for the local data.

NiVO VTOL V5 product image showing the fixed wing and vertical-lift rotors
NiVO VTOL V5 product image showing the fixed wing and vertical-lift rotors.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Label one constructed position and velocity pair

Run the following Python function with an invented position of five meters north, three meters east and twelve meters in the negative down direction, plus a vertical velocity of two meters per second down. The helper accepts finite triples within local teaching bounds and an unsigned boot timestamp. Those bounds are demonstration limits rather than operating limits. It returns the raw position and velocity with units and two derived local up scalars. No log is opened or changed. The code does not integrate velocity, estimate a trajectory, read terrain or calculate a global coordinate from the local origin.

import math

def label_local_ned(position, velocity, time_boot_ms):
    def triple(values, bound):
        if not isinstance(values, (list, tuple)) or len(values) != 3:
            raise ValueError("expected a three-component sequence")
        if not all(type(v) in (int, float) and math.isfinite(v)
                   and abs(v) <= bound for v in values):
            raise ValueError("outside this finite teaching profile")
        return tuple(float(v) for v in values)
    if type(time_boot_ms) is not int or not 0 <= time_boot_ms <= 4294967295:
        raise ValueError("expected a uint32 boot timestamp")
    p = triple(position, 1000000)
    v = triple(velocity, 10000)
    return {"time_boot_ms": time_boot_ms,
            "position_north_east_down_m": p,
            "velocity_north_east_down_m_s": v,
            "local_up_displacement_m": -p[2],
            "local_up_velocity_m_s": -v[2]}

print(label_local_ned([5, 3, -12], [0, 0, 2], 1000))

Explain why the two vertical signs can differ

The returned local up displacement is positive twelve meters, while local up velocity is negative two meters per second. In the constructed frame, the first means above the local origin and the second points downward. There is no requirement that their signs match. An object can be above an origin while moving toward it, just as a positive horizontal coordinate can accompany a velocity directed toward smaller coordinates. This is a statement about the supplied local axes and numbers. It is not evidence of a particular maneuver or a claim that an actual aircraft followed a safe or intended trajectory.

Try a positive z with a negative vz next. The object is below the local origin in this constructed frame while its local up velocity is positive. A zero vz yields zero local up velocity regardless of the current displacement. These small boundary cases are useful when reviewing labels in an offline table because they isolate sign interpretation from chart styling. Preserve both the raw and derived values. If a plot disagrees, compare its message source, frame and units before assuming that a negative sign was lost or changing the original log to make two views match.

Avoid promoting a local scalar into global altitude

A local origin can require separate documentation and may not remain comparable across unrelated sessions or changes in the estimator’s local reference. This helper does not detect such events. Keep records within an established frame context before comparing their displacements. If a review needs global altitude or terrain clearance, obtain the appropriate reference information and use the project’s defined transformation or terrain workflow. Adding a guessed origin height to the derived scalar would create a result whose reference had not been established here. The simple negation is useful precisely because its limited meaning stays visible.

Likewise, do not infer an entire vertical path from one velocity sample. The message supplies a local position and velocity at its boot-relative timestamp, not a complete history between samples. This tutorial performs no integration, interpolation or time synchronization. A real comparison with another sensor or event needs its own evidence about timestamps, sources and reference frames. Keep those tasks separate from the sign-label exercise. A readable table can support a review conversation, but it cannot by itself establish estimator accuracy, survey quality, obstacle clearance, flight readiness or the permissions associated with a real operation.

Hand off labels that another reviewer can reproduce

A useful field observation records the message name, source identity, local-frame context, boot timestamp, original position and velocity triples, units and the two derived scalars. Include the file revision and decoder version so the observation can be repeated. State explicitly that the derived up value is a local displacement rather than a referenced altitude. If another export uses a different frame or label, compare the definitions before comparing numbers. Preserve the original data and document any separately authorized transformation in a new output, with the reference information needed to understand what changed.

The NiVO catalogue image provides aircraft context only and does not depict this invented telemetry record or a particular navigation system. The practical result is a precise pair of labels: local up displacement in meters and local up velocity in meters per second. Their signs can differ because position and motion describe different properties of the same constructed state. Keeping those properties, units and references explicit lets a drone log reviewer discuss a concrete observation without manufacturing a global altitude or a flight verdict. The wider technical and operational review can then use its own required evidence.

Technical references

  1. MAVLink common message definition: LOCAL_POSITION_NED (32) ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team