10000 fix SE2 constructor logic · flyinger/spatialmath-python@29dcacf · GitHub
[go: up one dir, main page]

Skip to content

Commit 29dcacf

Browse files
committed
fix SE2 constructor logic
1 parent 0333ffc commit 29dcacf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spatialmath/pose2d.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ def __init__(self, x=None, y=None, theta=None, *, unit='rad', check=True):
294294
elif y is not None and theta is not None:
295295
# SE2(x, y, theta)
296296
self.data = [tr.trot2(theta, t=[x, y], unit=unit)]
297-
elif y is None and theta is None:
297+
elif y is None and theta is None and argcheck.isnumberlist(x):
298+
# SE2(arg)
298299
arg = argcheck.getvector(x)
299300
if len(arg) == 1:
300301
self.data = [tr.trot2(arg[0], unit=unit)]
@@ -306,6 +307,8 @@ def __init__(self, x=None, y=None, theta=None, *, unit='rad', check=True):
306307
self.data = [tr.trot2(arg[2], t=arg[:2], unit=unit)]
307308
else:
308309
super().arghandler(x, check=check)
310+
else:
311+
self.arghandler(x, check=check)
309312
else:
310313
raise ValueError('bad arguments to constructor')
311314

0 commit comments

Comments
 (0)
0