Barometer height computation


Am I correct that this is the height computation using barometer in the code?

Would you happen to know the origin of this code? I have tried searching and have encountered the Barometric Formula and Hypsometric Formula, but I am having difficulty matching it completely with the code.

Barometric Formula from

Hypsometric Formula from

@iampete can help you…

@marcsay if you break down the hypsometric formula and precalc the exponent and scalars, you’ll see it actually matches the calculation in AP_Baro. baro code has both the exponential term and the lapse rate inverted as compared to the linked formula, at least that’s what made me pull my air initially…