Python bindings: Enable use of Similarity2/Similarity3 in nonlinear optimization#2067
Merged
varunagrawal merged 4 commits intoborglab:developfrom Mar 22, 2025
Merged
Conversation
Member
|
Awesome contribution, @mhalber , many thanks !!!! |
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.
When building python bindings from the develop branch, the installed bindings (v4.3a0) do contain
Similarity2andSimilarity3objects, as well asBetweenFactorSimilarity3. However one cannot use these in optimization (NonlinearFactorGraph/'Values'), since addPriorSimilarity3, insert and at methods are not exposed.This is a simple PR extends python bindings to support nonlinear optimization in python using
Similarity2andSimilarity3constraints.To test the extended python functionality I've added two tests to
test_Sim3.pythat are adopted fromgtsam/geometry/tests/testSimilarity3.cppPlease not that I'm not super familiar with the gtsam codebase. While things seem to be working for my use case, if there are any changes required to merge this to the develop branch I'm very happy to hear your feedback and address any issues.
Thanks!