|
|
|
@ -73,13 +73,18 @@ void Copter::check_dynamic_flight(void)
@@ -73,13 +73,18 @@ void Copter::check_dynamic_flight(void)
|
|
|
|
|
// should be run between the rate controller and the servo updates.
|
|
|
|
|
void Copter::update_heli_control_dynamics(void) |
|
|
|
|
{ |
|
|
|
|
// Use Leaky_I if we are not moving fast
|
|
|
|
|
// attitude_control->use_leaky_i(!heli_flags.dynamic_flight);
|
|
|
|
|
attitude_control->use_leaky_i(false); |
|
|
|
|
|
|
|
|
|
if (ap.land_complete || ap.land_complete_maybe) { |
|
|
|
|
motors->set_land_complete(true); |
|
|
|
|
if (!motors->using_leaky_integrator()) { |
|
|
|
|
//turn off leaky_I
|
|
|
|
|
attitude_control->use_leaky_i(false); |
|
|
|
|
if (ap.land_complete || ap.land_complete_maybe) { |
|
|
|
|
motors->set_land_complete(true); |
|
|
|
|
} else { |
|
|
|
|
motors->set_land_complete(false); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// Use Leaky_I if we are not moving fast
|
|
|
|
|
attitude_control->use_leaky_i(!heli_flags.dynamic_flight); |
|
|
|
|
motors->set_land_complete(false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|