-
Notifications
You must be signed in to change notification settings - Fork 126
added test to make sure ov is being calculated correctly #5464
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
base: main
Are you sure you want to change the base?
Conversation
|
|
|
@bgrigsby8 the test you added seems to be failing. How did you determine the correct answer? |
spatialmath/orientation_test.go
Outdated
| } | ||
|
|
||
| func TestOrientationVectorPoleRadius(t *testing.T) { | ||
| ov := &OrientationVector{Theta: 90.2029644505, OX: 0.0050164674, OY: 0.0079070413, OZ: 0.9999561559} |
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.
I think you meant to use OrientationVectorDegrees here. The test still fails, but much more reasonably:
=== RUN TestOrientationVectorPoleRadius
orientation_test.go:161: Expected '90.20295555178383' to almost equal '90.2029644505' (but it didn't)!
I am confused though why if I instead change everything to radians, the test failure gets worse. Code:
ov := &OrientationVector{Theta: 1.5743387247206226, OX: 0.0050164674, OY: 0.0079070413, OZ: 0.9999561559}
q := Quaternion(ov.Quaternion())
composedOv := q.OrientationVectorRadians()
test.That(t, composedOv.Theta, test.ShouldAlmostEqual, ov.Theta, 0.000001)
Gives:
=== RUN TestOrientationVectorPoleRadius
orientation_test.go:162: Expected '0.009364093511798814' to almost equal '0.00501646740007625' (but it didn't)!
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.
(I assume theta is the only thing in degrees/radians, but I don't really know any of this stuff)
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.
Yes, this test was meant to fail. I was meant to use OrientationVectorDegrees, but this orientation_test.go:162: Expected '0.009364093511798814' to almost equal '0.00501646740007625' (but it didn't)! is what im experiencing and real life and wanted to create a test to capture the failure. I'm working with @nicksanford on this
Availability
Quality
Performance
The above data was generated by running scenes defined in the
|
No description provided.