Skip to content

Commit

Permalink
Got index working, purged charge for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Fruggg committed Mar 15, 2024
1 parent e3dbf39 commit e1a7674
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class RobotContainer {

private final IntakeCommandGroup intakeGroup = new IntakeCommandGroup(index, intake);
private final IntakeRevCommandGroup intakeRevGroup = new IntakeRevCommandGroup(index, intake);
ChargeIntakeCommand chargeIntake = new ChargeIntakeCommand(drivetrain, intake, driveRequest);
// ChargeIntakeCommand chargeIntake = new ChargeIntakeCommand(drivetrain, intake, driveRequest);

/* Autonomous Chooser */
SendableChooser<Command> autoChooser;
Expand Down Expand Up @@ -131,7 +131,7 @@ public static boolean isAllianceRed() {

/* Method to configure the button bindings */
private void configureBindings() {

index.setDefaultCommand(index.run(() -> index.SetPower(0)));
driveRequest = drive.withVelocityX(-m_driverController.getLeftY() * MaxSpeed)
.withVelocityY(-m_driverController.getLeftX() * MaxSpeed) // Drive left with negative X (left)
.withRotationalRate(-m_driverController.getRightX() * MaxAngularRate) // Drive counterclockwise with
Expand Down Expand Up @@ -195,9 +195,10 @@ public void DebugMethodSingle() {

// #endregion Testing
}


public Command getAutonomousCommand() {
return autoChooser.getSelected();
}
}

} // End of class
27 changes: 27 additions & 0 deletions src/main/java/frc/robot/commands/IncrementIndex.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package frc.robot.commands;

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

public class IncrementIndex extends Command {

IndexSubsystem indexer;

public IncrementIndex(IndexSubsystem indexer) {
this.indexer = indexer;

addRequirements(indexer);
}

@Override
public void execute() {
indexer.SetPower(-0.1);
}

@Override
public boolean isFinished() {
// Check if there is no note loaded. i.e. HasCargo() returns false
return !indexer.HasCargo();
}

}
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/RevAndShootCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public class RevAndShootCommand extends SequentialCommandGroup {
IndexSubsystem indexer;
ShooterSubsystemVelocity shooter;
// component Commands
// private IncrementIndex outtaMyWay;
private IncrementIndex outtaMyWay;
private Command revUpShooter;
private Command indexCommand;

public RevAndShootCommand(IndexSubsystem indexer) {
// Set up our subsystems
this.indexer = indexer;
// outtaMyWay = new IncrementIndex(indexer);
outtaMyWay = new IncrementIndex(indexer);
}


Expand Down

0 comments on commit e1a7674

Please sign in to comment.