Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
import edu.wpi.first.wpilibj2.command.Commands;
import frc.robot.commands.IntakeGround;
import frc.robot.commands.PrepShooter;
import frc.robot.commands.StageGP;
import frc.robot.commands.intakeHopper;
import frc.robot.subsystems.Hopper;
import frc.robot.subsystems.Intake;
import frc.robot.subsystems.Shooter;
import frc.robot.subsystems.Stager;

public class RobotContainer {
private final SN_XboxController m_driverController = new SN_XboxController(1);
private final Intake subIntake = new Intake();
private final Hopper subHopper = new Hopper();
private final Shooter subShooter = new Shooter();
private final Stager subStager = new Stager();
private final IntakeGround com_IntakeGround = new IntakeGround(subIntake, subHopper);
private final PrepShooter com_PrepShooter = new PrepShooter(subShooter);
private final StageGP com_StageGP = new StageGP(subStager);

public RobotContainer() {
configureBindings();
Expand All @@ -32,7 +36,7 @@ private void configureBindings() {
m_driverController.btn_B.whileTrue(com_IntakeGround);
m_driverController.btn_LeftBumper.whileTrue(new intakeHopper(subHopper));
m_driverController.btn_X.onTrue(com_PrepShooter);

m_driverController.btn_A.whileTrue(com_StageGP);
}

public Command getAutonomousCommand() {
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/frc/robot/commands/StageGP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Stager;

public class StageGP extends Command {
/** Creates a new StageGP. */
Stager globalStager;

public StageGP(Stager passedStager) {
// Use addRequirements() here to declare subsystem dependencies.
globalStager = passedStager;
}

// Called when the command is initially scheduled.
@Override
public void initialize() {
globalStager.setConveyorMotorVelocity(0.3);
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if (globalStager.getIsGPStaged()) {
globalStager.setConveyorMotorVelocity(0);
} else {
globalStager.setConveyorMotorVelocity(0.3);
}
}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
globalStager.setConveyorMotorVelocity(0);
}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}
Loading