Skip to content

Fix shared pointer handling in MATLAB bindings - #2725

Closed
ProfFan wants to merge 1 commit into
developfrom
fix/matlab-shared-pointer-codegen
Closed

Fix shared pointer handling in MATLAB bindings#2725
ProfFan wants to merge 1 commit into
developfrom
fix/matlab-shared-pointer-codegen

Conversation

@ProfFan

@ProfFan ProfFan commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • normalize shared-ownership declarations to the wrapper T* DSL so MATLAB and Python generate the intended shared_ptr ownership
  • add named StereoPoint2Vector and Cal3_S2StereoVector bindings for MATLAB and unstable Python
  • preserve existing Python iterable inputs for the new bound vectors
  • add shared-pointer lifetime and batch-container regression coverage

Dependency

Depends on borglab/wrap#200 for the MATLAB shared-pointer property-setter generator fix. This PR intentionally contains no direct wrap subtree changes.

Testing

@ProfFan
ProfFan requested a review from dellaert August 21, 2026 22:50
Use the wrapper pointer DSL consistently for shared ownership and add named stereo measurement and calibration vector bindings with Python and MATLAB lifetime coverage. The MATLAB generator fix lives upstream in borglab/wrap#200.
@ProfFan
ProfFan force-pushed the fix/matlab-shared-pointer-codegen branch from d0ce487 to 1bf85a1 Compare August 21, 2026 22:58
@dellaert

Copy link
Copy Markdown
Member

OK, hold up. The reason the signatures changed was that we could then use pointers instead of lambdas. That only works if the signatures are identical, so I had a PR in wrap (that can still be merged) that takes these identical signatures.

I think you wanted to look into an alternative PR in wrap, but if you want to use method pointers, I think you will need those identical signatures unless you have an other mechanism that doesn’t care about this.

discuss :-)

@dellaert

Copy link
Copy Markdown
Member

Would you also be good to say what prompted this PR, for history’s sake

@ProfFan

ProfFan commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

This is not needed because we have another path which is let wrap directly support std::shared_ptr etc

@ProfFan ProfFan closed this Aug 22, 2026
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