Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
3rd
eigen
Commits
4ec3f868
Commit
4ec3f868
authored
11 years ago
by
Gael Guennebaud
Browse files
Options
Download
Email Patches
Plain Diff
Stabilize eulerangle unit test.
parent
40aa957e
master
branches/3.2
branches/3.3
branches/Anshul-Jaiswal/update-configurevectorizationh-to-not-op-1573079916090
branches/default
3.3.7
3.3.6
3.3.5
3.3.4
3.3.3
3.3.2
3.3.1
3.3.0
3.3-rc2
3.3-rc1
3.3-beta2
3.3-beta1
3.3-alpha1
3.2.10
3.2.9
3.2.8
3.2.7
3.2.6
3.2.5
3.2.4
3.2.3
3.2.2
3.2.1
3.2.0
3.2-rc2
3.2-rc1
before-evaluators
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/geo_eulerangles.cpp
+4
-1
test/geo_eulerangles.cpp
with
4 additions
and
1 deletion
+4
-1
test/geo_eulerangles.cpp
View file @
4ec3f868
...
...
@@ -17,13 +17,16 @@ template<typename Scalar> void check_all_var(const Matrix<Scalar,3,1>& ea)
typedef
Matrix
<
Scalar
,
3
,
3
>
Matrix3
;
typedef
Matrix
<
Scalar
,
3
,
1
>
Vector3
;
typedef
AngleAxis
<
Scalar
>
AngleAxisx
;
using
std
::
abs
;
#define VERIFY_EULER(I,J,K, X,Y,Z) { \
Matrix3 m(AngleAxisx(ea[0], Vector3::Unit##X()) * AngleAxisx(ea[1], Vector3::Unit##Y()) * AngleAxisx(ea[2], Vector3::Unit##Z())); \
Vector3 eabis = m.eulerAngles(I,J,K); \
Matrix3 mbis(AngleAxisx(eabis[0], Vector3::Unit##X()) * AngleAxisx(eabis[1], Vector3::Unit##Y()) * AngleAxisx(eabis[2], Vector3::Unit##Z())); \
VERIFY_IS_APPROX(m, mbis); \
if(I!=K || ea[1]!=0) VERIFY_IS_APPROX(ea, eabis); \
/* If I==K, and ea[1]==0, then there no unique solution. */
\
/* The remark apply in the case where I!=K, and |ea[1]| is close to pi/2. */
\
if( (I!=K || ea[1]!=0) && (I==K || !internal::isApprox(abs(ea[1]),Scalar(M_PI/2),test_precision<Scalar>())) ) VERIFY((ea-eabis).norm() <= test_precision<Scalar>()); \
}
VERIFY_EULER
(
0
,
1
,
2
,
X
,
Y
,
Z
);
VERIFY_EULER
(
0
,
1
,
0
,
X
,
Y
,
X
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help