Skip to content

Python bindings: Enable use of Similarity2/Similarity3 in nonlinear optimization#2067

Merged
varunagrawal merged 4 commits intoborglab:developfrom
mhalber:features/similarity_python_bindings
Mar 22, 2025
Merged

Python bindings: Enable use of Similarity2/Similarity3 in nonlinear optimization#2067
varunagrawal merged 4 commits intoborglab:developfrom
mhalber:features/similarity_python_bindings

Conversation

@mhalber
Copy link
Copy Markdown

@mhalber mhalber commented Mar 21, 2025

When building python bindings from the develop branch, the installed bindings (v4.3a0) do contain Similarity2 and Similarity3 objects, as well as BetweenFactorSimilarity3. 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 Similarity2 and Similarity3 constraints.

To test the extended python functionality I've added two tests to test_Sim3.py that are adopted from gtsam/geometry/tests/testSimilarity3.cpp

Please 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!

Copy link
Copy Markdown
Contributor

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@varunagrawal varunagrawal merged commit fae071d into borglab:develop Mar 22, 2025
36 checks passed
@dellaert
Copy link
Copy Markdown
Member

Awesome contribution, @mhalber , many thanks !!!!

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.

4 participants