Hello, I’m back after causing more trouble!!
The range finders output and dist_bottom estimation differ significantly. I am using the Holybro H-Flow optical flow sensor as the rangefinder. On the ground, the rangefinder reads around 0.08 m and the dist_bottom records just above 0. I’ve attached the flight review and some plots to show what I mean. The flight review shows some more problems, but most of them come from issues with the rangefinder.
Here’s the catch: dist_bottom_sensor_bitfield is 1 which corresponds to rangefinder so supposedly the rangefinder is being used in the estimate for dist_bottom. cs_rng_terrain is 1 for the whole flight so it should be being fused for terrain estimates (which to my knowledge is what gets used for dist_bottom). The dist_bottom_valid flag is 1 for the majority of the recorded flight especially on the ground. dist_bottom_valid flag is 0 however when it starts to take off.
To me, this all points to that the dist_bottom should be equivalent to the range finders readings for the most part. I tested this in simulation and got the result I expected.
What would the reason be for dist_bottom and the range finder not being even close to eachother?
Flight Review: https://review.px4.io/plot_app?log=11f10363-3c39-475c-9c38-4c3068dc0ac3
Plot:

