ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Copter: Add latching timeout on out of range rangefinder

Open MattKear opened this issue 10 months ago • 1 comments

We want to use the copter function get_rangefinder_height_interpolated_cm() for the height above ground measurement in the heli autorotation mode. This is important for initiating both the flare and touchdown phases.

The aforementioned function does the inertially interpolated lidar measurement which is one of the key bits we want from that function. However, as the plot below illustrates, the return from that function jumps between terrain and rangefinder measurements when the rangefinder goes out of range. The rangefinder will inevitably go out of range low autorotation landing, but I do not want the height measurement to jump in this case.

In this plot AROT.h is the return value from get_rangefinder_height_interpolated_cm(). It can be seen to jump between the terrain height and rangefinder readings. image

This PR proposes a work around so that we trust the last lidar measurement and interpolate from it based on inertial nav for a short period of time, but long enough to allow us to complete the landing without the height source jumping.

I wanted to get some thoughts on whether this is an acceptable approach to resolving this problem.

MattKear avatar Apr 16 '24 20:04 MattKear

AP_HAGL for the win! decided to break out the key functions into a AP_HAGL library

tridge avatar Apr 17 '24 07:04 tridge