gym_gz.rbd#

gym_gz.rbd.conversions#

class gym_gz.rbd.conversions.Quaternion#

Bases: ABC

static from_matrix(matrix)#
Return type:

ndarray

static to_rotation(quaternion)#
Return type:

ndarray

static to_wxyz(xyzw)#
Return type:

ndarray

static to_xyzw(wxyz)#
Return type:

ndarray

class gym_gz.rbd.conversions.Transform#

Bases: ABC

static from_position_and_quaternion(position, quaternion)#
Return type:

ndarray

static from_position_and_rotation(position, rotation)#
Return type:

ndarray

static to_position_and_quaternion(transform)#
Return type:

Tuple[ndarray, ndarray]

static to_position_and_rotation(transform)#
Return type:

Tuple[ndarray, ndarray]

gym_gz.rbd.utils#

gym_gz.rbd.utils.extract_skew(matrix)#

Extract the skew-symmetric part of a square matrix.

Parameters:

matrix (ndarray) – A square matrix.

Return type:

ndarray

Returns:

The skew-symmetric part of the input matrix.

gym_gz.rbd.utils.extract_symm(matrix)#

Extract the symmetric part of a square matrix.

Parameters:

matrix (ndarray) – A square matrix.

Return type:

ndarray

Returns:

The symmetric part of the input matrix.

gym_gz.rbd.utils.vee(matrix3x3)#

Convert a 3x3 matrix to a 3D vector with the components of its skew-symmetric part.

Parameters:

matrix3x3 (ndarray) – The input 3x3 matrix. If present, its symmetric part is removed.

Return type:

ndarray

Returns:

The 3D vector defining the skew-symmetric matrix.

Note

This is the inverse operator of wedge().

gym_gz.rbd.utils.wedge(vector3)#

Convert a 3D vector to a skew-symmetric matrix.

Parameters:

vector3 (ndarray) – The 3D vector defining the matrix coefficients.

Return type:

ndarray

Returns:

The skew-symmetric matrix whose elements are created from the input vector.

Note

The wedge operator can be useful to compute the cross product of 3D vectors: \(v_1 \times v_2 = v_1^\wedge v_2\).