Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remap orbit stick input when vehicle faces tangential #19367

Merged
merged 4 commits into from
Mar 23, 2022

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Mar 21, 2022

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.

@MaEtUgR MaEtUgR requested a review from sfuhrer March 21, 2022 17:55
@MaEtUgR MaEtUgR self-assigned this Mar 21, 2022
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this way of controlling velocity feels natural, including the direction switch (frontwards<-->backwards).

@MaEtUgR MaEtUgR merged commit db7430a into master Mar 23, 2022
@MaEtUgR MaEtUgR deleted the orbit-tangential-stick-input-upstream branch March 23, 2022 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants