Lidar causes drone to follow terrain even when following is disabled

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:

EK2_ALT_SOURCE = 0
EK2_RNG_USE_HGT = -1
TERRAIN_ENABLE = 0
TERRAIN_FOLLOW = 0
WPNAV_RFND_USE = 0

Is this intended behavior? Can it be turned off without disabling the lidar? Is this still the case in Copter 3.5?

I want to turn it off because noisy lidar readings from flying over certain terrains cause the drones to bounce around in altitude:

Just mount a downward facing Lidar then it flys following Lidar alt? Did you create a mission with terrain alt?

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.

Its wired! I am trying to start a terrain following AUTO mission here, havn’t succeed yet.

To do that, I think you need WPNAV_RFND_USE = 1, and then you need to set your mission waypoints to be altitude above ground using this dropdown menu:

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.

Ok thanks so much! I will try that soom!