Skip to content

Commit

Permalink
ActuatorEffectivenessHelicopter: explicitly handle unsaturated case
Browse files Browse the repository at this point in the history
This became necessary otherwise
the allocation reports saturation all
the time and the rate integrator doesn't work.
  • Loading branch information
MaEtUgR authored and dagar committed Dec 12, 2023
1 parent 43ba199 commit 968089b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,38 @@ void ActuatorEffectivenessHelicopter::getUnallocatedControl(int matrix_index, co

} else if (_saturation_flags.roll_neg) {
status.unallocated_torque[0] = -1.f;

} else {
status.unallocated_torque[0] = 0.f;
}

if (_saturation_flags.pitch_pos) {
status.unallocated_torque[1] = 1.f;

} else if (_saturation_flags.pitch_neg) {
status.unallocated_torque[1] = -1.f;

} else {
status.unallocated_torque[1] = 0.f;
}

if (_saturation_flags.yaw_pos) {
status.unallocated_torque[2] = 1.f;

} else if (_saturation_flags.yaw_neg) {
status.unallocated_torque[2] = -1.f;

} else {
status.unallocated_torque[2] = 0.f;
}

if (_saturation_flags.thrust_pos) {
status.unallocated_thrust[2] = 1.f;

} else if (_saturation_flags.thrust_neg) {
status.unallocated_thrust[2] = -1.f;

} else {
status.unallocated_thrust[2] = 0.f;
}
}

0 comments on commit 968089b

Please sign in to comment.