SF11 Lidar use to -1

I configured my SF11 and all works good.

Now i want it to show in the hud the sonar altitude but i don’t want it to be used in EK2 as a height estimation sensor because we have had trouble in the past with fog.

Am i correct that if i just want to use the range finder as an help for the pilot but NOT use it in EK2 estimation of altitude to just set EK2_RNG_USE_HGT = -1 ??
So if i understand correctly i will have sonar range on my hud but ardupilot will ignore it when estimating altitude (so i am safe even if there is some fog).

Do i need to set EK2_ALT_SOURCE = 0 to use only barometer to estimate height? Doesn’t that exclude use of GPS to help height estimation? What i want to make sure is that lidar is not used at any time by EKF to estimate height, because can cause big big probs in fog.



Yes, those are the default values and what should be used if you don’t want rangefinder to be used.

Regarding the EK2_ALT_SOURCE, it allows you to set what is possible: what source of height should be used. Only one source can be used at a time, with the EKF reverting to baro if it can’t get data from the selected source.

Thank you very much, all clear now.

Is EK2_ALT_SOURCE default value is only baro?


Yes, the default is to use baro. Usually the GPS signal isn’t stable enough to give a good altitude reading, but some people use it without problems.

Thank you very much.

I am now using Lidar justas a reference with the settings i reported earlier, but strangely enough, the landing has become a bit more complicated. It takes ages now for the aircraft to settle and land once it is few centimeters off the ground.
Disable lidar and everything back to normal.

Is it possible that somehow the code is using the lidar during the very last part of landing even if i set it to -1 (should not take it in consideration).



Ah sorry, as you referred to EKF I forgot about that part. There are different settings, the EKF one just prevents the EKF to use it as a height reference, but it doesn’t disable Copter to use it for surface tracking or landing - to do that you need to use an aux switch (in low position) set to the rangefinder option: http://ardupilot.org/copter/docs/channel-7-and-8-options.html (it’s called sonar in this page).

1 Like

Thank you, will give it a try.

If i enable it in EKF and set an aux switch, when triggered even the EKF will stop using it or just surface tracking or landing?

I am asking because if the switch channel will just make everything stop using it than i could make a “fog” switch and use it to disable EKF, surface tracking and land when pulled.


No, the switch doesn’t apply to EKF settings.

Ok understood.


If i wanted to use IR_LOCK would it be possible to disable lidar on EKF and still use it during precision landing or EKF must use lidar in order to have it during precision landing?



IRLock does not require the rangefinder to be used in EKF. You can keep your current settings (EK2_RNG_USE_HGT = -1 and EK2_ALT_SOURCE = 0) and precision landing will still work.

Great thank you.