I have a few drones which use a lidar for informational purposes (the lidar data is sent to a companion computer). I do not want the drone to use the lidar for altitude control, however it continues to use it in all altitude-controlled flight modes even after I turn off all relevant parameters:
Yes, as soon as the lidar is mounted, it starts following terrain. No, it wasn’t a mission sing terrain height (see graph above, I was flying manually in Loiter).
As far as I can tell, this is intended behavior - the lidar reading is being fused into the altitude estimation, leading to some problems when the lidar is noisy. So the solution to this would be to change how the lidar readings are used:
Filter out the noise by tuning EK2_RNG_M_NSE and EK2_RNG_I_GATE
Set the RNGFND_MAX_CM lower so that the lidar reading is no longer considered when it is in that noisy range.
In my case, I don’t think it was “real” terrain following, just the drone changing altitude because the lidar was affecting the altitude estimate. The WPNAV_RFND_USE parameter will enable rangefinder terrain following in missions.