Work with double scaling

This commit is contained in:
Sander Smeets 2016-12-22 01:12:15 +01:00 committed by Lorenz Meier
parent 17a089af31
commit ba3796ebaf
1 changed files with 3 additions and 2 deletions

View File

@ -1147,8 +1147,9 @@ FixedwingAttitudeControl::task_main()
throttle_sp : 0.0f;
/* scale effort by battery status */
if (_parameters.bat_scale_en && _battery_status.scale > 0.0f) {
_actuators.control[actuator_controls_s::INDEX_THROTTLE] *= _battery_status.scale;
if (_parameters.bat_scale_en && _battery_status.scale > 0.0f &&
_actuators.control[actuator_controls_s::INDEX_THROTTLE] > 0.1f) {
_actuators.control[actuator_controls_s::INDEX_THROTTLE] += (_battery_status.scale - 1);
}