Copter: Keep FIXED mode when WP_YAW_BEHAVIOR is NONE #28235
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the
CONDITION_YAW
behavior whenWP_YAW_BEHAVIOR
is set to NONE.Previously, Yaw Mode would switch to
HOLD
when reaching a waypoint.This meant that even if
CONDITION_YAW
was used, its effect would be reset upon reaching each WAYPOINT. As a result, the vehicle's yaw could potentially drift due to external factors like wind.With this change, when
WP_YAW_BEHAVIOR
is NONE andCONDITION_YAW
has been used (resulting in FIXED mode), the yaw remains inFIXED
mode even after reaching WAYPOINT, maintaining the desired heading as specified byCONDITION_YAW
.Before
After
Settings:
WP_YAW_BEHAVIOR=0
(None)CONDITION_YAW
withDeg = 10
,Speed = 0
,Dir = 0
,Abs = 0
.Testing:
SITL testing was performed to confirm the behavior. To create a challenging environment for yaw control and to introduce yaw error, the following parameters were used to simulate wind and turbulence.
SIM_WIND_SPD = 10
SIM_WIND_TURB = 10
With these settings, the updated implementation successfully maintained the yaw as expected, with
FIXED
mode persisting throughout WAYPOINT without reverting toHOLD
.