This is a partial port to Python/CasADi, with some modifications and additions, of the Spatial Math Toolbox for MATLAB.
More...
|
| ArrayType = Union[cs.DM, cs.SX, List[float], Tuple[float], cs.np.ndarray, float, int] |
| Accepted array types. More...
|
|
| CasADiArrayType = Union[cs.DM, cs.SX] |
| CasADi array types typically returned by OpTaS methods. More...
|
|
| pi = cs.np.pi |
| The number pi (i.e. More...
|
|
| eps = cs.np.finfo(float).eps |
| The machine epsilon. More...
|
|
This is a partial port to Python/CasADi, with some modifications and additions, of the Spatial Math Toolbox for MATLAB.
See the following. https://github.com/petercorke/spatialmath-matlab
◆ angvec2r()
Convert angle and vector orientation to a rotation matrix.
This method uses Rodrigue's formula.
- Parameters
-
theta | Angle of rotation (radians). |
v | Direction vector to rotate about. |
- Returns
- Rotation matrix.
◆ arrayify_args()
Callable optas.spatialmath.arrayify_args |
( |
Callable |
fun | ) |
|
Decorator that ensures all input arguments are casadi arrays (i.e.
either DM or SX).
- Parameters
-
- Returns
- Wrapper that ensures the input to the given function are casadi arrays.
◆ I3()
cs.DM optas.spatialmath.I3 |
( |
| ) |
|
3-by-3 identity matrix.
- Returns
- Identity matrix of order 3.
◆ I4()
cs.DM optas.spatialmath.I4 |
( |
| ) |
|
4-by-4 identity matrix.
- Returns
- Identity matrix of order 4.
◆ invt()
Inverse of a homogeneous transformation matrix.
- Parameters
-
T | Homogeneous transformation matrix. |
- Returns
- Homogeneous transformation matrix such that Tinv @ T = I where I is the identity.
◆ r2t()
Convert rotation matrix to a homogeneous transform.
- Parameters
-
R | A 3-by-3 rotation matrix. |
- Returns
- Homogenous transformation with given rotation and zero translation.
◆ rotx()
SO(3) rotation about X axis.
- Parameters
-
theta | Angle of rotation (radians). |
- Returns
- A 3-by-3 rotation matrix.
◆ roty()
SO(3) rotation about Y axis.
- Parameters
-
theta | Angle of rotation (radians). |
- Returns
- A 3-by-3 rotation matrix.
◆ rotz()
SO(3) rotation about Z axis.
- Parameters
-
theta | Angle of rotation (radians). |
- Returns
- A 3-by-3 rotation matrix.
◆ rpy2r()
Roll-pitch-yaw angles to SO(3) rotation matrix.
- Parameters
-
rpy | Roll-Pitch-Yaw angles in radians. |
opt | Order option. Acceptable inputs:
- 'xyz' Rotations about X, Y, Z axes (for a robot gripper)
- 'zyx' Rotations about Z, Y, X axes (for a mobile robot, default)
- 'yxz' Rotations about Y, X, Z axes (for a camera)
- 'arm' Rotations about X, Y, Z axes (for a robot arm)
- 'vehicle' Rotations about Z, Y, X axes (for a mobile robot)
- 'camera' Rotations about Y, X, Z axes (for a camera)
|
- Returns
- A 3-by-3 rotation matrix.
◆ rt2tr()
Convert rotation and translation to homogeneous transform.
- Parameters
-
R | A 3-by-3 rotation matrix. |
t | A vector with 3 elements. |
- Returns
- Homogeneous transformation matrix.
◆ skew()
Create skew-symmetric matrix.
If V (1x1) then (order 2) S =
| 0 -v |
| v 0 |
and if V (1x3) then (order 3) S =
| 0 -vz vy |
| vz 0 -vx |
|-vy vx 0 |
- Parameters
-
v | The form of the skew-symmetric matrix, either a scalar or vector with 3 elements. |
- Returns
- Skew-symmetric matrix of order 2 or 3.
◆ t2r()
Rotational submatrix.
- Parameters
-
Homogenous | transformation matrix. |
- Returns
- A 3-by-3 rotation matrix.
◆ transl()
SE(3) translational homogeneous transform.
- Parameters
-
T | Homogeneous transformation matrix. |
- Returns
- Translation part of the homogeneous transformation.
◆ unit()
Unitize a vector.
- Parameters
-
- Returns
- A vector of order 3 with unit magnitude that is parralel to input vector.
◆ ArrayType
optas.spatialmath.ArrayType = Union[cs.DM, cs.SX, List[float], Tuple[float], cs.np.ndarray, float, int] |
◆ CasADiArrayType
optas.spatialmath.CasADiArrayType = Union[cs.DM, cs.SX] |
CasADi array types typically returned by OpTaS methods.
◆ eps
optas.spatialmath.eps = cs.np.finfo(float).eps |
◆ pi
optas.spatialmath.pi = cs.np.pi |
The number pi (i.e.
3.141...).