-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
5,354 additions
and
5,226 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/org/codeorange/frc2024/auto/actions/ShootFromStow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.codeorange.frc2024.auto.actions; | ||
|
||
import edu.wpi.first.wpilibj.Timer; | ||
import org.codeorange.frc2024.robot.Robot; | ||
import org.codeorange.frc2024.subsystem.Superstructure; | ||
import org.codeorange.frc2024.subsystem.intake.Intake; | ||
import org.codeorange.frc2024.subsystem.shooter.Shooter; | ||
|
||
public class ShootFromStow implements BaseAction { | ||
private final Superstructure superstructure = Superstructure.getSuperstructure(); | ||
private final Shooter shooter = Robot.getShooter(); | ||
private final Intake intake = Robot.getIntake(); | ||
private final Timer timer = new Timer(); | ||
private final double angle; | ||
|
||
public ShootFromStow(double angle) { | ||
this.angle = angle; | ||
} | ||
|
||
public ShootFromStow() { | ||
this.angle = 54; | ||
} | ||
|
||
@Override | ||
public void start() { | ||
superstructure.isFlipped = false; | ||
if(intake.hasNote()) { | ||
superstructure.setGoalState(Superstructure.States.SPEAKER); | ||
} | ||
intake.stop(); | ||
superstructure.wantedAngle = angle; | ||
timer.stop(); | ||
timer.reset(); | ||
} | ||
|
||
@Override | ||
public void update() { | ||
if(superstructure.getCurrentState().isAtWantedState() && superstructure.isAtGoalState() && shooter.isAtTargetVelocity()) { | ||
intake.runIntakeForShooter(); | ||
} | ||
if(!intake.hasNote()) { | ||
timer.start(); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return timer.hasElapsed(0.3); | ||
} | ||
|
||
public void done() { | ||
intake.stop(); | ||
superstructure.wantedAngle = 54; | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/org/codeorange/frc2024/auto/routines/DoNothing.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package org.codeorange.frc2024.auto.routines; | ||
|
||
import org.codeorange.frc2024.auto.AutoEndedException; | ||
import org.codeorange.frc2024.auto.actions.Shoot; | ||
import org.codeorange.frc2024.auto.actions.ShootFromGround; | ||
|
||
public class DoNothing extends BaseRoutine { | ||
@Override | ||
protected void routine() throws AutoEndedException { | ||
runAction(new Shoot(54)); | ||
runAction(new ShootFromGround(54)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters