diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 0df538a..1648721 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -131,40 +131,43 @@ public Robot() { .leftTrigger() .whileTrue(new ParallelRaceGroup(m_intake.intake(), m_shooter.Intake()).repeatedly()); + // this is here to make the value be editable on the dashboard + + SmartDashboard.putNumber("Intake/CurrentStopInput", 10); m_driverController .leftTrigger() - .whileTrue(new ParallelRaceGroup( - m_intake.intake(), - m_shooter.Intake()).repeatedly() - .until(() -> { - return m_shooter.getCurrent() > 10; - })); - + .whileTrue( + new ParallelRaceGroup(m_intake.intake(), m_shooter.Intake()) + .repeatedly() + .until( + () -> { + double defaultIntakeStopCurrent = 10; + return m_shooter.getCurrent() + > SmartDashboard.getNumber( + "Intake/CurrentStopInput", defaultIntakeStopCurrent); + })); } public Command SensorIntake() { final double defaultStopDistance = 35; - SmartDashboard.putNumber( - "StopDistance", defaultStopDistance); // this is here to make the value be editable on - // the dashboard + + // this is here to make the value be editable on the dashboard + SmartDashboard.putNumber("StopDistance", defaultStopDistance); return new ParallelRaceGroup( new RepeatCommand(m_intake.intake()), new RepeatCommand(m_shooter.Intake()) .until( () -> { - return mytimeofflight.getRange() <= SmartDashboard.getNumber("StopDistance", defaultStopDistance); + return mytimeofflight.getRange() + <= SmartDashboard.getNumber("StopDistance", defaultStopDistance); })); } /** - * This function is called every robot packet, no matter the mode. Use this for - * items like - * diagnostics that you want ran during disabled, autonomous, teleoperated and - * test. + * This function is called every robot packet, no matter the mode. Use this for items like + * diagnostics that you want ran during disabled, autonomous, teleoperated and test. * - *

- * This runs after the mode specific periodic functions, but before LiveWindow - * and + *

This runs after the mode specific periodic functions, but before LiveWindow and * SmartDashboard integrated updating. */ @Override @@ -172,6 +175,7 @@ public void robotPeriodic() { CommandScheduler.getInstance().run(); m_vision.periodic(); SmartDashboard.putNumber("Distance", mytimeofflight.getRange()); + SmartDashboard.putNumber("Intake/Current", m_shooter.getCurrent()); } @Override @@ -183,36 +187,28 @@ public void autonomousInit() { } @Override - public void autonomousPeriodic() { - } + public void autonomousPeriodic() {} @Override - public void teleopInit() { - } + public void teleopInit() {} @Override - public void teleopPeriodic() { - } + public void teleopPeriodic() {} @Override - public void disabledInit() { - } + public void disabledInit() {} @Override - public void disabledPeriodic() { - } + public void disabledPeriodic() {} @Override - public void testInit() { - } + public void testInit() {} @Override - public void testPeriodic() { - } + public void testPeriodic() {} @Override - public void simulationInit() { - } + public void simulationInit() {} @Override public void simulationPeriodic() { diff --git a/src/main/java/frc/robot/shooter/Shooter.java b/src/main/java/frc/robot/shooter/Shooter.java index 74e0fae..282c995 100644 --- a/src/main/java/frc/robot/shooter/Shooter.java +++ b/src/main/java/frc/robot/shooter/Shooter.java @@ -16,7 +16,7 @@ public class Shooter extends SubsystemBase { - private final double InSpeed = -.4; + private final double InSpeed = -1; private final double OutSpeed = .4; private final double StopSpeed = 0; private double defaultDelay = .3; @@ -84,7 +84,7 @@ public Command ShooterDelay() { new RepeatCommand( new InstantCommand( () -> { - feeder.set(OutSpeed); + feeder.set(InSpeed); }))); } @@ -97,8 +97,7 @@ public Command Feeder() { .repeatedly(); } - public double getCurrent(){ + public double getCurrent() { return feeder.getTorqueCurrent().getValue(); - } }