-
Notifications
You must be signed in to change notification settings - Fork 795
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
add failing unit test on axisAngle for Rot3 in c++ #887
Conversation
Wait, why CI is successful if the unit tests fail? |
@ProfFan I'm pleased to say the new python unit test now successfully fails : - ) For some reason, I don't see the output of any c++ unit tests in the CI. Are we still running those in CI?
|
Oh dang. It seems that we accidentally disabled all C++ tests? @varunagrawal |
I am seeing the C++ CI no problem. Am I missing something? |
@varunagrawal could you share a screenshot of the c++ unit test summary you see being run in the CI (from the logs)? |
I misunderstood what the issue is. This is my fault, I updated the CI to be faster and made a small mistake... |
@johnwlambert Could you merge develop? |
I think Fan means merge develop into this branch. We can’t merge TO develop until issue is fixed. |
…ailing-axis-angle-test-c++
Robust Conversion from Matrix to Axis Angle Form 1 IntroductionRobust conversion from matrix to axis-angle form is not trivial because the 1.1 Basic ConversionIt is known that the conversion from a matrix can be Theorem 1: The rotation angle
where is the trace of the rotation matrix. As such, the normalized rotation axis is: Theorem 2: The normalized rotation axis for a rotation matrix
where are the elements in the matrix. 2 Problemsin(x)02*piCannot process embedded image Figure 1.$\sin (x)$ It's pretty straightforward that when , Thus we know that there are two singular points, 3 Properties of the
|
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.
Fan, John, i think we should merge even in absence of the revised PDF from Fan (which I asked for in a meeting) because this is a bug that needs to be squashed. However, I’m asking Fan to fix the logic for argmax, after which I will take another look. email me when it’s done.
gtsam/geometry/SO3.cpp
Outdated
if (tr + 1.0 < 1e-4) { | ||
std::vector<double> diags = {R11, R22, R33}; | ||
size_t max_elem = std::distance(diags.begin(), std::max_element(diags.begin(), diags.end())); | ||
if (max_elem == 2) { |
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’d prefer if we do
If (R11>R22 && R11>R33)
Else if (R22>R33)
Else
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.
done
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.
@johnwlambert could you merge after running your python tests again and pasting the results in the conversation? I remember you had a script that did a statistical analysis as to how many times it failed in 100K calls or so?
@dellaert @ProfFan just ran some analysis. The results are definitely much better than before now. We still get several dozen cases where the angle exceeds 180 degrees from those 165 previous failures. The failures are now on the order of 180.1 to 180.5 degrees, vs. expected 179.x. Do we want to continue to try to get the last decimal place? I can add these test cases to the unit tests, if so. |
@johnwlambert Let's land this first. Could you put up another PR that includes the case that fails? |
Sure, thanks for merging |
Adds tests to expose broken axis-angle for edge cases. See #886 for more details.