(r, time_delta: float)
| 224 | |
| 225 | |
| 226 | def _compute_angular_velocity(r, time_delta: float): |
| 227 | # assume the second last dimension is the time axis |
| 228 | diff_quat_data = quat_identity_like(r) |
| 229 | diff_quat_data[:-1, :] = quat_mul_norm( |
| 230 | r[1:, :], quat_inverse(r[:-1, :]) |
| 231 | ) |
| 232 | diff_angle, diff_axis = quat_angle_axis(diff_quat_data) |
| 233 | angular_velocity = diff_axis * diff_angle[..., None] / time_delta |
| 234 | return angular_velocity |
| 235 | |
| 236 | |
| 237 | def get_ang_vel(rot, dt, target_dt, gt=None): |
no test coverage detected