Skip to content

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 1D ndarray R 1
  • R2 is a 1D ndarray R 2
  • R3 is a 1D ndarray R 3
  • R4 is a 1D ndarray R 4
  • R6 is a 1D ndarray R 6
  • R8 is a 1D ndarray R 8

Real matrices

  • R1x1 R 1 × 1
  • R2x2 R 2 × 2
  • R3x3 R 3 × 3
  • R4x4 R 4 × 4
  • R6x6 R 6 × 6
  • R8x8 R 8 × 8
  • R1x3 R 1 × 3
  • R3x1 R 3 × 1
  • R1x2 R 1 × 2
  • R2x1 R 2 × 1

Points

  • Points2 2D points, columnise, R 2 × N
  • Points3 2D points, columnise, R 3 × N
  • RNx3 R N × 3

Lie groups

  • SO2Array 2D rotation matrix, element of SO(2) R 2 × 2
  • SE2Array 2D rigid-body transformation matrix, element of SE(2) R 3 × 3
  • SO3Array 3D rotation matrix, element of SO(3) R 3 × 3
  • SE3Array 3D rigid-body transformation matrix, element of SE(32) R 4 × 4

Lie algebras, skew and augmented skew matrices

  • so2Array Lie algebra of SO(2) R 2 × 2
  • se2Array Lie algebra of SE(2) R 3 × 3
  • so3Array Lie algebra of SO(3) R 3 × 3
  • se3Array Lie algebra of SE(32) R 4 × 4

Quaternions

  • QuaternionArray quaternion, element of H R 4
  • UnitQuaternionArray unit quaternion, element of S 3 R 4

2D and 3D unions

  • Rn = R2 | R3
  • SOnArray = SO2Array | SO3Array
  • SEnArray = SE2Array | SE3Array
  • sonArray = so2Array | so3Array
  • senArray = se2Array | se3Array
Clone this wiki locally