Skip to content

[solver-constraint] Rename epsilon by energyWeight#77

Open
EulalieCoevoet wants to merge 2 commits intoSofaDefrost:mainfrom
EulalieCoevoet:pr_renamingepsilon
Open

[solver-constraint] Rename epsilon by energyWeight#77
EulalieCoevoet wants to merge 2 commits intoSofaDefrost:mainfrom
EulalieCoevoet:pr_renamingepsilon

Conversation

@EulalieCoevoet
Copy link
Member

@EulalieCoevoet EulalieCoevoet commented Dec 19, 2025

When solving an inverse problem, we add a term in the optimization cost function that minimizes the actuation energy. This is achieved by regularizing the QP matrix Q through the addition of epsilon*Waa, where epsilon is selected to be sufficiently small to avoid disrupting the quality of the effector positioning.

Problem:
We named this parameter epsilon, which isn't clear to users.

In this PR:

  • Rename epsilon to energyWeight in both the C++ code and user API
  • Use the deprecation mechanism for the user API only
  • Update the scenes

Also:

  • Improve the description of the objective data, set it as read-only, and change its default value to 0
  • Remove the deprecated rebuildSystem() method

Needs: SofaDefrost/SoftRobots#344

@hugtalbot
Copy link
Collaborator

I would advise to use a compatibility layer to avoid breaking scenes/tutorials that would not have been updated

As example is available in https://github.com/sofa-framework/sofa/pull/5518/changes (see the class CollisionModel)

@hugtalbot
Copy link
Collaborator

I would suggest to use an homogeneous way to manage the lifecycle in all codes :

    proximity.setOriginalData(&d_contactDistance);
    addAlias(&d_contactDistance, "proximity");

This would avoid the boiler plate code in the init ;)
Thanks ✌️

@bakpaul will test this PR soon with his new sofa-test-action !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants