Skip to content

Commit bc9339d

Browse files
committed
handle no args case, theta defaults to 1
1 parent c2cd44c commit bc9339d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎spatialmath/twist.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ def pole(self):
13881388
def printline(self, **kwargs):
13891389
return self.SE2().printline(**kwargs)
13901390

1391-
def SE2(self, theta=1):
1391+
def SE2(self, theta=1, unit='rad'):
13921392
"""
13931393
Convert 2D twist to SE(2) matrix
13941394
@@ -1479,7 +1479,10 @@ def exp(self, theta=None, unit='rad'):
14791479
14801480
:seealso: :func:`spatialmath.base.trexp2`
14811481
"""
1482-
theta = base.getunit(theta, unit)
1482+
if theta is None:
1483+
theta = 1.0
1484+
else:
1485+
theta = base.getunit(theta, unit)
14831486

14841487
return base.trexp2(self.S * theta)
14851488

0 commit comments

Comments
 (0)