utils

Utility functions

SO(3) parameterization conversions

Implementations to convert rotation_10d (Peretroukhin et al., 2021) and quaternion_adjugate (Hanson and Hanson, 2022) parameterizations of SO(3) to quaternions. These can then be turned into rotation matrices by PyTorch3D.


source

quaternion_to_rotation_10d

 quaternion_to_rotation_10d (q:torch.Tensor)

source

rotation_10d_to_quaternion

 rotation_10d_to_quaternion (rotation:torch.Tensor)

Convert a 10-vector into a symmetric matrix, whose eigenvector corresponding to the eigenvalue of minimum modulus is the resulting quaternion.

Source: https://arxiv.org/abs/2006.01031


source

quaternion_to_quaternion_adjugate

 quaternion_to_quaternion_adjugate (q:torch.Tensor)

source

quaternion_adjugate_to_quaternion

 quaternion_adjugate_to_quaternion (rotation:torch.Tensor)

Convert a 10-vector in the quaternion adjugate, a symmetric matrix whose eigenvector corresponding to the eigenvalue of maximum modulus is the (unnormalized) quaternion. Uses a fast method to solve for the eigenvector without explicity computing the eigendecomposition.

Source: https://arxiv.org/abs/2205.09116


source

convert

 convert (rotation, input_parameterization, output_parameterization,
          input_convention=None, output_convention=None)

Convert a rotation in SO(3) from some parameterization to another. Intermediated by temporary conversion to a rotation matrix.

If input or output parameterizations are euler_angles, need to specify input_convention or output_convention.

Note: conversions to rotation_10d or quaternion_adjugate are not unique.