Skip to content

Commit

Permalink
Centralize yaw margin (#23982)
Browse files Browse the repository at this point in the history
  • Loading branch information
somebody-once-told-me authored Nov 20, 2024
1 parent b891961 commit 3943025
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class ControlAllocationSequentialDesaturation: public ControlAllocationPseudoInv
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:

/**
Expand Down

0 comments on commit 3943025

Please sign in to comment.