Skip to content
Snippets Groups Projects
Commit e5a423d1 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix implementations of orthogonalize_qr and orthogonalize_svd (they were swapped)

parent ac60952f
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,22 @@ Eigen::Matrix3f simox::math::orthogonalize(const Eigen::Matrix3f& matrix)
Eigen::Matrix3f simox::math::orthogonalize_svd(const Eigen::Matrix3f& matrix)
{
auto svd = matrix.jacobiSvd(Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::Matrix3f orth = svd.matrixU() * svd.matrixV().transpose();
if (orth.determinant() >= 0)
{
return orth;
}
else
{
return -orth;
}
}
Eigen::Matrix3f simox::math::orthogonalize_qr(const Eigen::Matrix3f& matrix)
{
auto householder = matrix.householderQr();
Eigen::Matrix3f orth = householder.householderQ();
......@@ -30,22 +46,6 @@ Eigen::Matrix3f simox::math::orthogonalize_svd(const Eigen::Matrix3f& matrix)
}
Eigen::Matrix3f simox::math::orthogonalize_qr(const Eigen::Matrix3f& matrix)
{
auto svd = matrix.jacobiSvd(Eigen::ComputeFullU | Eigen::ComputeFullV);
Eigen::Matrix3f orth = svd.matrixU() * svd.matrixV().transpose();
if (orth.determinant() >= 0)
{
return orth;
}
else
{
return -orth;
}
}
Eigen::Matrix4f simox::math::orthogonalize_pose(const Eigen::Matrix4f& pose)
{
Eigen::Matrix4f orth = pose;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment