Skip to content

Broadcast pose transforms over spatial vector sequences - #310

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-spatial-vector-transform-sequences-nov17
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-spatial-vector-transform-sequences-nov17

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

Transforming a sequence of spatial velocities, accelerations, forces or momenta fails with matrix-dimension errors. For example, SE3(1, 2, 3) * SpatialVelocity(np.arange(12).reshape(6, 2)) fails instead of transforming both vectors. Pose sequences also fail, and a six-vector sequence can accidentally be interpreted as one matrix rather than six spatial vectors.

Fix

Use the existing binary-operation helper to broadcast singleton operands or pair equal-length sequences, applying the existing adjoint/coadjoint transform to each pair. Build the result with the same spatial-vector subclass and delegate SpatialForce to the shared implementation.

Validation

  • 89 cases cover all four spatial-vector subclasses, SE3 and Twist3 operands, singleton/sequence/equal-sequence combinations, lengths 2 and 6, empty operands and mismatched lengths.
  • Compare against independent adjoint multiplication or an inverse-transpose linear solve, and check sequence power invariance.
  • Before: 69 failed, 20 passed. After: all 89 pass.
  • Full local suite on Python 3.12: 655 passed, 3 skipped, 99 subtests passed; 21 existing warnings. Pristine master25b19b3: 566 passed with the same skips/subtests/warnings.
  • Black23.10.0, fatal-error flake8 and changed-file whitespace checks pass.

Singleton transform formulas are unchanged. In particular, this preserves the current finite-displacement interpretation of Twist3 multiplication; it does not decide #257's design question. This is separate from #299's copy-constructor and #301's row/column-input fixes. AI assistance was used for investigation, implementation and tests. Validated locally without robot hardware.

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