Skip to content

[WIP] Use topology-based moment arm detection in PolynomialPathFitter#4352

Draft
nickbianco wants to merge 2 commits into
opensim-org:mainfrom
nickbianco:path_fitter_refactor_moment_arms
Draft

[WIP] Use topology-based moment arm detection in PolynomialPathFitter#4352
nickbianco wants to merge 2 commits into
opensim-org:mainfrom
nickbianco:path_fitter_refactor_moment_arms

Conversation

@nickbianco

@nickbianco nickbianco commented Jul 14, 2026

Copy link
Copy Markdown
Member

Fixes issue #4348

Brief summary of changes

Leverages changes added via #4301 to find the set of coordinates in each path for which to compute moment arms. Previously, moment arms for every coordinate in the model were computed for each path which was inefficient and sometimes produced erroneous moment arms due to MomentArmSolver's force-based calculation approach. Now, we automatically detect which coordinates should belong to a path based on the model topology by finding the joints that lie between the path's origin and insertion. Moment arms are computed only for coordinates detected using this approach.

The property moment_arm_threshold has been removed, and the methods get/setMomentArmThreshold() have been deprecated. In addition, the approach for leverage thread parallelization has been modified: now each thread performs the calculations for a single path at a time, iterating over all paths until completed. This is achieved using std::atomic to store a (thread-safe) index of the current path, and the worker function in each thread operates on a while-loop until the set of paths is exhausted.

Testing I've completed

Existing CI tests, e.g., testPolynomialPathFitter.cpp. Also tested scripting example examplePolynomialPathFitter.py locally.

Looking for feedback on...

CHANGELOG.md (choose one)

  • updated.

This change is Reviewable

…ctGeometryPath::findIndependentCoordinatePaths()
@nickbianco nickbianco changed the title Path fitter refactor moment arms [WIP] Use topology-based moment arm detection in PolynomialPathFitter Jul 14, 2026
@nickbianco
nickbianco force-pushed the path_fitter_refactor_moment_arms branch 3 times, most recently from bcd5aba to b09bd53 Compare July 14, 2026 17:21
@nickbianco
nickbianco force-pushed the path_fitter_refactor_moment_arms branch from b09bd53 to 2fb32ee Compare July 14, 2026 17:28
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.

1 participant