8000 more work on doco · RPellowski/spatialmath-python@a946c9b · GitHub
[go: up one dir, main page]

Skip to content

Commit a946c9b

Browse files
committed
more work on doco
1 parent ff6061d commit a946c9b

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

docs/source/intro.rst

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

66

7-
Spatial maths capability underpins all of robotics and robotic vision. The aim of the `spatialmath` package is to replicate the functionality of the MATLAB® Spatial Math Toolbox while achieving the conflicting high-level design aims of being:
7+
Spatial maths capability underpins all of robotics and robotic vision by describing the relative position and orientation of objects in 2D or 3D space. This package:
88

9-
* as similar as possible to the MATLAB function names and semantics
10-
* as Pythonic as possible
9+
- provides Python classes and functions to manipulate matrices that represent relevant mathematical objects such as rotation matrices :math:`R \in SO(2), SO(3)`, homogeneous transformation matrices :math:`T \in SE(2), SE(3)` and quaternions :math:`q \in \mathbb{H}`.
1110

12-
More detailed design aims include:
11+
- replicates, as much as possible, the functionality of the `Spatial Math Toolbox <https://github.com/petercorke/spatial-math>`__ for MATLAB |reg| which underpins the `Robotics Toolbox <https://github.com/petercorke/robotics-toolbox-matlab>`__ for MATLAB. Important considerations included:
1312

14-
* Python3 support only
15-
* Use Python keyword arguments to replace the RTB string options supported using `tb_optparse`
16-
* Use `numpy` arrays for all rotation and homogeneous transformation matrices, as well as vectors
17-
* Functions that accept a vector can accept a list, tuple, or `np.ndarray`
18-
* By default all `np.ndarray` vectors have the shape `(N,)` but functions also accept row `(1,N)` and column `(N,1)` vectors. This is a gnarly aspect of numpy.
19-
* Unlike RTB these functions do not support sequences, that functionality is supported by the pose classes `SO2`, `SE2`, `SO3`, `SE3`.
13+
- being as similar as possible to the MATLAB Toolbox function names and semantics
14+
- but balancing the tension of being as Pythonic as possible
15+
- use Python keyword arguments to replace the MATLAB Toolbox string options supported using `tb_optparse``
16+
- use ``numpy`` arrays for rotation and homogeneous transformation matrices, quaternions and vectors
17+
- all functions that accept a vector can accept a list, tuple, or `np.ndarray`
18+
- By default all `np.ndarray` vectors have the shape `(N,)` but functions also accept row `(1,N)` and column `(N,1)` vectors. This is a gnarly aspect of numpy.
19+
- The classes can hold a sequence of elements, they are polymorphic with lists, which can be used to represent trajectories or time sequences.
2020

2121
Quick example:
2222

2323
.. code:: python
2424
25-
import spatialmath as sm
26-
27-
R = sm.SO3.Rx(30, 'deg')
28-
print(R)
25+
>>> import spatialmath as sm
26+
>>> R = sm.SO3.Rx(30, 'deg')
27+
>>> R
2928
1 0 0
3029
0 0.866025 -0.5
3130
@@ -56,7 +55,7 @@ However a list of these items has the type `list` and the elements are not enfor
5655
Another option would be to create a `numpy` array of these objects, the upside being it could be a multi-dimensional array. The downside is that again the array is not guaranteed to be homogeneous.
5756

5857

59-
The approach adopted here is to give these classes _list superpowers_ so that a single `SE3` object can contain a list of SE(3) poses. The pose objects are a list subclass so we can index it or slice it as we
58+
The approach adopted here is to give these classes list *super powers* so that a single `SE3` object can contain a list of SE(3) poses. The pose objects are a list subclass so we can index it or slice it as we
6059
would a list, but the result each time belongs to the class it was sliced from. Here's a simple example of SE(3) but applicable to all the classes
6160

6261

@@ -122,11 +121,11 @@ by the multiplication operator. The identity element is a unit matrix.
122121
------------------------------- ----------------------------------
123122
left right type result
124123
============== ============== =========== =====================
125-
Pose Pose Pose composition #1
124+
Pose Pose Pose composition [1]_
126125
Pose scalar matrix elementwise product
127126
scalar Pose matrix elementwise product
128-
Pose N-vector N-vector vector transform #2
129-
Pose NxM matrix NxM matrix vector transform #2#3
127+
Pose N-vector N-vector vector transform [2]_
128+
Pose NxM matrix NxM matrix vector transform [2]_ [3]_
130129
============== ============== =========== =====================
131130

132131
Notes:
@@ -489,6 +488,6 @@ MATLAB compatability
489488

490489

491490

492-
491+
.. |reg| unicode:: U+000AE .. REGISTERED SIGN
493492

494493

0 commit comments

Comments
 (0)
0