You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/intro.rst
+18-19Lines changed: 18 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,27 @@ Introduction
4
4
************
5
5
6
6
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:
8
8
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}`.
11
10
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:
13
12
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.
20
20
21
21
Quick example:
22
22
23
23
.. code:: python
24
24
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
29
28
100
30
29
00.866025-0.5
31
30
@@ -56,7 +55,7 @@ However a list of these items has the type `list` and the elements are not enfor
56
55
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.
57
56
58
57
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
60
59
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
61
60
62
61
@@ -122,11 +121,11 @@ by the multiplication operator. The identity element is a unit matrix.
0 commit comments