You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d1a945d
Browse filesBrowse the repository at this point in the historyBrowse files
Accept a stacked (N, r, c) ndarray as a sequence of poses (SE3, SO3, SE2, SO2) (#243)
Closes#236.
`SE3(arr)` with an `(N, 4, 4)` array raised "bad argument to
constructor", and with `check=False` it returned a malformed object
(length 1, but `.A` of shape `(N, 4, 4)`).
Changes:
- `BasePoseList.arghandler`: an `ndarray` with shape `(N, r, c)`, where
`(r, c)` is the shape of one value of the class, is now taken as N
values, the same as `SE3(list(arr))`. Each matrix still goes through the
class's validity check when `check=True`. This covers the matrix classes
`SE3`, `SO3`, `SE2` and `SO2`.
- With `check=False`, single arrays keep their historical behavior; only
a stacked 3D array whose per-matrix size is wrong is rejected, whatever
`check` is.
- The `SE3` error message now lists the accepted forms, and the
constructor docstring documents the new form.
Test: `test_constructor_stacked_array` covers `SE3` and `SO3` from a
stacked array with both `check` values, the empty `(0, 4, 4)` case,
rejection of invalid matrices with `check=True` and of a wrong-sized
stack with either value. It fails on `master` and passes with this
change.
Run locally (Python 3.11): `pytest tests` gives 348 passed, 3 skipped.
black 23.10.0 is clean. Not run: the docs build and other Python
versions.
---------
Co-authored-by: Tim Perkins <tim@rai-inst.com>
0 commit comments