MCPcopy Create free account
hub / github.com/MotrixLab/insactor / get_rot

Function get_rot

data/kitml_converter.py:256–265  ·  view source on GitHub ↗
(rot, dt, target_dt)

Source from the content-addressed store, hash-verified

254
255
256def get_rot(rot, dt, target_dt):
257 rot = rot[..., [1, 2, 3, 0]]
258 nframe = rot.shape[0]
259 x = np.arange(nframe) * dt
260 x_target = np.arange(int(nframe * dt / target_dt)) * target_dt
261
262 rotations = Rotation.from_quat(rot)
263 spline = RotationSpline(x, rotations)
264
265 return spline(x_target, 0).as_quat()[:, [3, 0, 1, 2]]
266
267
268if __name__ == '__main__':

Callers 1

kitml_converter.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected