I did a preliminary flight test in Altitude mode, where I have chosen a flight height acting on the throttle stick and then I merely acted on pitch and roll stick in order to move the copter forward/backwards along a line.
The test result, I mean what I have observed by eyes, was that the copter drifted upwards, so I corrected the hight setpoint by acting on the throttle stick and then I repeated the forward/backward movement and this time I drifted slightly downwards.
Here the log file analysis: https://review.px4.io/plot_app?log=6e86edb8-683b-4423-8b7c-4f70f963b023
Looking the log file, it can be seen that the EKF2 estimate is wrong wrt that I have experimentally observed. In particular, the Z local position estimate doesn’t account for the observed drift.
The copter is equipped with a pixhawk 4 (hence IMU, baro, compass) plus a rangefinder (GARMING LidarLite) pointing downward measuring the distance from the ground. Obviously, the ground is flat (I am flying in my office room).
In the log file, I can see that the rangefinder is measuring the upward and downward hight drift, but this isn’t reflected in the Z position estimated performed by the EKF2.
Doesn’t anyone have an idea of what is wrong?
I suppose that EKF2 is not using the range information…