8000 translation constructors pass twist vector rather than SE(3) matrix, … · VB6Hobbyst7/spatialmath-python@03c6fc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03c6fc7

Browse files
committed
translation constructors pass twist vector rather than SE(3) matrix, quicker
1 parent 0ab20ec commit 03c6fc7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spatialmath/twist.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ def Rz(cls, theta, unit='rad', t=None):
631631
:SymPy: supported
632632
"""
633633
return cls([np.r_[0,0,0,0,0,x] for x in base.getunit(theta, unit=unit)])
634+
634635
@classmethod
635636
def Tx(cls, x):
636637
"""
@@ -654,7 +655,7 @@ def Tx(cls, x):
654655
:seealso: :func:`~spatialmath.base.transforms3d.transl`
655656
:SymPy: supported
656657
"""
657-
return cls([base.transl(_x, 0, 0) for _x in base.getvector(x)], check=False)
658+
return cls([np.r_[_x,0,0,0,0,0] for _x in base.getvector(x)], check=False)
658659

659660

660661
@classmethod
@@ -680,7 +681,7 @@ def Ty(cls, y):
680681
:seealso: :func:`~spatialmath.base.transforms3d.transl`
681682
:SymPy: supported
682683
"""
683-
return cls([base.transl(0, _y, 0) for _y in base.getvector(y)], check=False)
684+
return cls([np.r_[0,_y,0,0,0,0] for _y in base.getvector(y)], check=False)
684685

685686
@classmethod
686687
def Tz(cls, z):
@@ -704,7 +705,7 @@ def Tz(cls, z):
704705
:seealso: :func:`~spatialmath.base.transforms3d.transl`
705706
:SymPy: supported
706707
"""
707-
return cls([base.transl(0, 0, _z) for _z in base.getvector(z)], check=False)
708+
return cls([np.r_[0,0,_z,0,0,0] for _z in base.getvector(z)], check=False)
708709

709710
@classmethod
710711
def Rand(cls, *, xrange=(-1, 1), yrange=(-1, 1), zrange=(-1, 1), N=1): # pylint: disable=arguments-differ

0 commit comments

Comments
 (0)
0