Skip to content

Broadcast scalar integration steps over twist sequences - #248

Open
antonsoo wants to merge 1 commit into
rai-opensource:masterfrom
antonsoo:fix/twist-sequence-scalar-time
Open

antonsoo wants to merge 1 commit into
rai-opensource:masterfrom
antonsoo:fix/twist-sequence-scalar-time

Conversation

@antonsoo

Copy link
Copy Markdown

Twist3.exp documents applying one integration step to every twist in a sequence, but currently raises ValueError: length mismatch. The SE3 conversion also rejects that case. The corresponding Twist2 methods fail too, including matched per-twist steps in SE2.

Handle the shared scalar step in all four methods, and match individual steps in Twist2.SE2. Check degree-mode warnings per twist so that path works for sequences as well. Singleton expansion and mismatched-length rejection are retained.

from spatialmath import Twist3

motion = Twist3([Twist3.Rx(0.2), Twist3.Ry(-0.3)])
print(len(motion.exp(0.5)))  # 2; currently raises ValueError
print(len(motion.SE3()))     # 2; currently raises ValueError

Validation: 20 focused cases compare the results to independent SciPy matrix exponentials (17 fail before). A 717-row camera-reconstruction fixture exercises 96 motion increments in 2D and 3D: all 21 formerly aborting sequence workflows complete, and transformed points agree with the independent reference within 4e-14. Ordinary single-twist output hashes are unchanged. Full suite: 367 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