basic_robotics.general.faser_transform module
Implement Transformations.
- class basic_robotics.general.faser_transform.tm(initializer_array=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), rpy=False)[source]
Bases:
objectClass to represent and manipulate 3d transformations easily.
Utilizes Euler Angles and 4x4 Transformation Matrices
- __init__(initializer_array=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), rpy=False)[source]
Initialize a new Transformation object.
If no initializer_array is supplied, an identity transform is returned. initializer_array can be of the following types, with different behaviors:
tm: a copy of the tm object is returned
len(3) list: a tm object representing an XYZ rotation is returned
len(3) list with rpy True: a tm representing a ZYX(RPY) rotation is returned
len(6) list: a tm object representing an XYZ translation and XYZ rotation is returned
len(6) list with rpy True: a tm object representing an XYZ translation and ZYX(RPY) rotation is returned
len(7) list: a tm object representing an XYZ translation and a quaternion is returned
4x4 transformation matrix: a tm object representing the given transform is returned
- Parameters:
initializer_array – Optional - data to generate new transformation
- from7DOF(initializer_array)[source]
Short summary.
- Parameters:
initializer_array (type) – Description of parameter initializer_array.
- Returns:
type – Description of returned object.
- spawnNew(init)[source]
Spawns a new TM object. Useful when tm is not speifically imported.
- Parameters:
init – initialization argument
- Returns:
tm – tm object
- transformSqueezedCopy(transform_matrix)[source]
In cases of dimension troubles, squeeze out the extra dimension.
- Parameters:
TM – input 4x4 matrix
- Returns:
TM – return 4x4 matrix
- tripleUnit(lv=1)[source]
Return XYZ unit vectors based on current position.
- Parameters:
lv – length to magnify by
- Returns:
vec1 – vector X vec2: vector Y vec3: vector Z
- adjoint()[source]
Return the adjoint representation of the 4x4 transformation matrix.
- Returns:
Adjoint
- gRot()[source]
Return the rotation matrix component of the 4x4 transformation matrix.
- Returns:
3x3 rotation matrix
- gTM()[source]
Return the 4x4 transformation matrix representation of the tm object.
- Returns:
4x4 tm
- sTM(TM)[source]
Set the 4x4 transformation matrix and updates the object.
- Parameters:
TM – 4x4 transformation matrix to be set
- sTAA(TAA)[source]
Set the TAA version of the object and updates.
- Parameters:
TAA – New TAA to be set
- cT()[source]
Return the conjugate transpose if transpose doesn’t work, use this.
- Returns:
TM.conj().T