Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
8a3eb7b5
Commit
8a3eb7b5
authored
6 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Plain Diff
Merge branch 'math-helpers'
parents
b68067c7
76fb58d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/math/Helpers.cpp
+2
-6
2 additions, 6 deletions
VirtualRobot/math/Helpers.cpp
VirtualRobot/math/Helpers.h
+1
-2
1 addition, 2 deletions
VirtualRobot/math/Helpers.h
with
3 additions
and
8 deletions
VirtualRobot/math/Helpers.cpp
+
2
−
6
View file @
8a3eb7b5
...
...
@@ -280,18 +280,14 @@ Eigen::Matrix3f Helpers::TransformOrientation(const Eigen::Matrix4f& transform,
Eigen
::
Matrix3f
Helpers
::
Orthogonalize
(
const
Eigen
::
Matrix3f
&
matrix
)
{
return
Orthogonalize
QR
(
matrix
);
return
Orthogonalize
SVD
(
matrix
);
}
Eigen
::
Matrix3f
Helpers
::
OrthogonalizeSVD
(
const
Eigen
::
Matrix3f
&
matrix
)
{
/* Currently, tests fail for SVD. The returned matrices are orthogonal,
* but have high angular distances to the original rotation.
* (e.g. 1.06 rad on Identity with noise, where householder QR has 0 rad)
*/
auto
svd
=
matrix
.
jacobiSvd
(
Eigen
::
ComputeFullU
|
Eigen
::
ComputeFullV
);
Eigen
::
Matrix3f
orth
=
svd
.
matrixU
()
*
svd
.
matrixV
();
Eigen
::
Matrix3f
orth
=
svd
.
matrixU
()
*
svd
.
matrixV
()
.
transpose
()
;
if
(
orth
.
determinant
()
>=
0
)
return
orth
;
else
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/math/Helpers.h
+
1
−
2
View file @
8a3eb7b5
...
...
@@ -140,7 +140,7 @@ namespace math
template
<
typename
Derived
>
static
bool
IsMatrixOrthogonal
(
const
Eigen
::
MatrixBase
<
Derived
>&
matrix
,
float
precision
=
1e-6
f
);
/// Compute the closest orthogonal matrix to the given matrix.
/// Compute the closest orthogonal matrix to the given matrix.
/// (Note: All rotation matrices must be orthogonal.)
static
Eigen
::
Matrix3f
Orthogonalize
(
const
Eigen
::
Matrix3f
&
matrix
);
...
...
@@ -148,7 +148,6 @@ namespace math
static
Eigen
::
Matrix3f
OrthogonalizeQR
(
const
Eigen
::
Matrix3f
&
matrix
);
/// Orthogonolize the given matrix using Jacobi SVD decomposition.
/// (Currently not recommended since it yields high angular distances to the original matrix.)
static
Eigen
::
Matrix3f
OrthogonalizeSVD
(
const
Eigen
::
Matrix3f
&
matrix
);
/// Orthogonolize the orientation of the given pose, and sanitize its lower row.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment