From 144e1945c682c9b9c3927dd284afb2a50962622c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 9 Nov 2018 15:46:30 +1100 Subject: [PATCH] Copter: support height based landing gear --- ArduCopter/landing_gear.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ArduCopter/landing_gear.cpp b/ArduCopter/landing_gear.cpp index ca19cc1fca..a8158ca8ee 100644 --- a/ArduCopter/landing_gear.cpp +++ b/ArduCopter/landing_gear.cpp @@ -28,4 +28,14 @@ void Copter::landinggear_update() } last_deploy_status = landinggear.deployed(); + + // support height based triggering + float height; + if (rangefinder_alt_ok()) { + height = rangefinder_state.alt_cm_filt.get() * 0.01; + } else { + height = current_loc.alt * 0.01; + } + + landinggear.update(height); }