8000 fix code examples · rocsys/spatialmath-python@d22417b · GitHub
[go: up one dir, main page]

Skip to content

Commit d22417b

Browse files
committed
fix code examples
1 parent 9028e46 commit d22417b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spatialmath/pose3d.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ def Rx(cls, theta: float, unit: str = "rad") -> Self:
354354
.. runblock:: pycon
355355
356356
>>> from spatialmath import SO3
357+
>>> import numpy as np
357358
>>> x = SO3.Rx(np.linspace(0, math.pi, 20))
358359
>>> len(x)
359360
>>> x[7]
@@ -383,7 +384,8 @@ def Ry(cls, theta, unit: str = "rad") -> Self:
383384
384385
.. runblock:: pycon
385386
386-
>>> from spatialmath import UnitQuaternion
387+
>>> from spatialmath import SO3
388+
>>> import numpy as np
387389
>>> x = SO3.Ry(np.linspace(0, math.pi, 20))
388390
>>> len(x)
389391
>>> x[7]
@@ -413,8 +415,9 @@ def Rz(cls, theta, unit: str = "rad") -> Self:
413415
414416
.. runblock:: pycon
415417
416-
>>> from spatialmath import SE3
417-
>>> x = SE3.Rz(np.linspace(0, math.pi, 20))
418+
>>> from spatialmath import SO3
419+
>>> import numpy as np
420+
>>> x = SO3.Rz(np.linspace(0, math.pi, 20))
418421
>>> len(x)
419422
>>> x[7]
420423
@@ -484,7 +487,7 @@ def Eul(cls, *angles, unit: str = "rad") -> Self:
484487
>>> from spatialmath import SO3
485488
>>> SO3.Eul(0.1, 0.2, 0.3)
486489
>>> SO3.Eul([0.1, 0.2, 0.3])
487-
>>> SO3.Eul(10, 20, 30, 'deg')
490+
>>> SO3.Eul(10, 20, 30, unit="deg")
488491
489492
:seealso: :func:`~spatialmath.pose3d.SE3.eul`, :func:`~spatialmath.pose3d.SE3.Eul`, :func:`~spatialmath.base.transforms3d.eul2r`
490493
"""
@@ -555,7 +558,7 @@ def RPY(cls, *angles, unit="rad", order="zyx"):
555558
>>> SO3.RPY(0.1, 0.2, 0.3)
556559
>>> SO3.RPY([0.1, 0.2, 0.3])
557560
>>> SO3.RPY(0.1, 0.2, 0.3, order='xyz')
558-
>>> SO3.RPY(10, 20, 30, 'deg')
561+
>>> SO3.RPY(10, 20, 30, unit="deg")
559562
560563
561564
:seealso: :func:`~spatialmath.pose3d.SE3.rpy`, :func:`~spatialmath.pose3d.SE3.RPY`, :func:`spatialmath.base.transforms3d.rpy2r`
@@ -1392,7 +1395,7 @@ def Eul(cls, *angles, unit="rad") -> SE3:
13921395
>>> from spatialmath import SE3
13931396
>>> SE3.Eul(0.1, 0.2, 0.3)
13941397
>>> SE3.Eul([0.1, 0.2, 0.3])
1395-
>>> SE3.Eul(10, 20, 30, unit='deg')
1398+
>>> SE3.Eul(10, 20, 30, unit="deg")
13961399
13971400
:seealso: :func:`~spatialmath.pose3d.SE3.eul`, :func:`~spatialmath.base.transforms3d.eul2r`
13981401
:SymPy: supported

0 commit comments

Comments
 (0)
0