Transform Class Reference

Class representing a transformation (translation and rotation) for the positional tracking module. More...

Functions

None init_transform (self, Transform, motion)
 Deep copy from another sl.Transform. More...
 
None init_matrix (self, Matrix4f matrix)
 Initializes the sl.Transform from a sl.Matrix4f. More...
 
None init_rotation_translation (self, Rotation rot, Translation tr)
 Initializes the sl.Transform from an sl.Rotation and a sl.Translation. More...
 
None init_orientation_translation (self, Orientation orient, Translation tr)
 Initializes the sl.Transform from an sl.Orientation and a sl.Translation. More...
 
None set_rotation_matrix (self, Rotation py_rotation)
 Sets the rotation component of the current sl.Transform from an sl.Rotation. More...
 
Rotation get_rotation_matrix (self)
 Returns the sl.Rotation corresponding to the current sl.Transform. More...
 
None set_translation (self, Translation py_translation)
 Sets the translation component of the current sl.Transform from an sl.Translation. More...
 
Translation get_translation (self)
 Returns the sl.Translation corresponding to the current sl.Transform. More...
 
None set_orientation (self, Orientation py_orientation)
 Sets the orientation component of the current sl.Transform from an sl.Orientation. More...
 
Orientation get_orientation (self)
 Returns the sl.Orientation corresponding to the current sl.Transform. More...
 
npt.NDArray[float] get_rotation_vector (self)
 Returns the 3x1 rotation vector obtained from 3x3 rotation matrix using Rodrigues formula. More...
 
