vtol_att only set fw_permanent_stab on param change

This commit is contained in:
Daniel Agar 2017-12-31 19:19:29 -05:00 committed by Lorenz Meier
parent 75e4a856a5
commit d3a220f807
2 changed files with 3 additions and 9 deletions

View File

@ -118,7 +118,6 @@ VtolAttitudeControl::VtolAttitudeControl() :
_params.idle_pwm_mc = PWM_DEFAULT_MIN;
_params.vtol_motor_count = 0;
_params.vtol_fw_permanent_stab = 0;
_params_handles.idle_pwm_mc = param_find("VT_IDLE_PWM_MC");
_params_handles.vtol_motor_count = param_find("VT_MOT_COUNT");
@ -565,7 +564,7 @@ int
VtolAttitudeControl::parameters_update()
{
float v;
int l;
int32_t l;
/* idle pwm for mc mode */
param_get(_params_handles.idle_pwm_mc, &_params.idle_pwm_mc);
@ -573,7 +572,8 @@ VtolAttitudeControl::parameters_update()
param_get(_params_handles.vtol_motor_count, &_params.vtol_motor_count);
/* vtol fw permanent stabilization */
param_get(_params_handles.vtol_fw_permanent_stab, &_params.vtol_fw_permanent_stab);
param_get(_params_handles.vtol_fw_permanent_stab, &l);
_vtol_vehicle_status.fw_permanent_stab = (l == 1);
/* vtol mc mode min airspeed */
param_get(_params_handles.mc_airspeed_min, &v);
@ -726,9 +726,6 @@ void VtolAttitudeControl::task_main()
parameters_update(); // initialize parameter cache
/* update vtol vehicle status*/
_vtol_vehicle_status.fw_permanent_stab = (_params.vtol_fw_permanent_stab == 1);
// make sure we start with idle in mc mode
_vtol_type->set_idle_mc();
@ -788,8 +785,6 @@ void VtolAttitudeControl::task_main()
parameters_update();
}
_vtol_vehicle_status.fw_permanent_stab = (_params.vtol_fw_permanent_stab == 1);
mc_virtual_att_sp_poll();
fw_virtual_att_sp_poll();
vehicle_control_mode_poll(); //Check for changes in vehicle control mode.

View File

@ -49,7 +49,6 @@
struct Params {
int32_t idle_pwm_mc; // pwm value for idle in mc mode
int32_t vtol_motor_count; // number of motors
int32_t vtol_fw_permanent_stab; // in fw mode stabilize attitude also in manual mode
float mc_airspeed_min; // min airspeed in multicoper mode (including prop-wash)
float mc_airspeed_trim; // trim airspeed in multicopter mode
float mc_airspeed_max; // max airpseed in multicopter mode