(R1, R2)
| 15 | |
| 16 | |
| 17 | def rotation_angle_batch(R1, R2): |
| 18 | R1_t = np.transpose(R1, (0, 2, 1))[:, np.newaxis, :, :] |
| 19 | R2_b = R2[np.newaxis, :, :, :] |
| 20 | R_mult = np.matmul(R1_t, R2_b) |
| 21 | trace_vals = R_mult[..., 0, 0] + R_mult[..., 1, 1] + R_mult[..., 2, 2] |
| 22 | val = (trace_vals - 1) / 2 |
| 23 | val = np.clip(val, -1.0, 1.0) |
| 24 | angle_rad = np.arccos(val) |
| 25 | angle_deg = np.degrees(angle_rad) |
| 26 | return angle_deg / 180.0 |
| 27 | |
| 28 | |
| 29 | def extrinsic_distance_batch(extrinsics, lambda_t=1.0): |
no outgoing calls
no test coverage detected