RLBench/envs/_quadrocopter/quaternions.py
def apply_omega_to_quat(q, omega, dt):
    """
    Convert a quaternion q and apply the angular velocity omega to it over dt.

    Parameters:
    -----------
    q: quaternion
    omega: ndarray
        angular velocity
    dt: float
        time difference

    Returns:
    --------
    quaternion
        The quaternion of the orientation after rotation with omega for dt
        seconds.
    """
    # rotation angle around each axis
    w = omega * dt

    # only rotate if the angle we rotate through is actually significant
    if vector_norm(w) < np.finfo(float).eps * 4.0:
        return q

    # quaternion corresponding to this rotation
    # w = 0 is not a problem because numpy is awesome
    r = quaternion_about_axis(vector_norm(w), w)

    # return the rotated quaternion closest to original
    return quaternion_multiply(r, q)

    Convert a quaternion q and apply the angular velocity omega to it over dt.

    Parameters:
    -----------
    q: quaternion
    omega: ndarray
        angular velocity
    dt: float
        time difference

    Returns:
    --------
    quaternion
        The quaternion of the orientation after rotation with omega for dt
        seconds.
    
Convert a quaternion q and apply the angular velocity omega to it over dt.
Parameters.

quaternion
omega: ndarray
angular velocity
dt: float
time difference



quaternion
The quaternion of the orientation after rotation with omega for dt
seconds.
Convert a quaternion q and apply the angular velocity omega to it over dt . Parameters . quaternion omega : ndarray angular velocity dt : float time difference quaternion The quaternion of the orientation after rotation with omega for dt seconds .
def apply_omega_to_quat(q, omega, dt):
    w = omega * dt
    if vector_norm(w) < np.finfo(float).eps * 4.0:
        return q
    r = quaternion_about_axis(vector_norm(w), w)
    return quaternion_multiply(r, q)
def apply_omega_to_quat ( q , omega , dt ) : w = omega * dt if vector_norm ( w ) < np . finfo ( float ) . eps * 4.0 : return q r = quaternion_about_axis ( vector_norm ( w ) , w ) return quaternion_multiply ( r , q )
Convert a quaternion q and apply the angular velocity omega to it over dt.
Convert a quaternion q and apply the angular velocity omega to it over dt .
"""
    Convert a quaternion q and apply the angular velocity omega to it over dt.

    Parameters:
    -----------
    q: quaternion
    omega: ndarray
        angular velocity
    dt: float
        time difference

    Returns:
    --------
    quaternion
        The quaternion of the orientation after rotation with omega for dt
        seconds.
    """ # rotation angle around each axis # only rotate if the angle we rotate through is actually significant # quaternion corresponding to this rotation # w = 0 is not a problem because numpy is awesome # return the rotated quaternion closest to original
q
omega
dt