Skip to content

Commit

Permalink
Merge pull request #21 from missfits/aishah/style-fixes
Browse files Browse the repository at this point in the history
Remove comments, remove variables that weren't being used in the code
  • Loading branch information
aishahnazar authored Aug 23, 2024
2 parents 893de6c + 8767c9c commit b906916
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/commands/ArcadeDriveCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import frc.robot.OI;
import frc.robot.Constants.OperatorConstants;

// import java.lang.Math.*;

public class ArcadeDriveCommand extends Command {
private final Drivetrain m_drivetrain;
Expand All @@ -27,7 +26,6 @@ public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
// double xJoy = filter.calculate(m_humanControl.getDriverXBoxLeftJoyY());
double xJoy = m_humanControl.getDriverXBoxLeftJoyY();

double yJoy = m_humanControl.getDriverXBoxRightJoyX();
Expand Down
28 changes: 1 addition & 27 deletions src/main/java/frc/robot/commands/AutoIntakeCommand.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package frc.robot.commands;

import edu.wpi.first.wpilibj.GenericHID.RumbleType;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Indexer;
import frc.robot.Constants.IndexerConstants;
Expand All @@ -16,47 +14,29 @@ public class AutoIntakeCommand extends Command {
private Indexer m_indexer;
private Intake m_intake;
private boolean beam_break = false;
private int count;
private XboxController pilot;
private XboxController copilot;

public AutoIntakeCommand(Indexer indexer, Intake intake){
m_indexer = indexer;
m_intake = intake;
addRequirements(indexer, intake);
count = 0;
// this.pilot = pilot;
// this.copilot = copilot;
}

@Override
public void initialize() {
beam_break = false;
// System.out.println("indexer intake COMMAND STARTED");
}

@Override
public void execute() {
// System.out.println("intake indexer command running :D");
// once the beam has been broken, switch flag to true and reset encoders on indexer
if (!m_indexer.getBeamBreak() && !beam_break) {
// System.out.println("beam break bool switched");



// //RUMBLE HERE
// pilot.setRumble(RumbleType.kLeftRumble, 1.0);
// copilot.setRumble(RumbleType.kRightRumble, 1.0);

//RUMBLE HERE
beam_break = true;
m_indexer.setEncoderPosition(0);
}

// System.out.println("Encoder value: " + m_indexer.getEncoderPosition());
if (beam_break) { // if the beam has been broken run the indexer down a bit
m_indexer.runIndexerMotor(IndexerConstants.INDEXER_MOTOR_REVERSE_SPEED);
count++;
// System.out.println("Backing up");
} else { // otherwise intake
m_indexer.runIndexerMotor(IndexerConstants.INDEXER_MOTOR_SPEED_UP);
m_intake.runIntakeMotor(IntakeConstants.INTAKE_MOTOR_SPEED_IN);
Expand All @@ -66,16 +46,10 @@ public void execute() {

@Override
public void end(boolean interrupted) {
// System.out.println("reverse speed: " + IndexerConstants.INDEXER_MOTOR_REVERSE_SPEED + ", distance: " + IndexerConstants.REVERSE_DISTANCE);
// System.out.println("final encoder val: " + m_indexer.getEncoderPosition());
// System.out.println("how many times the command has run backwards: " + count);
m_indexer.indexerOff();
m_intake.intakeOff();
m_indexer.setEncoderPosition(0);
beam_break = false;
// pilot.setRumble(RumbleType.kLeftRumble, 0.0);
// copilot.setRumble(RumbleType.kRightRumble, 0.0);
// System.out.println("Encoder: " + m_indexer.getEncoderPosition());
}

@Override
Expand Down

0 comments on commit b906916

Please sign in to comment.