Remap orbit stick input when vehicle faces tangential #19367
Merged
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.
Describe problem solved by this pull request
When flying an orbit with the yaw behavior
ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE
where the vehicle is facing tangential to the circle and hence facing the direction of travel it's unintuitive to change the radius and velocity of the orbit with the usual stick mapping. This is because usually the stick input is mapped in the body yaw frame.Describe your solution
I changed the stick input to also act 90° offset compared to when flying with the vehicle facing the center of the circle. Such that's intuitively in body yaw frame.
Doing that I found the direction of where the vehicle is facing and hence also how the stick input is mapped would change 180° when switching rotation direction. This makes direction switches by stick unusable. To work around the problem I made the vehicle go backward when the rotation direction is switched by stick input.
Test data / coverage
This was tested in SITL and on a real vehicle that mostly uses
ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE
.