mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-24 01:28:29 -04:00
Copter: spool fixes for acro stabilize and throw
This commit is contained in:
parent
d626ea66f1
commit
df3e73f161
@ -26,11 +26,11 @@ void Copter::ModeAcro::run()
|
|||||||
|
|
||||||
if (motors->get_spool_mode() == AP_Motors::SHUT_DOWN) {
|
if (motors->get_spool_mode() == AP_Motors::SHUT_DOWN) {
|
||||||
// Motors Stopped
|
// Motors Stopped
|
||||||
attitude_control->set_yaw_target_to_current_heading();
|
attitude_control->set_attitude_target_to_current_attitude();
|
||||||
attitude_control->reset_rate_controller_I_terms();
|
attitude_control->reset_rate_controller_I_terms();
|
||||||
} else if (motors->get_spool_mode() == AP_Motors::GROUND_IDLE) {
|
} else if (motors->get_spool_mode() == AP_Motors::GROUND_IDLE) {
|
||||||
// Landed
|
// Landed
|
||||||
attitude_control->set_yaw_target_to_current_heading();
|
attitude_control->set_attitude_target_to_current_attitude();
|
||||||
attitude_control->reset_rate_controller_I_terms();
|
attitude_control->reset_rate_controller_I_terms();
|
||||||
} else if (motors->get_spool_mode() == AP_Motors::THROTTLE_UNLIMITED) {
|
} else if (motors->get_spool_mode() == AP_Motors::THROTTLE_UNLIMITED) {
|
||||||
// clear landing flag above zero throttle
|
// clear landing flag above zero throttle
|
||||||
|
@ -34,7 +34,6 @@ void Copter::ModeThrow::run()
|
|||||||
Throw_PosHold - the copter is kept at a constant position and height
|
Throw_PosHold - the copter is kept at a constant position and height
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Don't enter THROW mode if interlock will prevent motors running
|
|
||||||
if (!motors->armed()) {
|
if (!motors->armed()) {
|
||||||
// state machine entry is always from a disarmed state
|
// state machine entry is always from a disarmed state
|
||||||
stage = Throw_Disarmed;
|
stage = Throw_Disarmed;
|
||||||
@ -116,6 +115,8 @@ void Copter::ModeThrow::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// demand zero throttle (motors will be stopped anyway) and continually reset the attitude controller
|
// demand zero throttle (motors will be stopped anyway) and continually reset the attitude controller
|
||||||
|
attitude_control->set_yaw_target_to_current_heading();
|
||||||
|
attitude_control->reset_rate_controller_I_terms();
|
||||||
attitude_control->set_throttle_out(0,true,g.throttle_filt);
|
attitude_control->set_throttle_out(0,true,g.throttle_filt);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -129,6 +130,8 @@ void Copter::ModeThrow::run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hold throttle at zero during the throw and continually reset the attitude controller
|
// Hold throttle at zero during the throw and continually reset the attitude controller
|
||||||
|
attitude_control->set_yaw_target_to_current_heading();
|
||||||
|
attitude_control->reset_rate_controller_I_terms();
|
||||||
attitude_control->set_throttle_out(0,true,g.throttle_filt);
|
attitude_control->set_throttle_out(0,true,g.throttle_filt);
|
||||||
|
|
||||||
// Play the waiting for throw tone sequence to alert the user
|
// Play the waiting for throw tone sequence to alert the user
|
||||||
|
Loading…
Reference in New Issue
Block a user