@@ -861,6 +861,7 @@ def se3(self):
861
861
else :
862
862
return [base .skewa (x .S ) for x in self ]
863
863
864
+ @property
864
865
def pitch (self ):
865
866
"""
866
867
Pitch of a 3D twist
@@ -882,7 +883,7 @@ def pitch(self):
882
883
>>> from spatialmath import SE3, Twist3
883
884
>>> T = SE3(1, 2, 3) * SE3.Rx(0.3)
884
885
>>> S = Twist3(T)
885
- >>> S.pitch()
886
+ >>> S.pitch
886
887
887
888
"""
888
889
return np .dot (self .w , self .v )
@@ -905,8 +906,9 @@ def line(self):
905
906
>>> S = Twist3(T)
906
907
>>> S.line()
907
908
"""
908
- return Line3 ([Line3 (- tw .v - tw .pitch () * tw .w , tw .w ) for tw in self ])
909
+ return Line3 ([Line3 (- tw .v - tw .pitch * tw .w , tw .w ) for tw in self ])
909
910
911
+ @property
910
912
def pole (self ):
911
913
"""
912
914
Pole of a 3D twist
@@ -924,9 +926,9 @@ def pole(self):
924
926
>>> from spatialmath import SE3, Twist3
925
927
>>> T = SE3(1, 2, 3) * SE3.Rx(0.3)
926
928
>>> S = Twist3(T)
927
- >>> S.pole()
929
+ >>> S.pole
928
930
"""
929
- return np .cross (self .w , self .v ) / self .theta ()
931
+ return np .cross (self .w , self .v ) / self .theta
930
932
931
933
def theta (self ):
932
934
"""
@@ -1374,9 +1376,35 @@ def w(self):
1374
1376
"""
1375
1377
return self .data [0 ][2 ]
1376
1378
1379
+ @property
1380
+ def pole (self ):
1381
+ """
1382
+ Pole of a 2D twist
1383
+
1384
+ :return: the pole of the twist
1385
+ :rtype: ndarray(2)
1386
+
1387
+ ``X.pole()`` is a point on the twist axis. For a pure translation
1388
+ this point is at infinity.
1389
+
1390
+ Example:
1391
+
1392
+ .. runblock:: pycon
1393
+
1394
+ >>> from spatialmath import SE3, Twist3
1395
+ >>> T = SE2(1, 2, 0.3)
1396
+ >>> S = Twist2(T)
1397
+ >>> S.pole()
1398
+ """
1399
+ p = np .cross (np .r_ [0 , 0 , self .w ], np .r_ [self .v , 0 ]) / self .theta
1400
+ return p [:2 ]
1401
+
1377
1402
# ------------------------- methods -------------------------------#
1378
1403
1379
- def SE2 (self ):
1404
+ def printline (self ):
1405
+ return self .SE2 ().printline ()
1406
+
1407
+ def SE2 (self , theta = 1 ):
1380
1408
"""
1381
1409
Convert 2D twist to SE(2) matrix
1382
1410
@@ -1471,29 +1499,7 @@ def exp(self, theta=None, unit='rad'):
1471
1499
else :
1472
1500
return SE2 ([base .trexp2 (self .S * t ) for t in theta ])
1473
1501
1474
- def pole (self ):
1475
- """
1476
- Pole of a 2D twist
1477
-
1478
- :return: the pole of the twist
1479
- :rtype: ndarray(2)
1480
-
1481
- ``X.pole()`` is a point on the twist axis. For a pure translation
1482
- this point is at infinity.
1483
1502
1484
- Example:
1485
-
1486
- .. runblock:: pycon
1487
-
1488
- >>> from spatialmath import SE3, Twist3
1489
- >>> T = SE2(1, 2, 0.3)
1490
- >>> S = Twist2(T)
1491
- >>> S.pole()
1492
- """
1493
- p = np .cross (np .r_ [0 , 0 , self .w ], np .r_ [self .v , 0 ]) / self .theta ()
1494
- return p [:2 ]
1495
-
1496
- @property
1497
1503
def unit (self ):
1498
1504
"""
1499
1505
Unit twist
0 commit comments