spatial-casadi  1.1.0
Spatial transformation library for CasADi Python.
Classes | Functions | Variables
spatial_casadi.spatial Namespace Reference

Classes

class  Rotation
 
class  Translation
 A class defining a translation vector. More...
 
class  Transformation
 A class for representing homogenous transformations. More...
 

Functions

bool _iszero (Array a)
 
CasadiArray _cross3 (Array a, Array b)
 
CasadiArray _make_elementary_quat (str axis, Array angles)
 
CasadiArray _dot3 (Array a, Array b)
 
CasadiArray _norm3 (Array elems)
 
CasadiArray _normalize4 (Array elems)
 
def _argmax4 (a)
 
CasadiArray _quat_canonical_single (Array q)
 
CasadiArray _quat_canonical (Array q)
 
def _get_angles (angles, extrinsic, symmetric, sign, lamb, a, b, c, d)
 
def _compose_quat (p, q)
 
def _elementary_quat_compose (seq, angles, intrinsic)
 
def _single_matrix_to_quat (matrix)
 

Variables

 eps = np.finfo(float).eps
 
 CasadiArray = cs.MX | cs.SX | cs.DM
 
 NonSymbolicCasadiArray = cs.DM
 
 Array = cs.MX | cs.SX | cs.DM | np.ndarray
 
 NonSymbolicArray = cs.DM | np.ndarray
 
 _ex = cs.DM([1.0, 0.0, 0.0])
 
 _ey = cs.DM([0.0, 1.0, 0.0])
 
 _ez = cs.DM([0.0, 0.0, 1.0])
 
dictionary _elementary_basis_vector = {"x": _ex, "y": _ey, "z": _ez}
 

Function Documentation

◆ _argmax4()

def spatial_casadi.spatial._argmax4 (   a)
private
Index for the element with maximum value.

◆ _compose_quat()

def spatial_casadi.spatial._compose_quat (   p,
  q 
)
private
Compose two quaternions by performing quaternion multiplication.

Args
    p (array-like): The first quaternion as an array-like object.
    q (array-like): The second quaternion as an array-like object.

Returns
    casadi-array: The resulting quaternion from the multiplication of p and q.

◆ _cross3()

CasadiArray spatial_casadi.spatial._cross3 ( Array  a,
Array  b 
)
private
Cross product for vectors a and b of length 3.

◆ _dot3()

CasadiArray spatial_casadi.spatial._dot3 ( Array  a,
Array  b 
)
private
Dot-product with vectors of length 3.

◆ _elementary_quat_compose()

def spatial_casadi.spatial._elementary_quat_compose (   seq,
  angles,
  intrinsic 
)
private
Compose a sequence of elementary quaternions into a single quaternion.

Args
    seq (array-like): A sequence of axes ('x', 'y', 'z') around which to rotate.
    angles (array-like): A sequence of rotation angles in radians corresponding to each axis in `seq`.
    intrinsic (bool): If `True`, applies intrinsic rotations; otherwise, applies extrinsic rotations.

Returns
    casadi-array: The resulting quaternion from composing the sequence of elementary quaternions.

◆ _get_angles()

def spatial_casadi.spatial._get_angles (   angles,
  extrinsic,
  symmetric,
  sign,
  lamb,
  a,
  b,
  c,
  d 
)
private

◆ _iszero()

bool spatial_casadi.spatial._iszero ( Array  a)
private
True when a is numerically zero, False otherwise.

◆ _make_elementary_quat()

CasadiArray spatial_casadi.spatial._make_elementary_quat ( str  axis,
Array  angles 
)
private
Create an elementary quaternion representing a rotation around a specified axis.

Args
    axis (str): The axis to rotate around. Must be 'x', 'y', or 'z'.
    angles (array-like): The rotation angle(s) in radians.

Returns
    casadi-array: A quaternion representing the rotation.

◆ _norm3()

CasadiArray spatial_casadi.spatial._norm3 ( Array  elems)
private
Euclidean norm for a vector of length 3.

◆ _normalize4()

CasadiArray spatial_casadi.spatial._normalize4 ( Array  elems)
private
Normalize vector of length 4.

◆ _quat_canonical()

CasadiArray spatial_casadi.spatial._quat_canonical ( Array  q)
private

◆ _quat_canonical_single()

CasadiArray spatial_casadi.spatial._quat_canonical_single ( Array  q)
private
Reduce the quaternion double coverage of the rotation group to a unique canonical 'positive' single cover.

◆ _single_matrix_to_quat()

def spatial_casadi.spatial._single_matrix_to_quat (   matrix)
private

Variable Documentation

◆ _elementary_basis_vector

dictionary spatial_casadi.spatial._elementary_basis_vector = {"x": _ex, "y": _ey, "z": _ez}
private

◆ _ex

spatial_casadi.spatial._ex = cs.DM([1.0, 0.0, 0.0])
private

◆ _ey

spatial_casadi.spatial._ey = cs.DM([0.0, 1.0, 0.0])
private

◆ _ez

spatial_casadi.spatial._ez = cs.DM([0.0, 0.0, 1.0])
private

◆ Array

spatial_casadi.spatial.Array = cs.MX | cs.SX | cs.DM | np.ndarray

◆ CasadiArray

spatial_casadi.spatial.CasadiArray = cs.MX | cs.SX | cs.DM

◆ eps

spatial_casadi.spatial.eps = np.finfo(float).eps

◆ NonSymbolicArray

spatial_casadi.spatial.NonSymbolicArray = cs.DM | np.ndarray

◆ NonSymbolicCasadiArray

spatial_casadi.spatial.NonSymbolicCasadiArray = cs.DM