Skip to content
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

Fixed optimization bug under degeneracy #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/lib/BasicLaserMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@ void BasicLaserMapping::optimizeTransformTobeMapped()
matAtB = matAt * matB;
matX = matAtA.colPivHouseholderQr().solve(matAtB);

// NOTE: Handling with the degeneracy problem according to the paper
// J. Zhang, M. Kaess and S. Singh, "On degeneracy of optimization-based state estimation problems,"
// 2016 IEEE International Conference on Robotics and Automation (ICRA), Stockholm, 2016
if (iterCount == 0)
{
Eigen::Matrix<float, 1, 6> matE;
Expand Down Expand Up @@ -877,7 +880,7 @@ void BasicLaserMapping::optimizeTransformTobeMapped()
break;
}
}
matP = matV.inverse() * matV2;
matP = matV2 * matV.inverse();
}

if (isDegenerate)
Expand Down Expand Up @@ -908,4 +911,4 @@ void BasicLaserMapping::optimizeTransformTobeMapped()
}


} // end namespace loam
} // end namespace loam
5 changes: 4 additions & 1 deletion src/lib/BasicLaserOdometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ void BasicLaserOdometry::process()

matX = matAtA.colPivHouseholderQr().solve(matAtB);

// NOTE: Handling with the degeneracy problem according to the paper
// J. Zhang, M. Kaess and S. Singh, "On degeneracy of optimization-based state estimation problems,"
// 2016 IEEE International Conference on Robotics and Automation (ICRA), Stockholm, 2016
if (iterCount == 0)
{
Eigen::Matrix<float, 1, 6> matE;
Expand Down Expand Up @@ -587,7 +590,7 @@ void BasicLaserOdometry::process()
break;
}
}
matP = matV.inverse() * matV2;
matP = matV2 * matV.inverse();
}

if (isDegenerate)
Expand Down