Skip to content

Commit

Permalink
Remove ternary operator and make the two functions consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
tizianoGuadagnino committed Nov 12, 2024
1 parent 0fa8ecf commit 947cae3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ CorrespondenceThreshold::CorrespondenceThreshold(const double map_discretization
num_samples_(1e-8) {}

double CorrespondenceThreshold::ComputeThreshold() const {
if (!use_adaptive_threshold_) return fixed_threshold_;

const double moder_error_variance = std::sqrt(model_sse_ / num_samples_);
const double adaptive_threshold = 3.0 * (map_discretization_error_ + moder_error_variance);
return use_adaptive_threshold_ ? adaptive_threshold : fixed_threshold_;
return adaptive_threshold;
}

void CorrespondenceThreshold::UpdateModelError(const Sophus::SE3d &current_deviation) {
Expand Down

0 comments on commit 947cae3

Please sign in to comment.