Create a left to right swipe trajectory.
(
offset_xyz_m: np.ndarray,
distance_m: float,
num_steps: int,
num_repeats: int,
)
| 107 | |
| 108 | |
| 109 | def create_eye_trajectory_swipe( |
| 110 | offset_xyz_m: np.ndarray, |
| 111 | distance_m: float, |
| 112 | num_steps: int, |
| 113 | num_repeats: int, |
| 114 | ) -> list[torch.Tensor]: |
| 115 | """Create a left to right swipe trajectory.""" |
| 116 | offset_x_m, _, _ = offset_xyz_m |
| 117 | eye_positions = [ |
| 118 | torch.tensor([x, 0, distance_m], dtype=torch.float32) |
| 119 | for x in np.linspace(-offset_x_m, offset_x_m, num_steps) |
| 120 | ] |
| 121 | return eye_positions * num_repeats |
| 122 | |
| 123 | |
| 124 | def create_eye_trajectory_shake( |
no outgoing calls
no test coverage detected