Create a rotating trajectory.
(
offset_xyz_m: np.ndarray,
distance_m: float,
num_steps: int,
num_repeats: int,
)
| 153 | |
| 154 | |
| 155 | def create_eye_trajectory_rotate( |
| 156 | offset_xyz_m: np.ndarray, |
| 157 | distance_m: float, |
| 158 | num_steps: int, |
| 159 | num_repeats: int, |
| 160 | ) -> list[torch.Tensor]: |
| 161 | """Create a rotating trajectory.""" |
| 162 | num_steps_total = num_steps * num_repeats |
| 163 | offset_x_m, offset_y_m, _ = offset_xyz_m |
| 164 | eye_positions = [ |
| 165 | torch.tensor( |
| 166 | [ |
| 167 | offset_x_m * np.sin(2 * np.pi * t), |
| 168 | offset_y_m * np.cos(2 * np.pi * t), |
| 169 | distance_m, |
| 170 | ], |
| 171 | dtype=torch.float32, |
| 172 | ) |
| 173 | for t in np.linspace(0, num_repeats, num_steps_total) |
| 174 | ] |
| 175 | |
| 176 | return eye_positions |
| 177 | |
| 178 | |
| 179 | def create_eye_trajectory_rotate_forward( |
no outgoing calls
no test coverage detected