Plane: desired-ground-idle replaces spin-when-armed

This commit is contained in:
Randy Mackay 2018-12-28 20:12:43 +09:00
parent 50c5ad7076
commit 2650b1fe93

View File

@ -739,7 +739,7 @@ void QuadPlane::hold_stabilize(float throttle_in)
multicopter_attitude_rate_update(get_desired_yaw_rate_cds());
if (throttle_in <= 0) {
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
motors->set_desired_spool_state(AP_Motors::DESIRED_GROUND_IDLE);
if (is_tailsitter()) {
// always stabilize with tailsitters so we can do belly takeoffs
attitude_control->set_throttle_out(0, true, 0);
@ -867,7 +867,7 @@ void QuadPlane::hold_hover(float target_climb_rate)
void QuadPlane::control_hover(void)
{
if (throttle_wait) {
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
motors->set_desired_spool_state(AP_Motors::DESIRED_GROUND_IDLE);
attitude_control->set_throttle_out_unstabilized(0, true, 0);
pos_control->relax_alt_hold_controllers(0);
} else {
@ -986,7 +986,7 @@ float QuadPlane::landing_descent_rate_cms(float height_above_ground) const
void QuadPlane::control_loiter()
{
if (throttle_wait) {
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
motors->set_desired_spool_state(AP_Motors::DESIRED_GROUND_IDLE);
attitude_control->set_throttle_out_unstabilized(0, true, 0);
pos_control->relax_alt_hold_controllers(0);
loiter_nav->clear_pilot_desired_acceleration();
@ -1605,7 +1605,7 @@ void QuadPlane::check_throttle_suppression(void)
}
// motors should be in the spin when armed state to warn user they could become active
motors->set_desired_spool_state(AP_Motors::DESIRED_SPIN_WHEN_ARMED);
motors->set_desired_spool_state(AP_Motors::DESIRED_GROUND_IDLE);
motors->set_throttle(0);
last_motors_active_ms = 0;
}