Skip to content

[Issue-122] Pass shortest arg for interp; optionally enforce non-negative scalar … #123

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

Merged
merged 3 commits into from
May 13, 2024

Conversation

jcao-bdai
Copy link
Collaborator

@jcao-bdai jcao-bdai commented May 5, 2024

Implements changes from discussions under Issue 122.

@@ -937,6 +943,10 @@ def trinterp2(start, end, s):

th0 = math.atan2(start[1, 0], start[0, 0])
th1 = math.atan2(end[1, 0], end[0, 0])
if shortest:
delta = (th1 - th0 + math.pi) % (math.pi * 2) - math.pi
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets make this a function if the code is dupllicated twice

Copy link
Collaborator Author

@jcao-bdai jcao-bdai May 13, 2024

Choose a reason for hiding this comment

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

found an existing function - updates are pushed in 55a650c

@jcao-bdai jcao-bdai force-pushed the pass-shortest-interp-arg branch from e83f30e to 55a650c Compare May 13, 2024 13:04
@jcao-bdai jcao-bdai requested a review from myeatman-bdai May 13, 2024 13:14
Copy link
Collaborator

@myeatman-bdai myeatman-bdai left a comment

Choose a reason for hiding this comment

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

Thanks!

@myeatman-bdai myeatman-bdai merged commit 1cf7d92 into master May 13, 2024
19 checks passed
@myeatman-bdai myeatman-bdai deleted the pass-shortest-interp-arg branch May 13, 2024 14:27
@petercorke
Copy link
Collaborator

Sorry not to have piped up earlier. I think the option for r2q shouldn't be called shortest. Shortest makes sense when talking about a direction around a great circle, but here the option would be better called positive. But it might be better to discard the option entirely, and always return the quaternion with positive scalar. Since e and -e are the same rotation, there is nothing wrong making this call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants