bdaiinstitute / spatialmath-python

Create, manipulate and convert representations of position and orientation in 2D or 3D using Python
MIT License
497 stars 82 forks source link

Fixed fall through error in binary operation #117

Closed bokorn-bdaii closed 8 months ago

bokorn-bdaii commented 8 months ago

Fixes fall through error in the binary operator for BasePoseMatrix described in #116:

https://github.com/bdaiinstitute/spatialmath-python/blob/1b89c49395a21b5241e2f0a233e69394f3bc27b1/spatialmath/baseposematrix.py#L1632C7-L1632C7

If you want to compare the rotation of an SE3 to an SO3, it returns None as opposed to throwing an error or returning a valid value.

import numpy as np
from spatialmath import SE3, SO3

T0 = SE3()
print(T0.angdist(SO3()))

Modified BasePoseMatrix._op2 to throw an error if the types don't match.

All tests still pass.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (1b89c49) 77.41% compared to head (c234e6c) 77.76%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #117 +/- ## ========================================== + Coverage 77.41% 77.76% +0.35% ========================================== Files 24 24 Lines 5136 5137 +1 ========================================== + Hits 3976 3995 +19 + Misses 1160 1142 -18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.