mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 12:14:10 -04:00
Copter: use zero_throttle_and_relax_ac in poshold, drift and autotune
This commit is contained in:
parent
1513246040
commit
ab7a9c9073
@ -328,8 +328,7 @@ void Copter::ModeAutoTune::run()
|
|||||||
// if not auto armed or motor interlock not enabled set throttle to zero and exit immediately
|
// if not auto armed or motor interlock not enabled set throttle to zero and exit immediately
|
||||||
// this should not actually be possible because of the init() checks
|
// this should not actually be possible because of the init() checks
|
||||||
if (!motors->armed() || !ap.auto_armed || !motors->get_interlock()) {
|
if (!motors->armed() || !ap.auto_armed || !motors->get_interlock()) {
|
||||||
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
|
zero_throttle_and_relax_ac();
|
||||||
attitude_control->set_throttle_out_unstabilized(0,true,g.throttle_filt);
|
|
||||||
pos_control->relax_alt_hold_controllers(0.0f);
|
pos_control->relax_alt_hold_controllers(0.0f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,7 @@ void Copter::ModeDrift::run()
|
|||||||
|
|
||||||
// if landed and throttle at zero, set throttle to zero and exit immediately
|
// if landed and throttle at zero, set throttle to zero and exit immediately
|
||||||
if (!motors->armed() || !motors->get_interlock() || (ap.land_complete && ap.throttle_zero)) {
|
if (!motors->armed() || !motors->get_interlock() || (ap.land_complete && ap.throttle_zero)) {
|
||||||
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
|
zero_throttle_and_relax_ac();
|
||||||
attitude_control->set_throttle_out_unstabilized(0,true,g.throttle_filt);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,9 +140,8 @@ void Copter::ModePosHold::run()
|
|||||||
|
|
||||||
// if not auto armed or motor interlock not enabled set throttle to zero and exit immediately
|
// if not auto armed or motor interlock not enabled set throttle to zero and exit immediately
|
||||||
if (!motors->armed() || !ap.auto_armed || !motors->get_interlock()) {
|
if (!motors->armed() || !ap.auto_armed || !motors->get_interlock()) {
|
||||||
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
|
|
||||||
wp_nav->init_loiter_target();
|
wp_nav->init_loiter_target();
|
||||||
attitude_control->set_throttle_out_unstabilized(0,true,g.throttle_filt);
|
zero_throttle_and_relax_ac();
|
||||||
pos_control->relax_alt_hold_controllers(0.0f);
|
pos_control->relax_alt_hold_controllers(0.0f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user