Skip to content

Commit c366f9f

Browse files
committed
SE3 constructor from SO3 now takes a translation vector
1 parent 53bee86 commit c366f9f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎spatialmath/pose3d.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,14 +1342,17 @@ def Tz(cls, z):
13421342
return cls([base.transl(0, 0, _z) for _z in base.getvector(z)], check=False)
13431343

13441344
@classmethod
1345-
def SO3(cls, R, check=True):
1345+
def SO3(cls, R, t=None, check=True):
13461346
if isinstance(R, SO3):
13471347
R = R.A
13481348
elif base.isrot(R, check=check):
13491349
pass
13501350
else:
13511351
raise ValueError('expecting SO3 or rotation matrix')
1352-
return cls(base.r2t(R))
1352+
if t is None:
1353+
return cls(base.r2t(R))
1354+
else:
1355+
return cls(base.rt2tr(R, t))
13531356

13541357
if __name__ == '__main__': # pragma: no cover
13551358

0 commit comments

Comments
 (0)