Skip to content

Commit 11c6252

Browse files
authored
Merge pull request #265 from thedropbears/fix-algae-intake
2 parents 981fa67 + 4e3dc33 commit 11c6252

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/injector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def __init__(self) -> None:
5555
self.desired_injector_voltage = 0.0
5656

5757
@feedback
58-
def has_algae(self) -> bool:
58+
def _algae_limit_switch_pressed(self) -> bool:
5959
return not self.algae_limit_switch.get()
6060

6161
@feedback
62-
def should_be_holding_algae(self) -> bool:
62+
def has_algae(self) -> bool:
6363
return self.has_seen_algae
6464

6565
def inject(self) -> None:
@@ -85,10 +85,10 @@ def get_injector_velocities(self) -> tuple[float, float]:
8585
)
8686

8787
def execute(self) -> None:
88-
if self.has_algae():
88+
if self._algae_limit_switch_pressed():
8989
self.has_seen_algae = True
9090

91-
if math.isclose(self.desired_injector_voltage, 0.0) and self.has_seen_algae:
91+
if math.isclose(self.desired_injector_voltage, 0.0) and self.has_algae():
9292
self.desired_injector_voltage = self.INJECTOR_BACKDRIVE_VOLTAGE
9393

9494
if self.should_measure:

0 commit comments

Comments
 (0)