I am trying to simulate px4flow with lidar as the primary height sensor in gazebo, i am using flat surface. Problem is it does not stay stabilized in Z axis in position/altitude hold modes.
When i set EKF2_HGT_MODE to barometric pressure and enable EKF2_RNG_AID, maximum drift in distance sensor is 18cm and there is a gap between vehicle_local_position/z and vehicle_local_position/bottom_dist. I do not know if it is normal.
Barometer setup (i reversed vehicle_local_position/z to positive in plots):
But when i change EKF2_HGT_MODE to range sensor, vehicle_local_position/z is stabilized and vehicle_local_position/dist_bottom goes crazy.
Range sensor setup:
I tried altitude hold with only lidar, same results occured. Can you help?