-
Notifications
You must be signed in to change notification settings - Fork 85
spatial math types
Peter Corke edited this page Feb 27, 2023
·
1 revision
The module base/types.py
defines a set of types for different arrays. These are all ndarray
but giving them more meaningful types is helpful when writing code. The defined types are:
1D arrays for input to functions
-
ArrayLikePure
array like of arbitrary length, eg. `np.r_[1, 2, 3], [1], (1, 2, 3, 4) -
ArrayLike
array like of arbitrary length including scalar, eg.2, np.r_[2], [2], (2,)
-
ArrayLike2
array like of length 2, eg.np.r_[1, 2], [1, 2], (1, 2)
-
ArrayLike3
array like of length 3, eg.np.r_[1, 2, 3], [1, 2, 3], (1, 2, 3)
-
ArrayLike4
array like of length 4, eg.np.r_[1, 2, 3, 4], [1, 2, 3, 4], (1, 2, 3, 4)
-
ArrayLike6
array like of length 6
Real vectors
-
R1
is a 1Dndarray
$\sim \mathbb{R}^1$ -
R2
is a 1Dndarray
$\sim \mathbb{R}^2$ -
R3
is a 1Dndarray
$\sim \mathbb{R}^3$ -
R4
is a 1Dndarray
$\sim \mathbb{R}^4$ -
R6
is a 1Dndarray
$\sim \mathbb{R}^6$ -
R8
is a 1Dndarray
$\sim \mathbb{R}^8$
Real matrices
-
R1x1
$\sim \mathbb{R}^{1\times 1}$ -
R2x2
$\sim \mathbb{R}^{2\times 2}$ -
R3x3
$\sim \mathbb{R}^{3\times 3}$ -
R4x4
$\sim \mathbb{R}^{4\times 4}$ -
R6x6
$\sim \mathbb{R}^{6\times 6}$ -
R8x8
$\sim \mathbb{R}^{8\times 8}$ -
R1x3
$\sim \mathbb{R}^{1\times 3}$ -
R3x1
$\sim \mathbb{R}^{3\times 1}$ -
R1x2
$\sim \mathbb{R}^{1\times 2}$ -
R2x1
$\sim \mathbb{R}^{2\times 1}$
Points
-
Points2
2D points, columnise,$\sim \mathbb{R}^{2\times N}$ -
Points3
2D points, columnise,$\sim \mathbb{R}^{3\times N}$ -
RNx3
$\sim \mathbb{R}^{N\times 3}$
Lie groups
-
SO2Array
2D rotation matrix, element of$\mbox{SO(2)} \subset \mathbb{R}^{2\times 2}$ -
SE2Array
2D rigid-body transformation matrix, element of$\mbox{SE(2)} \subset \mathbb{R}^{3\times 3}$ -
SO3Array
3D rotation matrix, element of$\mbox{SO(3)} \subset \mathbb{R}^{3\times 3}$ -
SE3Array
3D rigid-body transformation matrix, element of$\mbox{SE(32)} \subset \mathbb{R}^{4\times 4}$
Lie algebras, skew and augmented skew matrices
-
so2Array
Lie algebra of$\mbox{SO(2)} \subset \mathbb{R}^{2\times 2}$ -
se2Array
Lie algebra of$\mbox{SE(2)} \subset \mathbb{R}^{3\times 3}$ -
so3Array
Lie algebra of$\mbox{SO(3)} \subset \mathbb{R}^{3\times 3}$ -
se3Array
Lie algebra of$\mbox{SE(32)} \subset \mathbb{R}^{4\times 4}$
Quaternions
-
QuaternionArray
quaternion, element of$\mathbb{H} \sim \mathbb{R}^4$ -
UnitQuaternionArray
unit quaternion, element of${\rm S}^3 \subset \mathbb{R}^4$
2D and 3D unions
Rn = R2 | R3
SOnArray = SO2Array | SO3Array
SEnArray = SE2Array | SE3Array
sonArray = so2Array | so3Array
senArray = se2Array | se3Array