Copter: fix tradheli landing detector bug

This commit is contained in:
Bill Geyer 2021-10-09 10:46:31 -04:00 committed by Randy Mackay
parent f2b952eda0
commit 67842ea53b
2 changed files with 6 additions and 3 deletions

View File

@ -5,7 +5,7 @@
#if FRAME_CONFIG == HELI_FRAME
#ifndef HELI_DYNAMIC_FLIGHT_SPEED_MIN
#define HELI_DYNAMIC_FLIGHT_SPEED_MIN 500 // we are in "dynamic flight" when the speed is over 5m/s for 2 seconds
#define HELI_DYNAMIC_FLIGHT_SPEED_MIN 250 // we are in "dynamic flight" when the speed is over 2.5m/s for 2 seconds
#endif
// counter to control dynamic flight profile

View File

@ -61,8 +61,11 @@ void Copter::update_land_detector()
} else {
#if FRAME_CONFIG == HELI_FRAME
// check that collective pitch is below mid collective (zero thrust) position
bool motor_at_lower_limit = (motors->get_below_mid_collective() && fabsf(ahrs.get_roll()) < M_PI/2.0f);
// check for both manual collective modes and modes that use altitude hold. For manual collective (called throttle
// because multi's use throttle), check that collective pitch is below mid collective (zero thrust) position. For modes
// that use altitude hold, check that the pilot is commanding a descent and collective is at min allowed for altitude hold modes.
bool motor_at_lower_limit = ((flightmode->has_manual_throttle() && motors->get_below_mid_collective() && fabsf(ahrs.get_roll()) < M_PI/2.0f)
|| (motors->limit.throttle_lower && pos_control->get_vel_desired_cms().z < 0.0f));
#else
// check that the average throttle output is near minimum (less than 12.5% hover throttle)
bool motor_at_lower_limit = motors->limit.throttle_lower && attitude_control->is_throttle_mix_min();