Skip to content

Compute covs - #314

Merged
koide3 merged 4 commits into
masterfrom
compute_covs
Jul 7, 2026
Merged

Compute covs#314
koide3 merged 4 commits into
masterfrom
compute_covs

Conversation

@koide3

@koide3 koide3 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds optional marginal covariance computation for the latest odometry frame (pose/velocity/bias) and exposes a mechanism to enable it via config and a callback, storing results on EstimationFrame for downstream consumers.

Changes:

  • Introduces compute_covs parameter and plumbing to trigger marginal covariance computation.
  • Computes and stores marginal covariances on the latest frame (IMU: pose/vel/bias; CT: pose).
  • Extends EstimationFrame with covariance fields and initialization, and adds a new callback slot for requesting covariance computation.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/glim/odometry/odometry_estimation_imu.cpp Registers a “compute covariances” request callback and computes marginal covariances for X/V/B on the latest IMU frame.
src/glim/odometry/odometry_estimation_ct.cpp Registers the request callback and computes marginal pose covariance for the latest CT frame.
src/glim/odometry/estimation_frame.cpp Adds EstimationFrame constructor/destructor initializing covariance-related fields.
src/glim/odometry/callbacks.cpp Defines the new static callback slot request_to_compute_covariances.
include/glim/odometry/odometry_estimation_imu.hpp Adds compute_covs parameter to IMU params.
include/glim/odometry/odometry_estimation_ct.hpp Adds compute_covs parameter to CT params.
include/glim/odometry/estimation_frame.hpp Adds covariance fields and ctor/dtor declarations to EstimationFrame.
include/glim/odometry/callbacks.hpp Documents and declares request_to_compute_covariances callback slot.
config/config_odometry_gpu.json Documents and adds compute_covs config key.
config/config_odometry_ct.json Documents and adds compute_covs config key.
config/config_odometry_cpu.json Adds compute_covs config key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 51 to +54
bool use_isam2_dogleg; ///< If true, use dogleg optimizer
double isam2_relinearize_skip;
double isam2_relinearize_thresh;
bool compute_covs; ///< If true, compute marginal covariances of the latest frame.
Comment on lines +76 to +79
Callbacks::request_to_compute_covariances.add([this]() {
logger->debug("request to compute marginal covs");
this->params.compute_covs = true;
});
Comment on lines +112 to +115
Callbacks::request_to_compute_covariances.add([this]() {
logger->debug("request to compute marginal covs");
params->compute_covs = true;
});
Comment on lines +276 to +280
if (params.compute_covs) {
logger->debug("computing marginal covariances of the latest frame");
new_frame->cov_computed = true;
new_frame->pose_cov = smoother->marginalCovariance(X(current));
}
Comment on lines +422 to +428
if (params->compute_covs) {
auto latest_frame = frames[current];
latest_frame->cov_computed = true;
latest_frame->pose_cov = smoother->marginalCovariance(X(current));
latest_frame->vel_cov = smoother->marginalCovariance(V(current));
latest_frame->bias_cov = smoother->marginalCovariance(B(current));
}
@koide3
koide3 merged commit d0eeebe into master Jul 7, 2026
5 checks passed
@koide3
koide3 deleted the compute_covs branch July 7, 2026 08:55
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