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