Skip to content

Flatten row and column inputs to spatial vector constructors - #301

Open
kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-spatialvector-shaped-input-nov13
Open

kaushikgunasekaren wants to merge 2 commits into
rai-opensource:masterfrom
kaushikgunasekaren:fix-spatialvector-shaped-input-nov13

Conversation

@kaushikgunasekaren

Copy link
Copy Markdown

Bug

A 6x1 or 1x6 array is accepted as a vector but stored without flattening. Its .A has the wrong rank, isvalid() rejects it, and printing fails. Three-element row/column arrays also fail when zeros are appended.

Fix

Use the existing getvector converter for both input lengths, keeping each internal vector flat. This is separate from #299's copying of existing SpatialVector sequences and does not change the Twist conversion questions in #257.

Validation

  • 24 cases across velocity, acceleration, force and momentum; 3/6 elements; flat, row and column arrays. Check shape, validity, indexing, printing, negation and unchanged inputs.
  • Before: 16 failed, 8 controls passed. After: all 24 pass.
  • Full local suite: 590 passed, 3 skipped, 99 subtests passed; 29 existing warnings. Fresh baseline: 566 passed with the same skips/subtests/warnings.
  • Black 23.10.0, fatal-error flake8 and git diff --check pass.

AI assistance was used for investigation, implementation and tests. Validated locally without robot hardware.

Add unit tests for SpatialVelocity, SpatialAcceleration, SpatialForce, and SpatialMomentum constructors with different shapes.

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