Skip to content

Commit 6f9e892

Browse files
Fix sphinx automation (#162)
The workflow to generate sphinx documentation seems to not be working. Trying to fix that with this PR. --------- Co-authored-by: Peter Corke <peter.i.corke@gmail.com>
1 parent 197d383 commit 6f9e892

3 files changed

Lines changed: 29 additions & 32 deletions

File tree

‎.github/workflows/sphinx.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
sphinx:
88
runs-on: ubuntu-22.04
9-
if: ${{ github.event_name != 'pull_request' }}
9+
# if: ${{ github.event_name != 'pull_request' }}
1010
steps:
1111
- uses: actions/checkout@v4
1212
- name: Set up Python 3.12

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The class, method and functions names largely mirror those of the MATLAB toolbox
7979

8080
# Citing
8181

82-
Check out our ICRA 2021 paper on [IEEE Xplore](https://ieeexplore.ieee.org/document/9561366) or get the PDF from [Peter's website](https://bit.ly/icra_rtb). This describes the [Robotics Toolbox for Python](https://github.com/petercorke/robotics-toolbox-python) as well Spatial Maths.
82+
Check out our ICRA 2021 paper on [IEEE Xplore](https://ieeexplore.ieee.org/document/9561366) or get the PDF from [Peter's website](https://bit.ly/icra_rtb). This describes the [Robotics Toolbox for Python](https://github.com/petercorke/robotics-toolbox-python) as well as Spatial Maths.
8383

8484
If the toolbox helped you in your research, please cite
8585

‎docs/source/intro.rst‎

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Introduction
44
************
55

66

7-
Spatial maths capability underpins all of robotics and robotic vision.
8-
It provides the means to describe the relative position and orientation of objects in 2D or 3D space.
7+
Spatial maths capability underpins all of robotics and robotic vision.
8+
It provides the means to describe the relative position and orientation of objects in 2D or 3D space.
99
This package provides Python classes and functions to represent, print, plot, manipulate and covert between such representations.
10-
This includes relevant mathematical objects such as rotation matrices :math:`\mat{R} \in \SO{2}, \SO{3}`,
10+
This includes relevant mathematical objects such as rotation matrices :math:`\mat{R} \in \SO{2}, \SO{3}`,
1111
homogeneous transformation matrices :math:`\mat{T} \in \SE{2}, \SE{3}`, unit quaternions :math:`\q \in \mathrm{S}^3`,
1212
and twists :math:`S \in \se{2}, \se{3}`.
1313

@@ -27,7 +27,7 @@ which results in a NumPy :math:`4 \times 4` array that belongs to the group
2727
>>> from spatialmath import *
2828
>>> T = SE3.Rx(30, 'deg')
2929
>>> type(T)
30-
>>> print(T)
30+
>>> print(T)
3131

3232
which is *internally* represented as a :math:`4 \times 4` NumPy array.
3333

@@ -81,7 +81,7 @@ Group Name Class
8181
================================ ============================== ======================
8282

8383

84-
In addition to the merits of classes outlined above, classes ensure that the numerical value is always valid because the
84+
In addition to the merits of classes outlined above, classes ensure that the numerical value is always valid because the
8585
constraints (eg. orthogonality, unit norm) are enforced when the object is constructed. For example::
8686

8787
>>> SE3(np.zeros((4,4)))
@@ -90,7 +90,7 @@ constraints (eg. orthogonality, unit norm) are enforced when the object is const
9090
.
9191
AssertionError: array must have valid value for the class
9292

93-
Type safety and type validity are particularly important when we deal with a sequence of values.
93+
Type safety and type validity are particularly important when we deal with a sequence of values.
9494
In robotics we frequently deal with a multiplicity of objects (poses, cameras), or a trajectory of
9595
objects moving over time.
9696
However a list of these items, for example::
@@ -114,7 +114,7 @@ The Spatial Math package give these classes list *super powers* so that, for exa
114114
>>> from spatialmath import *
115115
>>> X = SE3.Rx([0, 0.2, 0.4, 0.6])
116116
>>> len(X)
117-
>>> print(X[1])
117+
>>> print(X[1])
118118

119119

120120
The classes form a rich hierarchy
@@ -127,7 +127,7 @@ The classes form a rich hierarchy
127127
Ultimately they all inherit from ``collections.UserList`` and have all the functionality of Python lists, and this is discussed further in
128128
section :ref:`list-powers`
129129
The pose objects are a list subclass so we can index it or slice it as we
130-
would a list, but the result always belongs to the class it was sliced from.
130+
would a list, but the result always belongs to the class it was sliced from.
131131

132132

133133
Operators for pose objects
@@ -176,9 +176,9 @@ Vector transformation
176176
^^^^^^^^^^^^^^^^^^^^^
177177

178178

179-
The classes ``SE3``, ``SO3``, ``SE2``, ``SO2`` and ``UnitQuaternion`` support vector transformation when
179+
The classes ``SE3``, ``SO3``, ``SE2``, ``SO2`` and ``UnitQuaternion`` support vector transformation when
180180
premultiplying a vector (or a set of vectors columnwise in a NumPy array) using the ``*`` operator.
181-
This is either rotation about the origin (for ``SO3``, ``SO2`` and ``UnitQuaternion``) or rotation and translation (``SE3``, ``SE2``).
181+
This is either rotation about the origin (for ``SO3``, ``SO2`` and ``UnitQuaternion``) or rotation and translation (``SE3``, ``SE2``).
182182
The implementation depends on the class of the object involved:
183183

184184
- for ``UnitQuaternion`` this is performed directly using Hamilton products
@@ -238,7 +238,7 @@ Compare this to the unit quaternion case:
238238
>>> 2 * q
239239

240240
Noting that unit quaternions are denoted by double angle bracket delimiters of their vector part,
241-
whereas a general quaternion uses single angle brackets. The product of a general quaternion and a
241+
whereas a general quaternion uses single angle brackets. The product of a general quaternion and a
242242
unit quaternion is always a general quaternion.
243243

244244

@@ -387,7 +387,7 @@ a Python list
387387
>>> len(R)
388388
>>> R = SO3.Rx(np.arange(0, 2*np.pi, 0.2))
389389
>>> len(R)
390-
>>> R[0]
390+
>>> R[0]
391391
>>> R[-1]
392392
>>> R[2:4]
393393

@@ -405,12 +405,12 @@ In particular it supports iteration which allows looping and comprehensions:
405405
>>> eul = [x.eul() for x in R]
406406
>>> len(eul)
407407
>>> eul[10]
408-
408+
409409
Useful functions that be used on such objects include
410410

411-
============= ================================================
411+
============= ================================================
412412
Method Operation
413-
============= ================================================
413+
============= ================================================
414414
``clear`` Clear all elements, object now has zero length
415415
``append`` Append a single element
416416
``del``
@@ -422,7 +422,7 @@ Method Operation
422422
``pop`` Remove first element and return it
423423
``slice`` Index from a slice object
424424
``zip`` Iterate over the elments
425-
============= ================================================
425+
============= ================================================
426426

427427

428428
Vectorization
@@ -445,7 +445,7 @@ the lengths of the operands and the results are given by
445445
====== ====== ====== ========================
446446
operands results
447447
--------------- --------------------------------
448-
len(X) len(Y) len(Z) results
448+
len(X) len(Y) len(Z) results
449449
====== ====== ====== ========================
450450
1 1 1 Z = X op Y
451451
1 M M Z[i] = X op Y[i]
@@ -524,20 +524,20 @@ Spatial object equivalent class NumPy ndarray.shape
524524
n/a Quaternion (4,)
525525
================= ================ ===================
526526

527-
.. note:: ``SpatialVector`` and ``Line3`` objects have no equivalent in the
527+
.. note:: ``SpatialVector`` and ``Line3`` objects have no equivalent in the
528528
``base`` package.
529529

530530
Inputs to functions in this package are either floats, lists, tuples or
531-
numpy.ndarray objects describing vectors or arrays.
531+
numpy.ndarray objects describing vectors or arrays.
532532

533533
NumPy arrays have a shape described by a shape tuple which is a list of the
534534
dimensions. Typically all ``ndarray`` **vectors** have the shape ``(N,)``, that is,
535535
they have only one dimension. The ``@`` product of an ``(M,N)`` array and a ``(N,)``
536-
vector is an ``(M,)`` vector.
536+
vector is an ``(M,)`` vector.
537537

538538
A numpy column vector has shape ``(N,1)`` and a row vector
539-
has shape ``(1,N)`` but functions also accept row ``(1,N)`` and column ``(N,1)``
540-
where a vector argument is required.
539+
has shape ``(1,N)`` but functions also accept row ``(1,N)`` and column ``(N,1)``
540+
where a vector argument is required.
541541

542542
.. warning::
543543

@@ -546,14 +546,14 @@ where a vector argument is required.
546546
- the use of 1D arrays -- all MATLAB arrays have two dimensions,
547547
even if one of them is equal to one.
548548
- Iterating over a 1D NumPy array (N,) returns consecutive elements
549-
- Iterating over a 2D NumPy array is done by row, not columns as in MATLAB.
549+
- Iterating over a 2D NumPy array is done by row, not columns as in MATLAB.
550550
- Iterating over a row vector ``(1,N)`` returns the entire row
551551
- Iterating a column vector ``(N,1)`` returns consecutive elements (rows).
552552

553553
.. note::
554554
- Functions that require vector can be passed a list, tuple or numpy.ndarray
555555
for a vector -- described in the documentation as being of type
556-
*array_like*.
556+
*array_like*.
557557
- This toolbox documentation refers to NumPy arrays succinctly as:
558558

559559
- ``ndarray(N)`` for a 1D array of length ``N``
@@ -636,7 +636,7 @@ If ``matplotlib`` is installed then we can add 2D coordinate frames to a figure
636636
>>> trplot2( transl2(4, 3)@trot2(math.pi/3), color='green', frame='c')
637637
>>> plt.grid(True)
638638
639-
.. figure:: ../figs/transforms2d.png
639+
.. figure:: ../figs/transforms2d.png
640640
:align: center
641641

642642
Output of ``trplot2``
@@ -692,7 +692,7 @@ matrix
692692
>>> a
693693
>>> type(a)
694694
>>> a = T[1,1]
695-
>>> a
695+
>>> a
696696
>>> type(a)
697697

698698
We see that the symbolic constants have been converted back to Python numeric
@@ -733,7 +733,7 @@ comprises:
733733
>>> from spatialmath.base import rotx, trotx
734734

735735
and works with NumPy arrays. This package also includes a set of functions,
736-
not present in the MATLAB version, to handle quaternions, unit-quaternions
736+
not present in the MATLAB version, to handle quaternions, unit-quaternions
737737
which are represented as 4-element NumPy arrays, and twists.
738738
* the classes (which appeared in Robotics Toolbox for MATLAB release 10 in 2017) such as ``SE3``, ``UnitQuaternion`` etc. The only significant difference
739739
is that the MATLAB ``Twist`` class is now called ``Twist3``.
@@ -769,6 +769,3 @@ which has the familiar *classic* functions like ``rotx`` and ``rpy2r`` available
769769
R2 = rpy2r(0.1, 0.2, 0.3)
770770
771771
T = SE3(1, 2, 3)
772-
773-
774-

0 commit comments

Comments
 (0)