Skip to content

Commit 76afdef

Browse files
committed
add extra time check for tracking some of the path when we are doing loopy paths
1 parent 72724e5 commit 76afdef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

autonomous/auto_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ def tracking_trajectory(self, initial_call, state_tm) -> None:
101101
if self.current_leg > 0 and not self.injector_component.has_algae():
102102
self.reef_intake.intake()
103103

104-
if distance < self.DISTANCE_TOLERANCE and math.isclose(
105-
angle_error, 0.0, abs_tol=self.ANGLE_TOLERANCE
104+
if (
105+
distance < self.DISTANCE_TOLERANCE
106+
and math.isclose(angle_error, 0.0, abs_tol=self.ANGLE_TOLERANCE)
107+
and state_tm > self.trajectories[self.current_leg].get_total_time() / 2.0
106108
):
107109
# First leg is to score coral, then we run cycles of pick up -> shoot
108110
if self.current_leg == 0:

0 commit comments

Comments
 (0)