Browse Source

control_allocator: ensure unused outputs are initialized to min

Mostly important in cases where the ouputs would change (e.g. param change)
release/1.12
Beat Küng 5 years ago committed by Daniel Agar
parent
commit
3606f86518
  1. 4
      src/modules/control_allocator/ControlAllocation/ControlAllocation.cpp

4
src/modules/control_allocator/ControlAllocation/ControlAllocation.cpp

@ -52,6 +52,10 @@ ControlAllocation::setEffectivenessMatrix( @@ -52,6 +52,10 @@ ControlAllocation::setEffectivenessMatrix(
_control_trim = _effectiveness * _actuator_trim;
_num_actuators = num_actuators;
// make sure unused actuators are initialized to min
for (int i = num_actuators; i < NUM_ACTUATORS; ++i) {
_actuator_sp(i) = _actuator_min(i);
}
}
void

Loading…
Cancel
Save