Skip to content

Keep twist poles invariant under angular speed scaling - #249

Open
antonsoo wants to merge 1 commit into
rai-opensource:masterfrom
antonsoo:fix/twist-pole-angular-scale
Open

antonsoo wants to merge 1 commit into
rai-opensource:masterfrom
antonsoo:fix/twist-pole-angular-scale

Conversation

@antonsoo

Copy link
Copy Markdown

Twist2.pole and Twist3.pole divide the cross product by the angular magnitude. The closest point on the screw axis requires its square: the cross product already contains one factor of angular speed. Consequently, scaling a twist currently moves its reported axis.

from spatialmath import Twist2, Twist3

print(Twist2([1, -2, 0.5]).pole)        # expected [4, 2]; currently [2, 1]
print(Twist3([1, -2, 0, 0, 0, 0.5]).pole)  # expected [4, 2, 0]

Use w**2 in 2D and dot(w, w) in 3D. The zero-angular case keeps its existing undefined behavior.

The regression checks cover signed speeds, off-origin axes and nonzero screw pitch. They verify that finite motion leaves an axis point fixed except for translation along the axis. Twelve of the 15 cases fail before the fix. On a camera-reconstruction fixture, 680 incorrect axis estimates become zero across 768 scaled 2D/3D increments; independent least-squares axis references agree within 1.5e-14. Ordinary transform outputs remain identical. Full suite: 362 passed, 3 existing skips; project pre-commit hooks pass. Linux/Python 3.12.

This branch has not been deployed

No deployments
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