ArduPlane - Allow terrain lookahead to work for lawnmower AGL missions
Feature request
Is your feature request related to a problem? Please describe. Use case: Fixed AGL mapping (lawmower) in steep terrain with TERRAIN_FOLLOW=1
When a plane receives a mission, if there is a hill in the middle of a lawnmower that is steep, then lookahead does not register the hill until after the vehicle is too close to the hill. This results in an undershoot of the mission plan, and a crash into terrain.
Describe the solution you'd like
Change float Plane::lookahead_adjustment(void) to consider the projected nominal mission path. If lookahead is needed, the plane should start climbing earlier, so we don't have to resort to "Can't make that climb" to save the vehicle. The plane should bias being above the mission points, or have some option bit to configure that because being to low can mean a crash.
Describe alternatives you've considered
Post-process the AGL flight plan, use a companion computer or Lua, and feed the autopilot intermediate waypoints in absolute frame.
Platform [ ] All [ ] AntennaTracker [ ] Copter [x] Plane [ ] Rover [ ] Submarine
Additional context Here is a discontinuity in desired height as soon as the current lookahead detects a hill in the flight path. This is from a partner vehicle on a real survey mission.
Steps to reproduce
./Tools/autotest/sim_vehicle.py -v Plane --console --map --custom-location "39.9948854, -105.2789980, 1786, 0"
param set TERRAIN_FOLLOW 1
mode takeoff
arm throttle
# wait a bit for altitude
mode auto
Mission: 30151-lookahead-auto.txt
Autotest result: 00000001.zip
Relates to #29914