Altitude mode not work

Good morning all,
During indoor test, when we try to activate the altitude mode, QGROUNDCONTROL STATION, reports the error not valid altitude estimate
My configuration is:
-Pixhawk 6X

It seems you never entered here:

local_altitude_invalid is invalid all the time even z_valid is valid.

Hi Igor,
Firstly I want to thank you for the fast reply.
Unfortunaly I’m pretty new to PX4 firmware, what action I had to take in order to solve the problems?
Looking forward to hear from you I wish you an happy days

It is hard to tell without a debugger hooked. It could be a bug. Have you maybe disabled some preflight checks?

local_altitude_invalid is by default true

Hi Igor,
I found that COM_POS_FS_DELAY was set to 0, i changed it to 1 second and it seem to work, it’s possible that this is the issue?

Doesn’t make sense since value 1 shall only delay this for 1 second to be true.
(now > lpos.timestamp + (_param_com_pos_fs_delay.get() * 1_s))

in your altitude estimate in the log, you only have the barometer. so you need to put barometer as EKF2_HGT_REF.

also check if SYS_HAS_GPS is disabled, and all other relevant parameters that allow using GPS.

he has a distance sensor and EKF_HGT_REF set to 2 (for distance sensor).
That looks correct.