From 9c85cd1c8a7a86d8d42eb6c678f6ce473f736f64 Mon Sep 17 00:00:00 2001 From: TheRealGrayden Date: Mon, 13 Apr 2026 19:57:27 -0400 Subject: [PATCH] command changes --- src/main/java/frc/robot/RobotContainer.java | 14 ++---- src/main/java/frc/robot/commands/Reverse.java | 50 +++++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 src/main/java/frc/robot/commands/Reverse.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index d6d68cd..3a9f8cf 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -13,9 +13,6 @@ import frc.robot.Constants.OperatorConstants; import frc.robot.commands.AutoShootCommandChassisTurret; import frc.robot.commands.AutoShootCommandChassisTurretPathPlanner; import frc.robot.commands.AutoTurretCommand; -import frc.robot.commands.RelayCommand; -import frc.robot.commands.SetDeflectorCommand; -import frc.robot.commands.ZoneCheck; import frc.robot.subsystems.DriveSubsystem; import frc.robot.subsystems.HopperSubsystem; import frc.robot.subsystems.IntakeSubsystem; @@ -72,21 +69,20 @@ public class RobotContainer { * */ private void configureBindings() { - m_driverController.povDown().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE)); + /*m_driverController.povDown().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_STORED_ANGLE)); m_driverController.povLeft().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE1)); m_driverController.povRight().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE3)); - m_driverController.povUp().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE2)); + m_driverController.povUp().onTrue(new SetDeflectorCommand(turretSubsystem, Constants.ShooterConstants.DEFLECTOR_SET_ANGLE2));*/ m_driverController.back().whileTrue(new AutoShootCommandChassisTurretPathPlanner(driveSubsystem, hopperSubsystem, turretSubsystem)); - //m_driverController.a().whileTrue(new AutoShootCommandChassisTurretPathPlanner(driveSubsystem, hopperSubsystem, turretSubsystem)); - // m_driverController:wa.a().whileTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem)); m_driverController.leftBumper().onTrue(Commands.runOnce(() -> turretSubsystem.homeTurret(), turretSubsystem)); m_driverController.rightBumper().onTrue(Commands.parallel(intakeSubsystem.intake())); - m_driverController.y().whileTrue(new RelayCommand(hopperSubsystem, turretSubsystem, intakeSubsystem)); + //m_driverController.y().whileTrue(new RelayCommand(hopperSubsystem, turretSubsystem, intakeSubsystem)); m_driverController.start().whileTrue(intakeSubsystem.resetDeploy()); m_driverController.x().whileTrue(new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem)); - m_driverController.b().toggleOnTrue(new ZoneCheck(driveSubsystem)); + m_driverController.b().onTrue(Commands.parallel(intakeSubsystem.reverseIntake(), null)); + m_driverController.y().onTrue(intakeSubsystem.deploy()); } /** diff --git a/src/main/java/frc/robot/commands/Reverse.java b/src/main/java/frc/robot/commands/Reverse.java new file mode 100644 index 0000000..cb3bb66 --- /dev/null +++ b/src/main/java/frc/robot/commands/Reverse.java @@ -0,0 +1,50 @@ +// 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.HopperSubsystem; +import frc.robot.subsystems.IntakeSubsystem; + +/** + * An example command that uses an example subsystem. + */ +public class Reverse extends Command { + + private int m_subsystem; + + /** + * Creates a new ExampleCommand. + * + * @param subsystem The subsystem used by this command. + */ + public Reverse() { + m_subsystem = subsystem; + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(subsystem); + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + hopperSubsystem.stopKicker(); + hopperSubsystem.spindexerOff(); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +}