@@ -743,7 +743,7 @@ def angdist(self, other, metric=6):
743743
744744 .. runblock:: pycon
745745
746- >>> from spatialmath import UnitQuaternion
746+ >>> from spatialmath import SO3
747747 >>> R1 = SO3.Rx(0.3)
748748 >>> R2 = SO3.Ry(0.3)
749749 >>> print(R1.angdist(R1))
@@ -875,18 +875,15 @@ def t(self):
875875 ``x.t`` is the translational component of ``x`` as an array with
876876 shape (3,). If ``len(x) > 1``, return an array with shape=(N,3).
877877
878- .. runblock:: pycon
878+ Example:
879879
880- >>> from spatialmath import UnitQuaternion
880+ .. runblock:: pycon
881881
882+ >>> from spatialmath import SE3
882883 >>> x = SE3(1,2,3)
883884 >>> x.t
884- array([1., 2., 3.])
885885 >>> x = SE3([ SE3(1,2,3), SE3(4,5,6)])
886886 >>> x.t
887- array([[1., 2., 3.],
888- [4., 5., 6.]])
889-
890887
891888 :SymPy: supported
892889 """
@@ -918,14 +915,14 @@ def inv(self):
918915 T = \left[ \begin{array}{cc} \mat{R} & \vec{t} \\ 0 & 1 \end{array} \right],
919916 \mat{T}^{-1} = \left[ \begin{array}{cc} \mat{R}^T & -\mat{R}^T \vec{t} \\ 0 & 1 \end{array} \right]`
920917
921- Example::
918+ Example:
919+
920+ .. runblock:: pycon
922921
922+ >>> from spatialmath import SE3
923923 >>> x = SE3(1,2,3)
924924 >>> x.inv()
925- SE3(array([[ 1., 0., 0., -1.],
926- [ 0., 1., 0., -2.],
927- [ 0., 0., 1., -3.],
928- [ 0., 0., 0., 1.]]))
925+
929926
930927 :seealso: :func:`~spatialmath.base.transforms3d.trinv`
931928
@@ -949,13 +946,15 @@ def delta(self, X2=None):
949946 The vector :math:`d = [\delta_x, \delta_y, \delta_z, \theta_x, \theta_y, \theta_z]`
950947 represents infinitesimal translation and rotation.
951948
952- Example::
949+ Example:
950+
951+ .. runblock:: pycon
953952
953+ >>> from spatialmath import SE3
954954 >>> x1 = SE3.Rx(0.3)
955955 >>> x2 = SE3.Rx(0.3001)
956956 >>> x1.delta(x2)
957- array([0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 9.99999998e-05,
958- 0.00000000e+00, 0.00000000e+00])
957+
959958
960959 .. note::
961960
@@ -1032,11 +1031,13 @@ def twist(self):
10321031 :return: equivalent rigid-body motion as a twist vector
10331032 :rtype: Twist3 instance
10341033
1035- Example::
1034+ Example:
10361035
1036+ .. runblock:: pycon
1037+
1038+ >>> from spatialmath import SE3
10371039 >>> x = SE3(1,2,3)
10381040 >>> x.twist()
1039- Twist3([1, 2, 3, 0, 0, 0])
10401041
10411042 :seealso: :func:`spatialmath.twist.Twist3`
10421043 """
@@ -1089,6 +1090,7 @@ def Rx(cls, theta, unit='rad', t=None):
10891090
10901091 .. runblock:: pycon
10911092
1093+ >>> from spatialmath import SE3
10921094 >>> SE3.Rx(0.3)
10931095 >>> SE3.Rx([0.3, 0.4])
10941096
@@ -1124,6 +1126,7 @@ def Ry(cls, theta, unit='rad', t=None):
11241126
11251127 .. runblock:: pycon
11261128
1129+ >>> from spatialmath import SE3
11271130 >>> SE3.Ry(0.3)
11281131 >>> SE3.Ry([0.3, 0.4])
11291132
@@ -1159,6 +1162,7 @@ def Rz(cls, theta, unit='rad', t=None):
11591162
11601163 .. runblock:: pycon
11611164
1165+ >>> from spatialmath import SE3
11621166 >>> SE3.Rz(0.3)
11631167 >>> SE3.Rz([0.3, 0.4])
11641168
@@ -1189,18 +1193,13 @@ def Rand(cls, N=1, xrange=(-1, 1), yrange=(-1, 1), zrange=(-1, 1)): # pylint: d
11891193 - ``SE3.Rand(N)`` is an SE3 object containing a sequence of N random
11901194 poses.
11911195
1192- Example::
11931196
1197+ Example:
1198+
1199+ .. runblock:: pycon
1200+
1201+ >>> from spatialmath import SE3
11941202 >>> SE3.Rand(2)
1195- SE3([
1196- array([[ 0.58076657, 0.64578702, -0.49565041, -0.78585825],
1197- [-0.57373134, -0.10724881, -0.8119914 , 0.72069253],
1198- [-0.57753142, 0.75594763, 0.30822173, 0.12291999],
1199- [ 0. , 0. , 0. , 1. ]]),
1200- array([[ 0.96481299, -0.26267256, -0.01179066, 0.80294729],
1201- [ 0.06421463, 0.19190584, 0.97931028, -0.15021311],
1202- [-0.25497525, -0.94560841, 0.20202067, 0.02684599],
1203- [ 0. , 0. , 0. , 1. ]]) ])
12041203
12051204 :seealso: :func:`~spatialmath.quaternions.UnitQuaternion.Rand`
12061205 """
@@ -1333,13 +1332,12 @@ def OA(cls, o, a):
13331332 - ``o`` and ``a`` do not have to be orthogonal, so long as they are not parallel
13341333 ``o`` is adjusted to be orthogonal to ``a``.
13351334
1336- Example::
1335+ Example:
1336+
1337+ .. runblock:: pycon
13371338
1339+ >>> from spatialmath import SE3
13381340 >>> SE3.OA([1, 0, 0], [0, 0, -1])
1339- SE3(array([[-0., 1., 0., 0.],
1340- [ 1., 0., 0., 0.],
1341- [ 0., 0., -1., 0.],
1342- [ 0., 0., 0., 1.]]))
13431341
13441342 :seealso: :func:`~spatialmath.base.transforms3d.oa2r`
13451343 """
@@ -1519,6 +1517,7 @@ def Tx(cls, x):
15191517
15201518 .. runblock:: pycon
15211519
1520+ >>> from spatialmath import SE3
15221521 >>> SE3.Tx(2)
15231522 >>> SE3.Tx([2,3])
15241523
@@ -1545,6 +1544,7 @@ def Ty(cls, y):
15451544
15461545 .. runblock:: pycon
15471546
1547+ >>> from spatialmath import SE3
15481548 >>> SE3.Ty(2)
15491549 >>> SE3.Ty([2,3])
15501550
@@ -1570,6 +1570,7 @@ def Tz(cls, z):
15701570
15711571 .. runblock:: pycon
15721572
1573+ >>> from spatialmath import SE3
15731574 >>> SE3.Tz(2)
15741575 >>> SE3.Tz([2,3])
15751576
@@ -1638,7 +1639,7 @@ def angdist(self, other, metric=6):
16381639
16391640 .. runblock:: pycon
16401641
1641- >>> from spatialmath import UnitQuaternion
1642+ >>> from spatialmath import SE3
16421643 >>> T1 = SE3.Rx(0.3)
16431644 >>> T2 = SE3.Ry(0.3)
16441645 >>> print(T1.angdist(T1))
0 commit comments