module moplayground.utils.geometry

Global Variables

  • FREE3D_POS
  • FREE3D_VEL

function euler2quat

euler2quat(_np, euler_angles)

Convert euler angles to quaternion representation


function quat2euler

quat2euler(_np, q)

Convert quaternion to euler angles


function rotx

rotx(_np, theta)

Rotation matrix around x axis


function roty

roty(_np, theta)

Rotation matrix around y axis


function rotz

rotz(_np, theta)

Rotation matrix around z axis


function rotmat

rotmat(_np, angles)

Rotation matrix from euler angles


function quat_mul

quat_mul(_np, u, v)

Multiplies two quaternions.

Args:

  • u: (4,) quaternion (w,x,y,z)
  • v: (4,) quaternion (w,x,y,z)

Returns: A quaternion u * v.


function angle2quat

angle2quat(_np, axis, angle)

Provides a quaternion that describes rotating around axis by angle.

Args:

  • axis: (3,) axis (x,y,z)
  • angle: () float angle to rotate by

Returns: A quaternion that rotates around axis by angle


function quat_conjugate

quat_conjugate(_np, q)

Returns the conjugate of a quaternion.

Args:

  • q: (4,) quaternion (w,x,y,z)

Returns: A quaternion that is the conjugate of q.


function extract_yaw

extract_yaw(_np, quat)

Extracts the yaw angle from a quaternion.

Args:

  • quat: (4,) quaternion (w,x,y,z)

Returns: The yaw angle in radians.


function solve_transform

solve_transform(_np, qpos_des, qpos_act, reset_yaw=False, cmd_yaw_offset=None)

Solves the transformation, T, between two qpos for the form qpos_des = qpos_act @ T


function apply_transform

apply_transform(_np, qpos, offset)

Applies the offset transform to the qpos


function quat_rotate_vector

quat_rotate_vector(np, q, v)

Rotate vector v by quaternion q. q: array-like, shape (4,) [w, x, y, z] v: array-like, shape (3,) Returns rotated vector as np.ndarray, shape (3,)


function inv_transform

inv_transform(_np, offset)

Computes the inverse of the offset transform to the qpos


function quat_dist

quat_dist(_np, q1, q2)

function quat_rotate

quat_rotate(_np, q, v)

Rotate vector v (3,) using unit quaternion q (w,x,y,z).


function decide_quat

decide_quat(_np, quat)

This site uses Just the Docs, a documentation theme for Jekyll.