Create a rotating trajectory.
(
offset_xyz_m: np.ndarray,
distance_m: float,
num_steps: int,
num_repeats: int,
)
| 177 | |
| 178 | |
| 179 | def create_eye_trajectory_rotate_forward( |
| 180 | offset_xyz_m: np.ndarray, |
| 181 | distance_m: float, |
| 182 | num_steps: int, |
| 183 | num_repeats: int, |
| 184 | ) -> list[torch.Tensor]: |
| 185 | """Create a rotating trajectory.""" |
| 186 | num_steps_total = num_steps * num_repeats |
| 187 | offset_x_m, _, offset_z_m = offset_xyz_m |
| 188 | eye_positions = [ |
| 189 | torch.tensor( |
| 190 | [ |
| 191 | offset_x_m * np.sin(2 * np.pi * t), |
| 192 | 0.0, |
| 193 | distance_m + offset_z_m * (1.0 - np.cos(2 * np.pi * t)) / 2, |
| 194 | ], |
| 195 | dtype=torch.float32, |
| 196 | ) |
| 197 | for t in np.linspace(0, num_repeats, num_steps_total) |
| 198 | ] |
| 199 | |
| 200 | return eye_positions |
| 201 | |
| 202 | |
| 203 | def create_camera_model( |
no outgoing calls
no test coverage detected