MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / axis_angle_to_rot6d

Function axis_angle_to_rot6d

motion_rep/rotation_transform.py:25–35  ·  view source on GitHub ↗

Convert 3d vector of axis-angle rotation to 6d rotation representation. Shape: - Input: :Torch:`(N, 3)` - Output: :Torch:`(N, 6)`

(angle_axis)

Source from the content-addressed store, hash-verified

23 return rot_mat
24
25def axis_angle_to_rot6d(angle_axis):
26 """Convert 3d vector of axis-angle rotation to 6d rotation representation.
27 Shape:
28 - Input: :Torch:`(N, 3)`
29 - Output: :Torch:`(N, 6)`
30 """
31 rot_mat = tgm.angle_axis_to_rotation_matrix(angle_axis) # 4x4 rotation matrix
32 rot6d = rot_mat[:, :3, :2]
33 rot6d = rot6d.reshape(-1, 6)
34
35 return rot6d
36
37def rot6d_to_axis_angle(rot6d):
38 """Convert 6d rotation representation to 3d vector of axis-angle rotation.

Callers 2

quaternion_to_rot6dFunction · 0.85
collect_motion_rep_DARTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected