Repository navigation
Conversation
fredroy
force-pushed
the
fix_restssff_small_rot
branch
from
November 20, 2026 08:22
49a6ff5 to
abe355e
Compare
…e and stiffness for small rotations The torque must be -angularStiffness * rotation vector also for rotations below ~3e-8 rad, whose quaternion has a real part rounding to 1. This test currently fails: the torque is zero in that range.
… small rotations The angle of the rotation from the rest orientation was computed only when the real part of the quaternion was below 1. For rotations below ~3e-8 rad, it rounds to 1, so the torque was zero in this range while the stiffness is -angularStiffness. With a large angularStiffness (e.g. 1e8 to hold the base of an instrument), the equilibrium angle falls in this range: Newton iterations stalled at a residual equal to the torque applied to the spring. The rotation vector is now computed from the imaginary part of the quaternion, with atan2, accurate for all angles. This also removes the use of an uninitialized axis.
fredroy
force-pushed
the
fix_restssff_small_rot
branch
from
November 22, 2026 23:27
abe355e to
9b51cf2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rotation and quaternion are not my cup of tea so I let 🤖 explaining:
Bonus:
As a side effect, the old code no longer reads an uninitialized axis when it skipped quatToAxisIncluded: test
Bad thing is that it will certainly change some tests using RestShapeSpringsForceField
[with-all-tests]
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if