Centralize yaw margin (#23982)

This commit is contained in:
somebody-once-told-me 2024-11-20 03:52:36 -05:00 committed by GitHub
parent b891961a0c
commit 3943025f32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -219,7 +219,7 @@ ControlAllocationSequentialDesaturation::mixYaw()
// Change yaw acceleration to unsaturate the outputs if needed (do not change roll/pitch),
// and allow some yaw response at maximum thrust
ActuatorVector max_prev = _actuator_max;
_actuator_max += (_actuator_max - _actuator_min) * 0.15f;
_actuator_max += (_actuator_max - _actuator_min) * MINIMUM_YAW_MARGIN;
desaturateActuators(_actuator_sp, yaw);
_actuator_max = max_prev;

View File

@ -57,6 +57,10 @@ public:
void allocate() override;
void updateParameters() override;
// This is the minimum actuator yaw granted when the controller is saturated.
// In the yaw-only case where outputs are saturated, thrust is reduced by up to this amount.
static constexpr float MINIMUM_YAW_MARGIN{0.15f};
private:
/**