Skip to content

Conversation

@nickbianco
Copy link
Member

@nickbianco nickbianco commented Dec 17, 2025

Brief summary of changes

In some cases, SWIG struggles with creating bindings for classes with subclasses, and this is the case for ExponentialContactForce on Windows builds. This change removes the ExponentialContactForce::Parameters subclass and moves all of the properties into ExponentialContactForce. Additionally, ExponentialContactForce has been refactored to not expose SimTK::ExponentialSpringParameters to the user, which should be more friendly to scripting users.

A brief list of individual changes:

  • Getter and setter methods are added to ExponentialContactForce for each property. The getter methods return the value stored in the internal SimTK::ExponentialSpringParameters. The setter methods handle syncing the property value updates with the internal parameters.
  • Added isPropertiesEqual and isParametersEqual testing helper functions.
  • Updated testExponentialContact.cpp to accommodate all above changes.

Finally, ExponentialContactForce is added to the bindings to provide access in Python/Matlab.

Testing I've completed

Ran tests locally on MacOS (arm64).

Looking for feedback on...

CHANGELOG.md (choose one)

  • no need to update because...internal fixes.

This change is Reviewable

@nickbianco nickbianco changed the title Add ExponentialContactForce to the bindings Add ExponentialContactForce::Parameters subclass and add bindings support for ExponentialContactForce Dec 18, 2025
@nickbianco nickbianco changed the title Add ExponentialContactForce::Parameters subclass and add bindings support for ExponentialContactForce Remove ExponentialContactForce::Parameters subclass and add bindings support for ExponentialContactForce Dec 18, 2025
@nickbianco nickbianco force-pushed the exp_contact_force_bindings branch from 9051694 to 4fc173e Compare December 18, 2025 18:19
@nickbianco
Copy link
Member Author

nickbianco commented Dec 18, 2025

@fcanderson I recently ran into issues trying to add ExponentialContactForce to the bindings for Matlab/Python support. This PR represents my attempt to fix those issues. There are some significant design changes (e.g., removing ExponentialContactForce::Parameters), but I think this will be a more friendly interface to scripting users, in addition to being easier to maintain.

Let me know if your have the time and interest for a review.

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