Skip to content

Commit 3072723

Browse files
slight adjustment to automatic intake
1 parent db7c3cc commit 3072723

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/frc/robot/subsystems/IntakeSubsystem.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class IntakeSubsystem(val motor0: SpeedController, val motor1: SpeedController)
3131
val ntInst = NetworkTableInstance.getDefault()
3232
val table = BallVision.ntInst.getTable("ball-vision")
3333
val ballHeight = BallVision.table.getEntry("ballHeight") // the height of the ball
34+
val ballFound = BallVision.table.getEntry("ballFound")
3435
}
3536

3637

@@ -69,6 +70,6 @@ class IntakeSubsystem(val motor0: SpeedController, val motor1: SpeedController)
6970
}
7071

7172
fun getRunningAutomatic(): Boolean {
72-
return ballHeight.getDouble(0.0) >= Constants.ballHeightForAutoIntake
73+
return ballFound.getBoolean(false) && ballHeight.getDouble(0.0) >= Constants.ballHeightForAutoIntake
7374
}
7475
}

0 commit comments

Comments
 (0)