Skip to content

Commit 20ad38e

Browse files
committed
better debug message
1 parent 0cef440 commit 20ad38e

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

teaser/src/registration.cc

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
3232

3333
int N = X.cols();
3434
std::vector<std::pair<double, int>> h;
35-
for (size_t i= 0 ;i < N ;++i){
36-
h.push_back(std::make_pair(X(i) - ranges(i), i+1));
37-
h.push_back(std::make_pair(X(i) + ranges(i), -i-1));
35+
for (size_t i = 0; i < N; ++i) {
36+
h.push_back(std::make_pair(X(i) - ranges(i), i + 1));
37+
h.push_back(std::make_pair(X(i) + ranges(i), -i - 1));
3838
}
3939

4040
// ascending order
41-
std::sort(h.begin(), h.end(), [](std::pair<double, int> a, std::pair<double, int> b) { return a.first < b.first; });
41+
std::sort(h.begin(), h.end(),
42+
[](std::pair<double, int> a, std::pair<double, int> b) { return a.first < b.first; });
4243

4344
// calculate weights
4445
Eigen::RowVectorXd weights = ranges.array().square();
@@ -51,10 +52,10 @@ void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
5152
double dot_X_weights = 0;
5253
double dot_weights_consensus = 0;
5354
int consensus_set_cardinal = 0;
54-
double sum_xi = 0;
55+
double sum_xi = 0;
5556
double sum_xi_square = 0;
5657

57-
for (size_t i = 0 ; i < nr_centers ; ++i){
58+
for (size_t i = 0; i < nr_centers; ++i) {
5859

5960
int idx = int(std::abs(h.at(i).second)) - 1; // Indices starting at 1
6061
int epsilon = (h.at(i).second > 0) ? 1 : -1;
@@ -68,9 +69,9 @@ void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
6869

6970
x_hat(i) = dot_X_weights / dot_weights_consensus;
7071

71-
double residual = consensus_set_cardinal * x_hat(i) * x_hat(i) + sum_xi_square - 2 * sum_xi * x_hat(i);
72+
double residual =
73+
consensus_set_cardinal * x_hat(i) * x_hat(i) + sum_xi_square - 2 * sum_xi * x_hat(i);
7274
x_cost(i) = residual + ranges_inverse_sum;
73-
7475
}
7576

7677
size_t min_idx;
@@ -433,7 +434,8 @@ teaser::RobustRegistrationSolver::solve(const Eigen::Matrix<double, 3, Eigen::Dy
433434
*/
434435
src_tims_ = computeTIMs(src, &src_tims_map_);
435436
dst_tims_ = computeTIMs(dst, &dst_tims_map_);
436-
TEASER_DEBUG_INFO_MSG("Starting scale solver.");
437+
TEASER_DEBUG_INFO_MSG(
438+
"Starting scale solver (only selecting inliers if scale estimation has been disabled.");
437439
solveForScale(src_tims_, dst_tims_);
438440
TEASER_DEBUG_INFO_MSG("Scale estimation complete.");
439441

@@ -507,10 +509,10 @@ teaser::RobustRegistrationSolver::solve(const Eigen::Matrix<double, 3, Eigen::Dy
507509
pruned_dst_tims_.col(i) = dst.col(leaf) - dst.col(root);
508510

509511
// populate the TIMs map
510-
dst_tims_map_rotation_(0,i) = leaf;
511-
dst_tims_map_rotation_(1,i) = root;
512-
src_tims_map_rotation_(0,i) = leaf;
513-
src_tims_map_rotation_(1,i) = root;
512+
dst_tims_map_rotation_(0, i) = leaf;
513+
dst_tims_map_rotation_(1, i) = root;
514+
src_tims_map_rotation_(0, i) = leaf;
515+
src_tims_map_rotation_(1, i) = root;
514516
}
515517
} else {
516518
// complete graph

0 commit comments

Comments
 (0)