Repository navigation
Add a matrix-weighted localization example with a stereo camera - #2960
avinashresearch1 wants to merge 4 commits into
Conversation
Add StereoCamera::backprojectWithCovariance, which back-projects a stereo measurement and returns the point with its first-order covariance H * Sigma_z * H^T, where H is the Jacobian of backproject2 with respect to the measurement, evaluated at the measurement. One overload takes the 3x3 covariance of (uL, uR, v) and the other an isotropic pixel sigma. The point and its covariance are both in the world frame. Wrap both overloads for Python, test them in C++ and Python against the closed form of Holmes, Dümbgen and Barfoot (T-RO 2024, App. E), and document the method in StereoCamera.ipynb. Correct the backproject2 doc comment and notebook section, which described H2 as the derivative with respect to the point rather than the measurement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LandmarkLocalizationDataset.write_g2o writes the class's own poses and landmarks, with the odometry noise fixed at ODOMETRY_SIGMA = 0.1, so other landmark localization problems cannot use it. Move its body to a module-level write_g2o(filename, wTks, wLs, measurements, odometry_sigma), and have the method call it with the class's values. The committed known_landmark_localization_3.g2o and _20.g2o files are unchanged, which the existing reproducibility test checks. Test that the new function writes the poses, landmarks and odometry sigma it is given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CertifiableLocalizationExample takes an optional path to a g2o file. Without one it solves known_landmark_localization_20.g2o, as before. The stereo localization notebook writes a file in the same format, and the example solves that file too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add CertifiableStereoLocalization.ipynb, "Matrix-weighted localization with a stereo camera". A downward-looking stereo camera on a ring of 20 poses observes 8 known landmarks, as in the matrix-weighted example of Duembgen, Holmes and Barfoot (WAFR 2024) with its random poses replaced by a ring. StereoCamera.backprojectWithCovariance turns noisy pixels into points with full covariances, needles 40 to 67 times longer than they are wide. The notebook writes the problem with LandmarkLocalizationDataset.write_g2o, reads it back as a certifiable graph, solves it with Levenberg-Marquardt, certifies the solution with the chordal SDP, and plots the covariance ellipsoids and trajectories with Plotly. The SDP cell is skipped without MOSEK, as in the certifiable localization example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed [P2] Check solver convergence before claiming global certification. The boolean returned by Require a solver solution status establishing optimality before treating the primal optimum as an approximate lower bound, or compare against a valid dual bound with the appropriate feasibility/convergence checks. Otherwise report the outcome as uncertified. The current fixed example converges successfully; its small negative gap is ordinary numerical tolerance, not evidence of false certification. Validation:
Limitations: reused existing builds rather than rebuilding GTSAM; MATLAB calls and the Colab installation path were not exercised. No code changes made. Review by Codex. |
[WIP] still being reviewed by Avinash
Closes #2958.
This example shows how to use GTSAM’s stereo camera model to generate anisotropic measurement weights for matrix-weighted localization. It builds a downward-facing stereo camera trajectory, perturbs the pixel observations, and propagates that noise through backprojection to obtain a covariance for each landmark observation. The notebook writes the resulting graph to g2o, reads it back, and compares a local solve with the chordal SDP certificate when MOSEK is available.
The example changes are the last three commits on the branch:
write_g2oas a module-level function so an example can supply its own poses, landmarks, measurement information, and odometry noise. The dataset method still delegates with its existing defaults.The first commit is the stereo covariance API from #2959, which the notebook calls. The fork PR isolates the three example commits for review.
The fork PR records full Python test discovery, notebook runs with and without MOSEK, C++ example runs on both the bundled and stereo datasets, and the code-quality checks. It also documents the existing GCC warning encountered in the MOSEK build.
🤖 Posted by an AI agent · harness: unknown · model: unknown
Review: unreviewed
Session: 01a1d519-ba1b-7961-bb2c-d47306ad294e