Pixhawk 2.1 mavlink altitude relative missing

I’m having a persistent issue with PX4 seemingly refusing to send an altitude_relative figure with Pixhawk 2.1. This happens both with GPS connected and fixed, and without gps connected, so I think something funky is going on.

It issue persists through firmware flashes and parameter clears, and I’ve tried every version from 1.5.4 to the current master. Running tests on NSH seems to indicate that the barometers are working fine.

Digging in mavlink_messages.cpp (line 3471), it looks like the only condition under which altitude_relative should be NAN (with both GPS connected and not) is if _home_time never gets updated, but I have no idea what can cause that condition. Any help is appreciated, since I’m totally out of ideas.

You need an initialised home position and good GPS lock for that. I presume you don’t have that. Note that a GPS position doesn’t mean you have sufficient positioning quality for home to be initialised.

Should I be getting an altitude relative figure that is the same as altitude_local with no gps connected?

Relative is relative to home and without GPS there is no home.