Spaces:
Running
on
Zero
Running
on
Zero
File size: 353 Bytes
ffbf761 |
1 2 3 4 5 6 7 8 9 10 11 12 |
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()
|