Ground-Truth Attitude: Gravity Inconsistency

The shipped outdoor and Mars ground-truth position reproduces to machine precision (see Reproducing the Shipped Ground Truth), but the attitude is the weak component. This page is the direct physical check that quantifies it (code, magnetometer-intrinsic test).

The check

At a strictly static epoch the measured IMU specific force is the gravity reaction and points up in the body frame. Under a correct attitude, rotating it into the world frame by the shipped ground-truth quaternion points straight up; the angle between the rotated vector and world-up is the gravity tilt. The check reads only the shipped px4_imu.csv and ground_truth_80hz.csv — no GPS, no magnetometer, no estimator.

Result

Per-mission median tilt spans 0.9–55° (up to ~77° at the p90, e.g. mars_4), mission-dependent.

  • mars_5 is near-correct at 0.9°; mars_4 is the worst at 55° median and is bimodal — near-correct over part of the flight, tens of degrees wrong over another.
  • The four Klagenfurt-site runs cluster tightly at ~15–17° (outdoor_1 16.9°, transition_1 / transition_2 15.2° / 15.3°, transition_3 16.0°).

The result is robust across static gates and reproduced by two independent code paths. The full per-mission median/p90 table is on Per-Run Quick Reference.

The static gate is the conjunction of three per-epoch conditions:

  • angular rate below 0.015 rad/s,
  • specific-force magnitude within 0.06 m/s² of the per-mission gravity estimate, and
  • accelerometer step below 0.5 m/s².

Each gated IMU epoch is matched to the nearest ground-truth quaternion within 12.5 ms (the ground-truth grid is ~100 Hz despite the 80hz filename).

A deliberately loose gate (0.06 rad/s, 0.40 m/s², 4.0 m/s²) admits mild vehicle acceleration as a robustness probe: equality of the strict and loose medians shows the tilt is measured gravity, not transient linear acceleration.

The two medians agree to within ~0.4° on 21 of the 23 missions; the only exceptions are the bimodal mars_4 (55.0° strict vs 57.7° loose) and mars_12 (7.2° vs 10.2°), where the gates admit slightly different epoch sets — and both still report a large tilt under each gate.

This is not an IMU artifact: mars_5 reaches 0.9° on the same IMU family, so a correct attitude does rotate this IMU’s gravity to world-up. The large tilts are genuine shipped-attitude errors.

Is it the magnetometer intrinsic? No — it is structural

Re-running the Wahba solve with the published px4_mag intrinsic applied, rather than raw, does not restore gravity-consistency.

  • At dual-RTK-fixed static epochs the per-mission mean tilt moves 8.0°→8.5°, 9 of 19 missions improve and 10 worsen,
  • and the maintainers’ near-correct runs degrade (mars_5/6/7 0.9–1.4°→4.0–5.7°).

The harness reproduces the shipped tilt on the raw control, so the corrected delta is trustworthy.

The attitude measurement above pins the two time offsets (t_mag_gps, t_pximu_imugt) at the raw solve’s values, so only the magnetometer direction changes.

  • Re-solving with both offsets re-estimated exposes a separate fragility: t_mag_gps is set by a yaw-rate time registration that cross-correlates the GPS-baseline-azimuth rate against the magnetometer-azimuth rate, and the intrinsic changes the mag azimuth.
  • On two runs this shifts the registration to a spurious lag — mars_11 t_mag_gps→−71.21 s (tilt 39.2° vs 5.8° at the pinned offset), mars_14 →−63.85 s (17.6° vs 10.6°).
  • This is a time-sync sensitivity of the mag↔︎GPS yaw-rate registration to the mag input, not the attitude effect; the pinned-offset solve is the controlled measurement.
  • Any GT regeneration that re-registers a recalibrated magnetometer against GPS yaw rate carries this risk and should check t_mag_gps against the shipped sub-second value.

The cause is structural.

The shipped attitude is a GPS+magnetometer Wahba solve (50:1 GNSS:mag) on raw px4_mag with no accelerometer/gravity term, so roll and pitch are never leveled to “down.” Changing the magnetometer input only redistributes the tilt across missions; it cannot level it.

A gravity-consistent attitude needs the IMU/gravity in the solve — a smoothed or visual-inertial re-solve, or a mocap anchor. The full conclusion is stated on Source of Truth.

Reproduction

The characterization reads the shipped px4_imu.csv + ground_truth_80hz.csv directly. The structural test re-solves the Wahba with the intrinsic applied at dual-RTK-fixed epochs.

The per-mission tilt tables persist under the retained run artifacts of the ground-truth-attitude gravity-consistency study, and the intrinsic-test products under the retained run artifacts of the magnetometer-intrinsic attitude test.