Transform Class Reference

Designed to contain translation and rotation data of the positional tracking. More...

Functions

def init_transform (self, Transform motion)
 Deep copy from another Transform. More...
 
def init_matrix (self, Matrix4f matrix)
 Inits Transform from a Matrix4f. More...
 
def init_rotation_translation (self, Rotation rot, Translation tr)
 Inits Transform from a Rotation and a Translation . More...
 
def init_orientation_translation (self, Orientation orient, Translation tr)
 Inits Transform from a Orientation and a Translation . More...
 
def set_rotation_matrix (self, Rotation py_rotation)
 Sets the rotation of the current Transform from a Rotation . More...
 
def get_rotation_matrix (self)
 Returns the Rotation of the current Transform . More...
 
def set_translation (self, Translation py_translation)
 Sets the translation of the current Transform from a Translation . More...
 
def get_translation (self)
 Returns the Translation of the current Transform . More...
 
def set_orientation (self, Orientation py_orientation)
 Sets the orientation of the current Transform from an Orientation . More...
 
def get_orientation (self)
 Returns the Orientation of the current Transform . More...
 
def get_rotation_vector (self)
 Returns the 3x1 rotation vector obtained from 3x3 rotation matrix using Rodrigues formula. More...
 
def set_rotation_vector (self, float input0, float input1, float input2)
 Sets the Rotation 3x3 of the Transform with a 3x1 rotation vector (using Rodrigues' transformation). More...
 
def get_euler_angles (self, radian=True)
 Converts the Rotation of the Transform as Euler angles. More...
 
def set_euler_angles (self, float input0, float input1, float input2, radian=True)
 Sets the Rotation of the Transform from the Euler angles. More...
 
def inverse (self)
 Inverses the matrix.
 
def inverse_mat (self, Matrix4f rotation)
 Inverses the Matrix4f passed as a parameter. More...
 
def transpose (self)
 Sets the Matrix4f to its transpose.
 
def transpose_mat (self, Matrix4f rotation)
 Returns the transpose of a Matrix4f. More...
 
def set_identity (self)
 Sets the Matrix4f to identity. More...
 
def identity (self)
 Creates an identity Matrix4f. More...
 
def set_zeros (self)
 Sets the Matrix4f to zero.
 
def zeros (self)
 Creates a Matrix4f filled with zeros. More...
 
def get_infos (self)
 Returns the components of the Matrix4f in a string. More...
 
def set_sub_matrix3f (self, Matrix3f input, row=0, column=0)
 Sets a 3x3 Matrix inside the Matrix4f. More...
 
def set_sub_vector3f (self, float input0, float input1, float input2, column=3)
 Sets a 3x1 Vector inside the Matrix4f at the specifided column index. More...
 
def set_sub_vector4f (self, float input0, float input1, float input2, float input3, column=3)
 Sets a 4x1 Vector inside the Matrix4f at the specifided column index. More...
 
def matrix_name (self)
 Returns the name of the matrix (optional).
 
def m (self)
 Access to the content of the Matrix4f as a numpy array or list.
 

Detailed Description

Designed to contain translation and rotation data of the positional tracking.

It contains the orientation as well. It can be used to create any type of Matrix4x4 or Matrix4f that must be specifically used for handling a rotation and position information (OpenGL, Tracking...). It inherits from the generic Matrix4f .

Functions

◆ init_transform()

def init_transform (   self,
Transform  motion 
)

Deep copy from another Transform.

Parameters
motion: Transform to be copied

◆ init_matrix()

def init_matrix (   self,
Matrix4f  matrix 
)

Inits Transform from a Matrix4f.

Parameters
matrix: Matrix4f to be used

Reimplemented from Matrix4f.

◆ init_rotation_translation()

def init_rotation_translation (   self,
Rotation  rot,
Translation  tr 
)

Inits Transform from a Rotation and a Translation .

Parameters
rot: Rotation to be used.
tr: Translation to be used.

◆ init_orientation_translation()

def init_orientation_translation (   self,
Orientation  orient,
Translation  tr 
)

Inits Transform from a Orientation and a Translation .

Parameters
orient: Orientation to be used
tr: Translation to be used

◆ set_rotation_matrix()

def set_rotation_matrix (   self,
Rotation  py_rotation 
)

Sets the rotation of the current Transform from a Rotation .

Parameters
py_rotation: the Rotation to be used.

◆ get_rotation_matrix()

def get_rotation_matrix (   self)

Returns the Rotation of the current Transform .

Returns
The Rotation of the current Transform .

◆ set_translation()

def set_translation (   self,
Translation  py_translation 
)

Sets the translation of the current Transform from a Translation .

Parameters
py_translation: Translation to be used.

◆ get_translation()

def get_translation (   self)

Returns the Translation of the current Transform .

Returns
the Translation created from the Transform values .
Warning
the given Translation contains a copy of the Transform values.

◆ set_orientation()

def set_orientation (   self,
Orientation  py_orientation 
)

Sets the orientation of the current Transform from an Orientation .

Parameters
py_orientation: Orientation to be used.

◆ get_orientation()

def get_orientation (   self)

Returns the Orientation of the current Transform .

Returns
The Orientation created from the Transform values.
Warning
the given Orientation contains a copy of the Transform values.

◆ get_rotation_vector()

def get_rotation_vector (   self)

Returns the 3x1 rotation vector obtained from 3x3 rotation matrix using Rodrigues formula.

Returns
The rotation vector (numpy array)

◆ set_rotation_vector()

def set_rotation_vector (   self,
float  input0,
float  input1,
float  input2 
)

Sets the Rotation 3x3 of the Transform with a 3x1 rotation vector (using Rodrigues' transformation).

Parameters
input0: First float value
input1: Second float value
input2: Third float value

◆ get_euler_angles()

def get_euler_angles (   self,
  radian = True 
)

Converts the Rotation of the Transform as Euler angles.

Parameters
radian: True if the angle is in radian, False otherwise. Default: True
Returns
The Euler angles, as 3x1 numpy array representing the rotations around the x, y and z axes.

◆ set_euler_angles()

def set_euler_angles (   self,
float  input0,
float  input1,
float  input2,
  radian = True 
)

Sets the Rotation of the Transform from the Euler angles.

Parameters
input0: First float euler value.
input1: Second float euler value.
input2: Third float euler value.
radian: True if the angle is in radian, False otherwise. Default: True

◆ inverse_mat()

def inverse_mat (   self,
Matrix4f  rotation 
)
inherited

Inverses the Matrix4f passed as a parameter.

Parameters
rotation: the Matrix4f to inverse
Returns
the inversed Matrix4f

◆ transpose_mat()

def transpose_mat (   self,
Matrix4f  rotation 
)
inherited

Returns the transpose of a Matrix4f.

Parameters
rotation: the Matrix4f to compute the transpose from.
Returns
the transposed Matrix4f

◆ set_identity()

def set_identity (   self)
inherited

Sets the Matrix4f to identity.

Returns
itself

◆ identity()

def identity (   self)
inherited

Creates an identity Matrix4f.

Returns
A Matrix4f set to identity

◆ zeros()

def zeros (   self)
inherited

Creates a Matrix4f filled with zeros.

Returns
A Matrix4f filled with zeros.

◆ get_infos()

def get_infos (   self)
inherited

Returns the components of the Matrix4f in a string.

Returns
A string containing the components of the current Matrix4f

Referenced by Matrix4f.m(), and Mat.verbose().

◆ set_sub_matrix3f()

def set_sub_matrix3f (   self,
Matrix3f  input,
  row = 0,
  column = 0 
)
inherited

Sets a 3x3 Matrix inside the Matrix4f.

Note
Can be used to set the rotation matrix when the matrix4f is a pose or an isometric matrix.
Parameters
input: sub matrix to put inside the Matrix4f
row: index of the row to start the 3x3 block. Must be 0 or 1.
column: index of the column to start the 3x3 block. Must be 0 or 1.
Returns
ERROR_CODE.SUCCESS if everything went well, ERROR_CODE.FAILURE otherwise.

◆ set_sub_vector3f()

def set_sub_vector3f (   self,
float  input0,
float  input1,
float  input2,
  column = 3 
)
inherited

Sets a 3x1 Vector inside the Matrix4f at the specifided column index.

Note
Can be used to set the Translation/Position matrix when the matrix4f is a pose or an isometry.
Parameters
input0: first value of the 3x1 Vector to put inside the Matrix4f
input1: second value of the 3x1 Vector to put inside the Matrix4f
input2: third value of the 3x1 Vector to put inside the Matrix4f
column: index of the column to start the 3x3 block. By default, it is the last column (translation for a Pose ).
Returns
ERROR_CODE.SUCCESS if everything went well, ERROR_CODE.FAILURE otherwise.

◆ set_sub_vector4f()

def set_sub_vector4f (   self,
float  input0,
float  input1,
float  input2,
float  input3,
  column = 3 
)
inherited

Sets a 4x1 Vector inside the Matrix4f at the specifided column index.

Parameters
input0: first value of the 4x1 Vector to put inside the Matrix4f
input1: second value of the 4x1 Vector to put inside the Matrix4f
input2: third value of the 4x1 Vector to put inside the Matrix4f
input3: fourth value of the 4x1 Vector to put inside the Matrix4f
column: index of the column to start the 3x3 block. By default, it is the last column (translation for a Pose ).
Returns
ERROR_CODE.SUCCESS if everything went well, ERROR_CODE.FAILURE otherwise.