None set_rotation_vector (self, float input0, float input1, float input2)
 Sets the rotation component of the sl.Transform with a 3x1 rotation vector (using Rodrigues' transformation). More...
 
npt.NDArray[float] get_euler_angles (self, radian=True)
 Converts the rotation component of the sl.Transform into Euler angles. More...
 
None set_euler_angles (self, float input0, float input1, float input2, radian=True)
 Sets the rotation component of the sl.Transform from Euler angles. More...
 
np.numpy[float][float] m (self)
 4*4 numpy array of inner data.
 
ERROR_CODE inverse (self)
 Sets the sl.Matrix4f to its inverse. More...
 
Matrix4f inverse_mat (self, Matrix4f rotation)
 Returns the inverse of a sl.Matrix4f. More...
 
None transpose (self)
 Sets the sl.Matrix4f to its transpose.
 
Matrix4f transpose_mat (self, Matrix4f rotation)
 Returns the transpose of a sl.Matrix4f. More...
 
Matrix4f set_identity (self)
 Sets the sl.Matrix4f to identity. More...
 
None set_zeros (self)
 Sets the sl.Matrix4f to zero.
 
str get_infos (self)
 Returns the components of the sl.Matrix4f in a string. More...
 
ERROR_CODE set_sub_matrix3f (self, Matrix3f input, row=0, column=0)
 Sets a sl.Matrix3f inside the sl.Matrix4f. More...
 
ERROR_CODE set_sub_vector3f (self, float input0, float input1, float input2, column=3)
 Sets a 3x1 Vector inside the sl.Matrix4f at the specified column index. More...
 
ERROR_CODE set_sub_vector4f (self, float input0, float input1, float input2, float input3, column=3)
 Sets a 4x1 Vector inside the sl.Matrix4f at the specified column index. More...
 
str matrix_name (self)
 Returns the name of the matrix (optional).
 
int nbElem (self)
 Number of elements in the matrix (always 16).
 

Static Functions

def identity ()
 Creates an identity sl.Matrix4f. More...
 
Matrix4f zeros ()
 Creates a sl.Matrix4f filled with zeros. More...
 

Detailed Description

Class representing a transformation (translation and rotation) for the positional tracking module.

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

Functions

◆ init_transform()

None init_transform (   self,
  Transform,
  motion 
)

Deep copy from another sl.Transform.

Parameters
motion: sl.Transform to copy.

◆ init_matrix()

None init_matrix (   self,
Matrix4f  matrix 
)

Initializes the sl.Transform from a sl.Matrix4f.

Parameters
matrix: sl.Matrix4f to be used.

Reimplemented from Matrix4f.

◆ init_rotation_translation()

None init_rotation_translation (   self,
Rotation  rot,
Translation  tr 
)

Initializes the sl.Transform from an sl.Rotation and a sl.Translation.

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

◆ init_orientation_translation()

None init_orientation_translation (   self,
Orientation  orient,
Translation  tr 
)

Initializes the sl.Transform from an sl.Orientation and a sl.Translation.

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

◆ set_rotation_matrix()

None set_rotation_matrix (   self,
Rotation  py_rotation 
)

Sets the rotation component of the current sl.Transform from an sl.Rotation.

Parameters
py_rotation: sl.Rotation to be used.

◆ get_rotation_matrix()

Rotation get_rotation_matrix (   self)

Returns the sl.Rotation corresponding to the current sl.Transform.

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

◆ set_translation()

None set_translation (   self,
Translation  py_translation 
)

Sets the translation component of the current sl.Transform from an sl.Translation.

Parameters
py_translation: sl.Translation to be used.

◆ get_translation()

Translation get_translation (   self)

Returns the sl.Translation corresponding to the current sl.Transform.

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

◆ set_orientation()

None set_orientation (   self,
Orientation  py_orientation 
)

Sets the orientation component of the current sl.Transform from an sl.Orientation.

Parameters
py_orientation: sl.Orientation to be used.

◆ get_orientation()

Orientation get_orientation (   self)

Returns the sl.Orientation corresponding to the current sl.Transform.

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

◆ get_rotation_vector()

npt.NDArray[float] get_rotation_vector (   self)

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

Returns
Rotation vector (NumPy array) created from the sl.Transform values.

◆ set_rotation_vector()

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

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

Parameters
input0: rx component of the rotation vector.
input1: ry component of the rotation vector.
input2: rz component of the rotation vector.

◆ get_euler_angles()

npt.NDArray[float] get_euler_angles (   self,
  radian = True 
)

Converts the rotation component of the sl.Transform into Euler angles.

Parameters
radian: Whether the angle will be returned in radian or degree. Default: True
Returns
Euler angles (Numpy array) created from the sl.Transform values representing the rotations around the X, Y and Z axes using YZX convention.

◆ set_euler_angles()

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

Sets the rotation component of the sl.Transform from Euler angles.

Parameters
input0: Roll value.
input1: Pitch value.
input2: Yaw value.
radian: Whether the angle is in radian or degree. Default: True

◆ inverse()

ERROR_CODE inverse (   self)
inherited

Sets the sl.Matrix4f to its inverse.

Returns
sl.ERROR_CODE.SUCCESS if the inverse has been computed, sl.ERROR_CODE.FAILURE is not (det = 0).

◆ inverse_mat()

Matrix4f inverse_mat (   self,
Matrix4f  rotation 
)
inherited

Returns the inverse of a sl.Matrix4f.

Parameters
rotation: sl.Matrix4f to compute the inverse from.
Returns
The inverse of the sl.Matrix4f given as input.

◆ transpose_mat()

Matrix4f transpose_mat (   self,
Matrix4f  rotation 
)
inherited

Returns the transpose of a sl.Matrix4f.

Parameters
rotation: sl.Matrix4f to compute the transpose from.
Returns
The transpose of the sl.Matrix4f given as input.

◆ set_identity()

Matrix4f set_identity (   self)
inherited

Sets the sl.Matrix4f to identity.

Returns
itself

◆ identity()

def identity ( )
staticinherited

Creates an identity sl.Matrix4f.

Returns
A sl.Matrix3f set to identity.

◆ zeros()

Matrix4f zeros ( )
staticinherited

Creates a sl.Matrix4f filled with zeros.

Returns
A sl.Matrix4f filled with zeros.

◆ get_infos()

str get_infos (   self)
inherited

Returns the components of the sl.Matrix4f in a string.

Returns
A string containing the components of the current sl.Matrix4f.

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

◆ set_sub_matrix3f()

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

Sets a sl.Matrix3f inside the sl.Matrix4f.

Note
Can be used to set the rotation matrix when the sl.Matrix4f is a pose or an isometric matrix.
Parameters
input: Sub-matrix to put inside the sl.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
sl.ERROR_CODE.SUCCESS if everything went well, sl.ERROR_CODE.FAILURE otherwise.

◆ set_sub_vector3f()

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

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

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

◆ set_sub_vector4f()

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

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

Parameters
input0: First value of the 4x1 Vector to put inside the sl.Matrix4f.
input1: Second value of the 4x1 Vector to put inside the sl.Matrix4f.
input2: Third value of the 4x1 Vector to put inside the sl.Matrix4f.
input3: Fourth value of the 4x1 Vector to put inside the sl.Matrix4f.
column: Index of the column to start the 3x3 block. By default, it is the last column (translation for a sl.Pose).
Returns
sl.ERROR_CODE.SUCCESS if everything went well, sl.ERROR_CODE.FAILURE otherwise.