ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.06k stars 17.62k forks source link

MAV_CMD_SET_HAGL not used by TECS to flare #28704

Open Georacer opened 3 days ago

Georacer commented 3 days ago

Bug report

Summary

TECS does not use the external HAGL set by the AP_MAVLINK_MAV_CMD_SET_HAGL_ENABLED subsystem. Instead, it uses Plane::height_above_target(), which is not made aware of this information.

Issue details

This aircraft uses a Lua script to read a lidar and feed the distance to ground via the MAV_CMD_SET_HAGL message.

There are two logs attached, with automated landings with flares: One where the landing was good and the plane flared in time: log_good One where the flare was very delayed and the operator tried to take over: log_bad

timeline: (Altitudes are from rangefinder, RNFD[0].Dist, unless otherwise specified.) No RNGFND_LANDING enabled, because external HAGL setting is used.

In the bad log, the plane comes down relatively fast at ~5m/s sink rate. The good log has ~2.5m/s.

B: The preflare triggers at 25m via LAND_PF_ALT. G: The good log triggers at 25m via LAND_PF_ALT.

B: Pitch angle is very negative at -20deg. G: The good flight has around -12deg.

B: Flare is triggered at 10m via LAND_FLARE_SEC. G: In the good flight is triggered at 8.8m via LAND_FLARE_SEC.

B: TECS gradually reduces the sink rate as the HAGL (and hence TECS Above Field Elevation) reduces from 13.5m to 6m. G: In the good log the sink rate is immediately set to 0.6m/s, because the HAGL (and hence TECS Above Field Elevation) is 0.97m < 6m.

Screenshot from the bad log: image image

Version 4.6.0dev

Platform [ ] All [ ] AntennaTracker [ ] Copter [X] Plane [ ] Rover [ ] Submarine

Airframe type Normal plane with back-mounted lidar for inverted landing.

Hardware type Cube Orange+

Logs Please provide a link to any relevant logs that show the issue