diff --git a/spatialmath/base/transforms3d.py b/spatialmath/base/transforms3d.py index 5c90b636..fdcbff2e 100644 --- a/spatialmath/base/transforms3d.py +++ b/spatialmath/base/transforms3d.py @@ -1743,7 +1743,7 @@ def trinterp(start, end, s, shortest=True): return rt2tr(q2r(qunit(qr)), pr) else: - return ValueError("Argument must be SO(3) or SE(3)") + raise ValueError("Argument must be SO(3) or SE(3)") def delta2tr(d: R6) -> SE3Array: diff --git a/tests/base/test_transforms3d.py b/tests/base/test_transforms3d.py index 88ca96a1..4e955da9 100755 --- a/tests/base/test_transforms3d.py +++ b/tests/base/test_transforms3d.py @@ -659,6 +659,12 @@ def test_trinterp(self): nt.assert_array_almost_equal(trinterp(start=T0, end=T1, s=1), T1) nt.assert_array_almost_equal(trinterp(start=T0, end=T1, s=0.5), np.eye(4)) + with self.assertRaises(ValueError): + trinterp(None, np.zeros((2, 2)), 0.5) + + with self.assertRaises(ValueError): + trinterp(None, np.zeros((5, 5)), 0.5) + def test_tr2delta(self): # unit testing tr2delta with a tr matrix nt.assert_array_almost_equal(