Nav course hold yaw stick control improvement for fixed wing #10187
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.
Fixes an issue when using the yaw stick to alter course during Nav course hold on fixed wing where the plane reverses the turn direction during adjustment. This is caused by the desired course adjusting faster than the plane can turn until the heading error gets close to 180 degrees causing a turn reversal. PR fixes this by limiting the max allowed heading error. Limiting the heading error to the demanded turn rate works well, not only preventing the turn reversal but also making adjustment more proportional to yaw stick movement.
Change also sets the desired course to the current course over ground and also resets the position controller when adjustment is finished. This helps to prevent course adjustment overshoot when the yaw stick is released so the new course aligns better with the direction the plane was pointing when the yaw stick was released.
Tested OK on HITL but needs more testing for different plane types . Also needs testing on multirotor.