I am working with a fixed wing UAV, which will fly with a Pixhawk running PX4. I have at my disposal a Sf11c rangefinder, which I successfully integrated by I2C. Now I need help configuring the PX4 to make use of the "distance_sensor" topic.
According to the documentation I can use one of two options:
Set EKF2_HGT_MODE to Range finder (2)
Set EKF2_RNG_AID to 1
But I don't know which should I use. I have some doubts.
How does EKF2_HGT_MODE calculate height when distance to the ground is too high for the sensor, or when the sensor fails for some reason? Does it ever fall back to the internal barometer?
EKF2_RNG_AID only applies below EKF2_RNG_A_HMAX (max 10m) and below EKF2_RNG_A_VMAX (max 2m/s). That seems really a small use case, and I think it won't trigger even in auto landing. Am I wrong? (It seems to be focused for VTOL)
What is the recommended way to use this sensor?