Spaces:
Sleeping
Sleeping
import numpy as np | |
from scipy.spatial.transform import Rotation | |
from typing import Dict | |
def vector3_to_numpy(vec: Dict[str, float]) -> np.ndarray: | |
return np.array([vec['x'], vec['y'], vec['z']]) | |
def euler_to_quaternion(euler: Dict[str, float]) -> np.ndarray: | |
return Rotation.from_euler('xyz', [euler['x'], euler['y'], euler['z']]).as_quat() | |