Compute covs - #314
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_covsparameter and plumbing to trigger marginal covariance computation. - Computes and stores marginal covariances on the latest frame (IMU: pose/vel/bias; CT: pose).
- Extends
EstimationFramewith 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)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.