-
Notifications
You must be signed in to change notification settings - Fork 68
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
Added Conditions for Slerp vs Squad interpolation #577
base: gz-math7
Are you sure you want to change the base?
Conversation
Signed-off-by: sdhar04 <[email protected]>
test/interpolation.sh
Outdated
@@ -0,0 +1,20 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this file required? It looks like an example, a test required some expectations or asserts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue asks for smoother movements which are brought about by Slerp under the threshold, while Squad works just fine above it. I don’t know how to assert if a given interpolation is smooth or not, so I added this file for anyone to check the movements themselves.
Signed-off-by: sdhar04 <[email protected]>
@ahcorde I have removed the bash script |
@sdhar04 Can you address these lint issues?
|
Signed-off-by: sdhar04 <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gz-math7 #577 +/- ##
============================================
- Coverage 94.11% 94.11% -0.01%
============================================
Files 146 146
Lines 9809 9816 +7
============================================
+ Hits 9232 9238 +6
- Misses 577 578 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: sdhar04 <[email protected]>
@mjcarroll @azeey I have addressed the lint issues and reduced the scope of 2 variables only required for Squad interpolation. However, the tests don't seem to invoke the cases where Slerp is used, hence the codecov warnings. I have a bash script I used during testing to supply target orientations and both algorithms are used in my test cases (I checked by printing which one was invoked), with the interpolation being desirably smooth. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
using namespace gz; | ||
using namespace math; | ||
|
||
using namespace std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
*/ | ||
#include "gz/math/Quaternion.hh" | ||
#include "gz/math/RotationSpline.hh" | ||
#include "cmath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*/ | |
#include "gz/math/Quaternion.hh" | |
#include "gz/math/RotationSpline.hh" | |
#include "cmath" | |
*/ | |
#include <cmath> | |
#include "gz/math/Quaternion.hh" | |
#include "gz/math/RotationSpline.hh" |
Hi @sdhar04 , was wondering what the status on this was. Do we intend shipping this change with ionic (code freeze 26/8)? If we can't come to a consensus by then I will remove the beta label (I personally would prefer seeing it in this release). |
🎉 New feature
Closes #568
Summary
I have added conditionals for using the Slerp algorithm when the difference in final and initial orientations falls within a threshold. Otherwise Squad is invoked.
Test it
You can open Gazebo and run the bash script I have added in gz-math/test which publishes a new position and orientation to the camera every 2 seconds.
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