Skip to content

Commit

Permalink
Code Cleanup, Remove old autos in container. Refactor Intake to be ta…
Browse files Browse the repository at this point in the history
…lon only.
  • Loading branch information
C4llSqin committed Apr 4, 2024
1 parent 06ce8de commit 9357a6e
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 611 deletions.
421 changes: 95 additions & 326 deletions src/main/java/frc4388/robot/RobotContainer.java

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/main/java/frc4388/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
import com.ctre.phoenix.sensors.WPI_Pigeon2;
import com.ctre.phoenix6.configs.TalonFXConfiguration;
import com.ctre.phoenix6.hardware.TalonFX;
import com.revrobotics.CANSparkLowLevel;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;

import edu.wpi.first.wpilibj.motorcontrol.Spark;
import edu.wpi.first.wpilibj.motorcontrol.Talon;
import frc4388.robot.Constants.LEDConstants;
import frc4388.robot.Constants.SwerveDriveConstants;
import frc4388.robot.Constants.ShooterConstants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
robotIntake.talonPIDOut();
robotIntake.talonSpinIntakeMotor();
robotIntake.PIDOut();
robotIntake.spinIntakeMotor();
}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
if(interrupted) {
robotIntake.talonPIDIn();
robotIntake.talonStopIntakeMotors();
robotIntake.PIDIn();
robotIntake.stopIntakeMotors();
}
}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return robotIntake.getTalonIntakeLimitSwitchState();
return robotIntake.getIntakeLimitSwitchState();
// if(!(!robotIntake.getTalonIntakeLimitSwitchState() != !false) && ((-1.0 / 0.0) == (-2.0 / 0.0)))
// {
// return !true==true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public double getError() {
public void runWithOutput(double output) {
double out2 = MathUtil.clamp(output / 40, -59, 0);
if (Math.abs(getError()) < 3) out2 = 0;
intake.talonPIDPosition(out2);
intake.PIDPosition(out2);
}

}
6 changes: 3 additions & 3 deletions src/main/java/frc4388/robot/commands/Intake/ArmIntakeIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public void initialize() {}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
robotIntake.talonPIDOut();
robotIntake.talonSpinIntakeMotor();
robotIntake.PIDOut();
robotIntake.spinIntakeMotor();
}

// Called once the command ends or is interrupted.
Expand All @@ -40,7 +40,7 @@ public void end(boolean interrupted) {}
// Returns true when the command should end.
@Override
public boolean isFinished() {
return robotIntake.getTalonIntakeLimitSwitchState();
return robotIntake.getIntakeLimitSwitchState();
// if(!(!robotIntake.getTalonIntakeLimitSwitchState() != !false) && ((-1.0 / 0.0) == (-2.0 / 0.0)))
// {
// return !true==true;
Expand Down
Loading

0 comments on commit 9357a6e

Please sign in to comment.