Skip to content

Commit

Permalink
fix: don't do auto intake in teleop
Browse files Browse the repository at this point in the history
  • Loading branch information
Craftzman7 committed Jun 13, 2024
1 parent f11b5e2 commit 16a3373
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/main/java/com/frcteam3636/frc2024/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ object Robot : LoggedRobot() {
Commands.sequence(
Commands.parallel(
Shooter.Pivot.pivotAndStop(Shooter.Pivot.Target.STOWED.profile.position()),
doIntakeSequence()
doIntakeAutoSequence()
),
Commands.parallel(
Shooter.Pivot.followMotionProfile(Shooter.Pivot.Target.AIM),
Expand Down Expand Up @@ -323,7 +323,7 @@ fun autoIntake(): Command =
)
).withTimeout(1.5)

private fun doIntakeSequence(): Command =
private fun doIntakeAutoSequence(): Command =
Commands.sequence(
Commands.waitUntil(Shooter.Pivot.isStowed),
autoIntake(),
Expand All @@ -332,6 +332,31 @@ private fun doIntakeSequence(): Command =
}
)

private fun doIntakeSequence(): Command =
Commands.sequence(
Intake.intake(),
Commands.runOnce({ Note.state = Note.State.HANDOFF }),
Commands.waitUntil(Shooter.Pivot.isStowed),
Commands.race(
Commands.parallel(
Intake.index(),
Shooter.Feeder.intake(),
Shooter.Flywheels.intake(),
),
Commands.sequence(
//spinning up
Commands.waitUntil { Shooter.Flywheels.aboveIntakeThreshold },
//reached velocity setpoint
Commands.waitUntil { !Shooter.Flywheels.aboveIntakeThreshold },
//contacted note
Commands.waitUntil { Shooter.Flywheels.aboveIntakeThreshold },
//note stowed
Commands.waitUntil(Trigger { !Shooter.Flywheels.aboveIntakeThreshold }),
Commands.runOnce({ Note.state = Note.State.SHOOTER })
)
)
)

object Note {
enum class State(val index: Long) {
NONE(0),
Expand Down

0 comments on commit 16a3373

Please sign in to comment.