diff --git a/libraries/AP_Landing/AP_Landing_Deepstall.cpp b/libraries/AP_Landing/AP_Landing_Deepstall.cpp index 7974c03492..2ccb77bbeb 100644 --- a/libraries/AP_Landing/AP_Landing_Deepstall.cpp +++ b/libraries/AP_Landing/AP_Landing_Deepstall.cpp @@ -136,6 +136,13 @@ const AP_Param::GroupInfo AP_Landing_Deepstall::var_info[] = { // @User: Advanced AP_GROUPINFO("ABORTALT", 15, AP_Landing_Deepstall, min_abort_alt, 0.0f), + // @Param: AIL_SCL + // @DisplayName: Aileron landing gain scalaing + // @Description: A scalar to reduce or increase the aileron control + // @Range: 0 2.0 + // @User: Advanced + AP_GROUPINFO("AIL_SCL", 16, AP_Landing_Deepstall, aileron_scalar, 1.0f), + AP_GROUPEND }; @@ -329,15 +336,10 @@ bool AP_Landing_Deepstall::override_servos(void) 0.5f, 1.0f); float output = constrain_float(pid, -travel_limit, travel_limit); - SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, output*4500); - SRV_Channels::set_output_scaled(SRV_Channel::k_aileron_with_input, output*4500); + SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, output*4500*aileron_scalar); SRV_Channels::set_output_scaled(SRV_Channel::k_rudder, output*4500); SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0); // this will normally be managed as part of landing, // but termination needs to set throttle control here - } else { - // allow the normal servo control of the channel - SRV_Channels::set_output_scaled(SRV_Channel::k_aileron_with_input, - SRV_Channels::get_output_scaled(SRV_Channel::k_aileron)); } // hand off rudder control to deepstall controlled diff --git a/libraries/AP_Landing/AP_Landing_Deepstall.h b/libraries/AP_Landing/AP_Landing_Deepstall.h index 932d82d697..38a17e23e7 100644 --- a/libraries/AP_Landing/AP_Landing_Deepstall.h +++ b/libraries/AP_Landing/AP_Landing_Deepstall.h @@ -68,6 +68,7 @@ private: AP_Float yaw_rate_limit; AP_Float time_constant; AP_Float min_abort_alt; + AP_Float aileron_scalar; int32_t loiter_sum_cd; // used for tracking the progress on loitering deepstall_stage stage; Location landing_point;