Skip to content

Commit a4798bc

Browse files
committed
change methods se2 and se3 to skewa
1 parent 41f192c commit a4798bc

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

spatialmath/twist.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -825,23 +825,24 @@ def Ad(self):
825825

826826

827827

828-
def se3(self):
828+
def skewa(self):
829829
"""
830830
Convert 3D twist to se(3)
831831
832832
:return: An se(3) matrix
833833
:rtype: ndarray(4,4)
834834
835-
``X.se3()`` is the twist as an se(3) matrix, which is an augmented
836-
skew-symmetric 4x4 matrix.
835+
``X.skewa()`` is the twist as a 4x4 augmented skew-symmetric matrix
836+
belonging to the group se(3). This is the Lie algebra of the
837+
corresponding SE(3) element.
837838
838839
Example:
839840
840841
.. runblock:: pycon
841842
842843
>>> from spatialmath import Twist3, base
843844
>>> S = Twist3.Rx(0.3)
844-
>>> se = S.se3()
845+
>>> se = S.skewa()
845846
>>> se
846847
>>> base.trexp(se)
847848
"""
@@ -1436,23 +1437,24 @@ def SE2(self, theta=1, unit='rad'):
14361437
else:
14371438
return SE2([base.trexp2(self.S * t) for t in theta])
14381439

1439-
def se2(self):
1440+
def skewa(self):
14401441
"""
14411442
Convert 2D twist to se(2)
14421443
14431444
:return: An se(2) matrix
14441445
:rtype: ndarray(3,3)
14451446
1446-
``X.se2()`` is the twist as an se(2) matrix, which is an augmented
1447-
skew-symmetric 3x3 matrix.
1447+
``X.skewa()`` is the twist as a 3x3 augmented skew-symmetric matrix
1448+
belonging to the group se(2). This is the Lie algebra of the
1449+
corresponding SE(2) element.
14481450
14491451
Example:
14501452
14511453
.. runblock:: pycon
14521454
14531455
>>> from spatialmath import Twist2, base
14541456
>>> S = Twist2([1,2,3])
1455-
>>> se = S.se2()
1457+
>>> se = S.skewa()
14561458
>>> se
14571459
>>> base.trexp2(se)
14581460
"""

tests/test_twist.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_conversion_se3(self):
7373
s = [1, 2, 3, 4, 5, 6]
7474
x = Twist3(s)
7575

76-
array_compare(x.se3(), np.array([[ 0., -6., 5., 1.],
76+
array_compare(x.skewa(), np.array([[ 0., -6., 5., 1.],
7777
[ 6., 0., -4., 2.],
7878
[-5., 4., 0., 3.],
7979
[ 0., 0., 0., 0.]]))
@@ -88,7 +88,7 @@ def test_list_constuctor(self):
8888
self.assertIsInstance(a, Twist3)
8989
self.assertEqual(len(a), 4)
9090

91-
a = Twist3([x.se3(), x.se3(), x.se3(), x.se3()])
91+
a = Twist3([x.skewa(), x.skewa(), x.skewa(), x.skewa()])
9292
self.assertIsInstance(a, Twist3)
9393
self.assertEqual(len(a), 4)
9494

@@ -109,7 +109,7 @@ def test_predicate(self):
109109
x = Twist3.UnitPrismatic([1, 2, 3])
110110
self.assertTrue(x.isprismatic)
111111

112-
self.assertTrue(Twist3.isvalid(x.se3()))
112+
self.assertTrue(Twist3.isvalid(x.skewa()))
113113
self.assertTrue(Twist3.isvalid(x.S))
114114

115115
self.assertFalse(Twist3.isvalid(2))
@@ -257,7 +257,7 @@ def test_conversion_se2(self):
257257
s = [1, 2, 3]
258258
x = Twist2(s)
259259

260-
array_compare(x.se2(), np.array([[ 0., -3., 1.],
260+
array_compare(x.skewa(), np.array([[ 0., -3., 1.],
261261
[ 3., 0., 2.],
262262
[ 0., 0., 0.]]))
263263

@@ -268,7 +268,7 @@ def test_list_constuctor(self):
268268
self.assertIsInstance(a, Twist2)
269269
self.assertEqual(len(a), 4)
270270

271-
a = Twist2([x.se2(), x.se2(), x.se2(), x.se2()])
271+
a = Twist2([x.skewa(), x.skewa(), x.skewa(), x.skewa()])
272272
self.assertIsInstance(a, Twist2)
273273
self.assertEqual(len(a), 4)
274274

@@ -289,7 +289,7 @@ def test_predicate(self):
289289
x = Twist2.UnitPrismatic([1, 2])
290290
self.assertTrue(x.isprismatic)
291291

292-
self.assertTrue(Twist2.isvalid(x.se2()))
292+
self.assertTrue(Twist2.isvalid(x.skewa()))
293293
self.assertTrue(Twist2.isvalid(x.S))
294294

295295
self.assertFalse(Twist2.isvalid(2))

0 commit comments

Comments
 (0)