Skip to content

Conversation

StonerLing
Copy link
Contributor

The previous method is sensitive to priors with extreme covariances, producing unstable RANSAC thresholds.
This PR computes the mean RMS stddev from valid covariances and scale it by sqrt(chi-square 95% quantile, dof=3)
to yield an approximate 95% 3D confidence radius.

Comment on lines +1056 to +1061
const double trace = pose_prior.position_covariance.trace();
if (trace > 0.0) {
const double rms_stddev = std::sqrt(trace / 3.0);
sum_rms_stddev += rms_stddev;
++num_valid_covs;
}
Copy link
Contributor

@ahojnnes ahojnnes Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about the following? This would be more robust to outliers?

std::vector<double> rms_vars;
for (const auto& [_, pose_prior] : pose_priors_) {
  if (pose_prior.IsCovarianceValid()) {
    const double trace = pose_prior.position_covariance.trace();
          if (trace > 0.0) {
            const double rms_stddev = trace / 3.0;
            rms_vars.push_back(rms_var);
          }
    
  }
}
ransac_options.max_error = std::sqrt(kChiSquare95ThreeDof * Median(rms_vars));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants