8000 make symbolic friendly · flyinger/spatialmath-python@2f513b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f513b0

Browse files
committed
make symbolic friendly
1 parent f64bd80 commit 2f513b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spatialmath/base/transforms3d.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,13 @@ def transl(x, y=None, z=None):
296296
elif base.isvector(x, 3):
297297
t = base.getvector(x, 3, out='array')
298298
elif base.ismatrix(x, (4, 4)):
299+
# SE(3) -> R3
299300
return x[:3, 3]
300301
else:
301302
raise ValueError('bad argument')
303+
304+
if t.dtype != 'O':
305+
t = t.astype('float64')
302306

303307
T = np.identity(4, dtype=t.dtype)
304308
T[:3, 3] = t

0 commit comments

Comments
 (0)
0