generated from Team488/FRCRobotTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Started ShooterFireCommand * Fixed if statement * Removed unnecessary log statement * End of day commit 2/3/2024 Fixed CollectorSubsystem and ShooterFireCommand, not done. * Done with FireWhenReadyCommand and cleaned up CollectorSub
- Loading branch information
1 parent
be0b1e1
commit 22b0cd6
Showing
2 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
src/main/java/competition/subsystems/shooter/commands/FireWhenReadyCommand.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,38 @@ | ||
package competition.subsystems.shooter.commands; | ||
|
||
import competition.subsystems.arm.ArmSubsystem; | ||
import competition.subsystems.collector.CollectorSubsystem; | ||
import competition.subsystems.shooter.ShooterWheelSubsystem; | ||
import xbot.common.command.BaseCommand; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class FireWhenReadyCommand extends BaseCommand { | ||
final ShooterWheelSubsystem wheel; | ||
final ArmSubsystem arm; | ||
final CollectorSubsystem collector; | ||
|
||
@Inject | ||
public FireWhenReadyCommand(ShooterWheelSubsystem wheel, ArmSubsystem arm, CollectorSubsystem collector) { | ||
this.wheel = wheel; | ||
this.arm = arm; | ||
this.collector = collector; | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
log.info("Initializing..."); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
/* WE CANNOT CHECK IF CURRENT VALUE OF WHEEL AND TARGET VALUE ARE EXACTLY THE SAME, THAT IS WHY WE | ||
HAVE THE TOLERANCE PROPERTIES IN THE FIRST PLACE | ||
RUNS 50 TIMES A SECOND | ||
*/ | ||
if (wheel.isMaintainerAtGoal() && arm.isMaintainerAtGoal()) { | ||
collector.fire(); | ||
} | ||
} | ||
} |