-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP constraints with precision matrix #5
base: knight
Are you sure you want to change the base?
Changes from all commits
9e5903f
1e4e84f
7a81fe2
d9ba9a9
af3711a
fabc014
d4d857d
14bf694
efe9052
9f8fdc7
b19fed8
ef0f335
97abc83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,19 +258,33 @@ void ConstraintBuilder2D::ComputeConstraint( | |
// Use the CSM estimate as both the initial and previous pose. This has the | ||
// effect that, in the absence of better information, we prefer the original | ||
// CSM estimate. | ||
|
||
ceres::Solver::Summary unused_summary; | ||
Eigen::Matrix3d seedless_precision; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May consider initializing to zeros here. Ceres also uses sparse matrices(sometimes) and depending on the implementation, there may be a condition in which the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm. Good catch. Will do. |
||
ceres_scan_matcher_.Match(pose_estimate.translation(), pose_estimate, | ||
constant_data->filtered_gravity_aligned_point_cloud, | ||
*submap_scan_matcher.grid, &pose_estimate, | ||
&unused_summary); | ||
&unused_summary, &seedless_precision); | ||
|
||
const transform::Rigid2d constraint_transform = | ||
ComputeSubmapPose(*submap).inverse() * pose_estimate; | ||
|
||
auto seedless_precision_chol_up = [&](){ | ||
if (not options_.use_precision_matrix()) | ||
return Eigen::Matrix3d::Identity().eval(); | ||
|
||
return Eigen::Matrix3d( | ||
Eigen::Matrix3d(seedless_precision.llt().matrixU()) // Choleskey | ||
* Eigen::Vector3d(0.02, 0.02, 0.01).asDiagonal() // FIXME fudge factor to match normal constraint SPA error | ||
); | ||
}(); | ||
|
||
constraint->reset(new Constraint{submap_id, | ||
node_id, | ||
{transform::Embed3D(constraint_transform), | ||
options_.loop_closure_translation_weight(), | ||
options_.loop_closure_rotation_weight()}, | ||
options_.loop_closure_rotation_weight(), | ||
seedless_precision_chol_up}, | ||
Constraint::INTER_SUBMAP}); | ||
|
||
if (options_.log_matches()) { | ||
|
@@ -288,6 +302,7 @@ void ConstraintBuilder2D::ComputeConstraint( | |
<< std::setprecision(3) << std::abs(difference.normalized_angle()); | ||
} | ||
info << " with score " << std::setprecision(1) << 100. * score << "%."; | ||
info << "\nPrecision was: \n" << seedless_precision; | ||
LOG(INFO) << info.str(); | ||
} | ||
} | ||
|
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.
Not of any concern here, but there is also
problem.Evaluate
method that can populate residuals and jacobians using the final solution. FYIThere 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 didn't use that one because the problem still has the seed in it. As far as I've read removing a cost function can mess up the jacobians.