Preserve small angles in batch rotation logarithmic map - #378
Merged
AlexanderFabisch merged 1 commit intoSep 29, 2026
Merged
Conversation
Signed-off-by: 李永祺 <doribelove@gmail.com>
Member
|
Thanks for the contribution @Doribelove ! |
This was referenced Sep 29, 2026
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.
axis_angles_from_matricescurrently computes the angle witharccos((trace - 1) / 2). For a rotation of1e-8radians, the trace rounds to 3 and the batch logarithmic map returns a zero angle and the identity axis. This loses the rotation in batch processing.Compute the angle with
atan2using both the trace and the norm of the antisymmetric matrix part, which remains informative near zero. This addresses the batch rotation portion of #377 without changing the scalar rotation or transformation code covered by #374 and #376. The API and precomputedtraces/outoptions remain unchanged.The regression tests cover zero, small positive and negative angles across seeded random axes, precomputed traces, an output buffer, a single matrix, and rotations near pi. The existing near-pi test now checks the rotation matrix and angle directly: exact pi rotations can legitimately use either axis sign, and the scalar
arccospath can round a near-pi angle differently.Validation:
98 passedinbatch_rotations/test/test_batch_rotations.pyandtrajectories/test.git diff --checkpassed.3086 passed, 6 skipped, 7 failed. The same seven failures occur on an unmodified checkout of upstreamdevelop(3084 passed, 6 skipped, 7 failed): one very tight1e-16rotation tolerance assertion and six tests requiring optional mesh dependencies.Code and tests were developed with assistance from OpenAI Codex. The commit is signed off by 李永祺 doribelove@gmail.com.