Copter: support height based landing gear

This commit is contained in:
Andrew Tridgell 2018-11-09 15:46:30 +11:00
parent 432d786f82
commit 144e1945c6

View File

@ -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);
}