From b10b523dcfb81dd57fff33b3350647a20454cec2 Mon Sep 17 00:00:00 2001 From: Anay Nagar Date: Fri, 4 Oct 2024 22:23:11 -0700 Subject: [PATCH 01/12] in an ideal world servos would servo and i would sleep --- src/main/java/frc/robot/RobotContainer.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2c4b878..671c2f9 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -12,6 +12,7 @@ import edu.wpi.first.math.MathUtil; import edu.wpi.first.wpilibj.DriverStation; +import edu.wpi.first.wpilibj.Servo; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj.XboxController.Button; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; @@ -62,6 +63,8 @@ public class RobotContainer { private final SendableChooser autoChooser; + private final Servo m_ampServo = new Servo(1); + /** * The container for the robot. Contains subsystems, IO devices, and commands. */ @@ -200,6 +203,12 @@ private void configureBindings() { new ParallelDeadlineGroup(new WaitCommand(1), new NoteOuttakeCommand(m_intakeSubsystem)))) .onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)); + new JoystickButton(m_driverController, Button.kA.value) + .onTrue(new InstantCommand(() -> m_ampServo.setAngle(90))); + + new JoystickButton(m_driverController, Button.kB.value) + .onTrue(new InstantCommand(() -> m_ampServo.setAngle(0))); + new JoystickButton(m_driverController, Button.kRightBumper.value) .onTrue(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Amp)) .onFalse(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted)); @@ -219,6 +228,10 @@ private void configureBindings() { return m_operatorController.getRightTriggerAxis() > 0.5; }).whileTrue(new NoteOuttakeCommand(m_intakeSubsystem)); + new Trigger(() -> { + return m_operatorController.getAButton() && !m_operatorController.getRightBumper(); + }).onTrue(new InstantCommand(() -> m_shooterSubsystem.setShootingSpeed(ShootSpeed.Amp))).onFalse(new InstantCommand(() -> m_shooterSubsystem.setShootingSpeed(ShootSpeed.Off))); + // Amp Outtake, Operator Controller X Button new JoystickButton(m_operatorController, Button.kX.value) .whileTrue(new AmpOuttakeCommand(m_intakeSubsystem)); From d084d2806603c856faa17a0383e45e08204e2a92 Mon Sep 17 00:00:00 2001 From: Anay Nagar Date: Fri, 4 Oct 2024 23:58:13 -0700 Subject: [PATCH 02/12] For the brave souls who get this far: You are the chosen ones, the valiant knights of programming who toil away, without rest, fixing our most awful code. To you, true saviors, kings of men, I say this: never gonna give you up, never gonna let you down, never gonna run around and desert you. Never gonna make you cry, never gonna say goodbye. Never gonna tell a lie and hurt you. --- src/main/java/frc/robot/RobotContainer.java | 9 ++++ .../frc/robot/subsystems/ServoSubsystem.java | 54 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/ServoSubsystem.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 671c2f9..e9bc6da 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -38,6 +38,7 @@ import frc.robot.subsystems.DriveSubsystem; import frc.robot.subsystems.IntakeSubsystem; import frc.robot.subsystems.LEDSubsystem; +import frc.robot.subsystems.ServoSubsystem; import frc.robot.subsystems.IntakeSubsystem.ArmPosition; import frc.robot.subsystems.ShooterSubsystem; import frc.robot.subsystems.ShooterSubsystem.ShootSpeed; @@ -58,6 +59,8 @@ public class RobotContainer { private final VisionSubsystem m_visionSubsystem = new VisionSubsystem(); private final LEDSubsystem m_ledSubsystem = new LEDSubsystem(); +// private final ServoSubsystem m_servoSubsystem = new ServoSubsystem(); + private final XboxController m_driverController = new XboxController(IOConstants.kDriverControllerPort); private final XboxController m_operatorController = new XboxController(IOConstants.kOperatorControllerPort); @@ -206,9 +209,15 @@ private void configureBindings() { new JoystickButton(m_driverController, Button.kA.value) .onTrue(new InstantCommand(() -> m_ampServo.setAngle(90))); + // new JoystickButton(m_driverController, Button.kA.value) + // .onTrue(new InstantCommand(() -> m_servoSubsystem.setPulseWidth(2500))); + new JoystickButton(m_driverController, Button.kB.value) .onTrue(new InstantCommand(() -> m_ampServo.setAngle(0))); + // new JoystickButton(m_driverController, Button.kB.value) + // .onTrue(new InstantCommand(() -> m_servoSubsystem.setPulseWidth(1500))); + new JoystickButton(m_driverController, Button.kRightBumper.value) .onTrue(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Amp)) .onFalse(new IntakeArmPositionCommand(m_intakeSubsystem, ArmPosition.Retracted)); diff --git a/src/main/java/frc/robot/subsystems/ServoSubsystem.java b/src/main/java/frc/robot/subsystems/ServoSubsystem.java new file mode 100644 index 0000000..5efc727 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/ServoSubsystem.java @@ -0,0 +1,54 @@ +// 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.subsystems; + +import edu.wpi.first.wpilibj.PWM; +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +/** + * Currently this subsystem is just in case anything goes wrong with the normal, default Servo + * implementation in WPILib because the servo we have might not work with that pulse length + * + * current stats of MG995 servo: + * 4.8 to 7.2 V power and signal + * 20ms (50 Hz) PWM period + * 5 microsecond dead band width + * Rotate about 120 degrees (60 in each direction) + * + * + * different source claims that it "provides a running angle of about 180 degrees over a servo + * pulse range of 600 us to 2400 us" + * + * studica claims pulse width range of 500 to 250 us with a neutral position of 1500 us and a + * dead band width of 4 us + * + * another source: https://components101.com/motors/mg995-servo-motor + * + * WATCH OUT FOR MS VS US + * a cycle for the servo has to be 20ms (50 Hz) so a pulse width of 1500 us would be 1.5 ms + */ +public class ServoSubsystem extends SubsystemBase { + + private PWM m_iloveservos = new PWM(1); + + private int m_pulseWidth = 1500; + + /** Creates a new ServoSubsystem. */ + public ServoSubsystem() { + m_iloveservos.setBoundsMicroseconds(20000, 2500, 1500, 500, 20000); + // m_iloveservos.setB + } + + @Override + public void periodic() { + // This method will be called once per scheduler run + m_iloveservos.setPulseTimeMicroseconds(m_pulseWidth); + } + + /** Set pulse width in MICROSECONDS (us) */ + public void setPulseWidth(int pulseWidth) { + m_pulseWidth = pulseWidth; + } +} From 498e2c1b568058f5a7f01ad9caf8ae4803372862 Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Sat, 5 Oct 2024 18:44:11 -0700 Subject: [PATCH 03/12] bordie day 1 --- src/main/java/frc/robot/Constants.java | 2 +- src/main/java/frc/robot/RobotContainer.java | 17 +++++- .../robot/subsystems/ClimberSubsystem.java | 55 ++++++++++--------- .../frc/robot/subsystems/IntakeSubsystem.java | 13 +++++ 4 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 481626e..e0f4b74 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -106,7 +106,7 @@ public static final class IntakeConstants { public static final double kIntakeAmpScoringAngle = -71; // 193 - 100 (previous angle) /** Encoder offset in rotations */ - public static final double kArmEncoderOffset = 0.715; + public static final double kArmEncoderOffset = 0.259; public static final double kIntakeSpeed = 0.5; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index e9bc6da..fbd1824 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -207,13 +207,26 @@ private void configureBindings() { .onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)); new JoystickButton(m_driverController, Button.kA.value) - .onTrue(new InstantCommand(() -> m_ampServo.setAngle(90))); + .onTrue(new InstantCommand(() -> m_ampServo.setAngle(135))); + + new JoystickButton(m_driverController, Button.kY.value) + .onTrue(new InstantCommand(() -> { + m_intakeSubsystem.getCurrentCommand().cancel(); + m_intakeSubsystem.resetArmEncoder(); + DriverStation.reportError("reset intake in", false); + })); + + // new JoystickButton(m_driverController, Button.kX.value) + // .onTrue(new InstantCommand(() -> { + // // m_intakeSubsystem.getCurrentCommand().cancel(); + // DriverStation.reportError("reset intake out", false); + // })); // new JoystickButton(m_driverController, Button.kA.value) // .onTrue(new InstantCommand(() -> m_servoSubsystem.setPulseWidth(2500))); new JoystickButton(m_driverController, Button.kB.value) - .onTrue(new InstantCommand(() -> m_ampServo.setAngle(0))); + .onTrue(new InstantCommand(() -> m_ampServo.setAngle(-20))); // new JoystickButton(m_driverController, Button.kB.value) // .onTrue(new InstantCommand(() -> m_servoSubsystem.setPulseWidth(1500))); diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index cc211db..6eed73a 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -13,72 +13,73 @@ import frc.robot.Constants.ClimberConstants; public class ClimberSubsystem extends SubsystemBase { - private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); - private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); - private PneumaticHub m_pHub; + // private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + // ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); + // private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + // ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); + // private PneumaticHub m_pHub; - private boolean m_compressorEnabled; + // private boolean m_compressorEnabled; - private Value m_state; + // private Value m_state; public ClimberSubsystem() { - m_pHub = new PneumaticHub(2); + // m_pHub = new PneumaticHub(2); - solenoidOff(); + // solenoidOff(); - m_compressorEnabled = false; + // m_compressorEnabled = false; } // Runs once every tick (~20ms) public void periodic() { - m_leftSolenoid.set(m_state); - m_rightSolenoid.set(m_state); - SmartDashboard.putString("pneumatics state", m_state.name()); - SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); - SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); - SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); + // m_leftSolenoid.set(m_state); + // m_rightSolenoid.set(m_state); + // SmartDashboard.putString("pneumatics state", m_state.name()); + // SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); + // SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); + // SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); } public void reset() { - m_state = kOff; + // m_state = kOff; } /** * Sets the state of the solenoid to off */ public void solenoidOff() { - m_state = kOff; + // m_state = kOff; } /** * Extends both arms */ public void forward() { - m_state = kForward; + // m_state = kForward; } /** * Retracts both arms */ public void reverse() { - m_state = kReverse; + // m_state = kReverse; } public Value getState(){ - return m_state; + // return m_state; + return Value.kOff; } /** * Toggles the state of the compressor (on/off) */ public void toggleCompressor() { - m_compressorEnabled = !m_compressorEnabled; - if (m_compressorEnabled) { - m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); - } else { - m_pHub.disableCompressor(); - } + // m_compressorEnabled = !m_compressorEnabled; + // if (m_compressorEnabled) { + // m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); + // } else { + // m_pHub.disableCompressor(); + // } } } diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index a0a33dd..e0b61b3 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -155,4 +155,17 @@ public static enum ArmPosition { public void colorSensorToggle() { m_colorSensorToggle = !m_colorSensorToggle; } + + /** honestly its been a rough day i dont care enough + * + * yolo + */ + public void resetArmEncoder() { + m_armEncoder = new DutyCycleEncoder(IntakeConstants.kArmEncoderChannel); + + m_armEncoder.setPositionOffset(IntakeConstants.kArmEncoderOffset); + m_armEncoder.setDistancePerRotation(360); + + m_armSetpoint = m_armEncoder.getDistance(); + } } From 1bb831c7ad9e886cf76c49f454f0f96bee1021bc Mon Sep 17 00:00:00 2001 From: Anay Nagar Date: Sun, 6 Oct 2024 00:03:35 -0700 Subject: [PATCH 04/12] who decided giving me access to github was a good idea --- src/main/java/frc/robot/Constants.java | 2 +- src/main/java/frc/robot/RobotContainer.java | 21 ++++++++++++--- .../frc/robot/subsystems/IntakeSubsystem.java | 26 ++++++++++++++++--- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index e0f4b74..750c12d 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -106,7 +106,7 @@ public static final class IntakeConstants { public static final double kIntakeAmpScoringAngle = -71; // 193 - 100 (previous angle) /** Encoder offset in rotations */ - public static final double kArmEncoderOffset = 0.259; + public static double kArmEncoderOffset = 0.259; public static final double kIntakeSpeed = 0.5; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index fbd1824..2a8cd03 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -206,9 +206,10 @@ private void configureBindings() { new ParallelDeadlineGroup(new WaitCommand(1), new NoteOuttakeCommand(m_intakeSubsystem)))) .onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)); - new JoystickButton(m_driverController, Button.kA.value) - .onTrue(new InstantCommand(() -> m_ampServo.setAngle(135))); + // new JoystickButton(m_driverController, Button.kA.value) + // .onTrue(new InstantCommand(() -> m_ampServo.setAngle(135))); + // i need some more sleep new JoystickButton(m_driverController, Button.kY.value) .onTrue(new InstantCommand(() -> { m_intakeSubsystem.getCurrentCommand().cancel(); @@ -216,6 +217,18 @@ private void configureBindings() { DriverStation.reportError("reset intake in", false); })); + // soft reset, should stop driving + new JoystickButton(m_driverController, Button.kA.value) + .onTrue(new InstantCommand(() -> m_intakeSubsystem.reset())); + + // slightly harder reset + new JoystickButton(m_driverController, Button.kB.value) + .onTrue(new InstantCommand(() -> m_intakeSubsystem.resetHard())); + + // i better run + new JoystickButton(m_driverController, Button.kX.value) + .onTrue(new InstantCommand(() -> m_intakeSubsystem.daveImSorry())); + // new JoystickButton(m_driverController, Button.kX.value) // .onTrue(new InstantCommand(() -> { // // m_intakeSubsystem.getCurrentCommand().cancel(); @@ -225,8 +238,8 @@ private void configureBindings() { // new JoystickButton(m_driverController, Button.kA.value) // .onTrue(new InstantCommand(() -> m_servoSubsystem.setPulseWidth(2500))); - new JoystickButton(m_driverController, Button.kB.value) - .onTrue(new InstantCommand(() -> m_ampServo.setAngle(-20))); + // new JoystickButton(m_driverController, Button.kB.value) + // .onTrue(new InstantCommand(() -> m_ampServo.setAngle(-20))); // new JoystickButton(m_driverController, Button.kB.value) // .onTrue(new InstantCommand(() -> m_servoSubsystem.setPulseWidth(1500))); diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index e0b61b3..ca54034 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -58,6 +58,24 @@ public void reset() { m_armSetpoint = getArmPosition(); } + /** + * what time is it! + * + * + * + * bed time + */ + public void resetHard() { + reset(); + + m_armEncoder.reset(); + } + + /** just play some hans zimmer and hope he gets distracted */ + public void daveImSorry() { + IntakeConstants.kArmEncoderOffset = m_armEncoder.getAbsolutePosition(); + } + public void setArmPosition(ArmPosition position) { m_armPosition = position; switch (position) { @@ -161,11 +179,11 @@ public void colorSensorToggle() { * yolo */ public void resetArmEncoder() { - m_armEncoder = new DutyCycleEncoder(IntakeConstants.kArmEncoderChannel); + // m_armEncoder = new DutyCycleEncoder(IntakeConstants.kArmEncoderChannel); - m_armEncoder.setPositionOffset(IntakeConstants.kArmEncoderOffset); - m_armEncoder.setDistancePerRotation(360); + // m_armEncoder.setPositionOffset(IntakeConstants.kArmEncoderOffset); + // m_armEncoder.setDistancePerRotation(360); - m_armSetpoint = m_armEncoder.getDistance(); + // m_armSetpoint = m_armEncoder.getDistance(); } } From bc59919f3b388a1ff6bd653f7d3085a6bbc50e19 Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Mon, 7 Oct 2024 16:44:54 -0700 Subject: [PATCH 05/12] Bordie Day 2 changes - I am still the only programmer... --- .../pathplanner/autos/1-AmpSide-Leave.auto | 6 ++++++ .../pathplanner/autos/4-Center-Stays.auto | 6 ++++++ .../pathplanner/paths/Middle5thNote.path | 8 ++++---- .../pathplanner/paths/MoveOut-Left.path | 20 +++++++++---------- src/main/java/frc/robot/Constants.java | 2 +- src/main/java/frc/robot/RobotContainer.java | 8 +++++++- .../frc/robot/subsystems/IntakeSubsystem.java | 13 ++++++++++++ 7 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto b/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto index ae003cf..b83e34c 100644 --- a/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto +++ b/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto @@ -11,6 +11,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Intake in" + } + }, { "type": "named", "data": { diff --git a/src/main/deploy/pathplanner/autos/4-Center-Stays.auto b/src/main/deploy/pathplanner/autos/4-Center-Stays.auto index 7d849f7..2964dc9 100644 --- a/src/main/deploy/pathplanner/autos/4-Center-Stays.auto +++ b/src/main/deploy/pathplanner/autos/4-Center-Stays.auto @@ -11,6 +11,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Intake in" + } + }, { "type": "named", "data": { diff --git a/src/main/deploy/pathplanner/paths/Middle5thNote.path b/src/main/deploy/pathplanner/paths/Middle5thNote.path index 3fd72f1..cd26d17 100644 --- a/src/main/deploy/pathplanner/paths/Middle5thNote.path +++ b/src/main/deploy/pathplanner/paths/Middle5thNote.path @@ -16,12 +16,12 @@ }, { "anchor": { - "x": 8.0, - "y": 0.75 + "x": 7.96240792481585, + "y": 0.5130810261620535 }, "prevControl": { - "x": 7.0, - "y": 0.75 + "x": 6.96240792481585, + "y": 0.5130810261620535 }, "nextControl": null, "isLocked": false, diff --git a/src/main/deploy/pathplanner/paths/MoveOut-Left.path b/src/main/deploy/pathplanner/paths/MoveOut-Left.path index 014b5a9..2177a8c 100644 --- a/src/main/deploy/pathplanner/paths/MoveOut-Left.path +++ b/src/main/deploy/pathplanner/paths/MoveOut-Left.path @@ -16,28 +16,28 @@ }, { "anchor": { - "x": 3.45, - "y": 7.5 + "x": 2.157262600239487, + "y": 8.004064008128015 }, "prevControl": { - "x": 1.9500000000000002, - "y": 7.5 + "x": 0.6572626002394868, + "y": 8.004064008128015 }, "nextControl": { - "x": 4.950000000000003, - "y": 7.5 + "x": 3.6572626002394935, + "y": 8.004064008128015 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 7.0, - "y": 7.5 + "x": 7.1268188250662226, + "y": 7.81349105555354 }, "prevControl": { - "x": 6.0, - "y": 7.5 + "x": 6.1268188250662226, + "y": 7.81349105555354 }, "nextControl": null, "isLocked": false, diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 750c12d..09e625f 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -98,7 +98,7 @@ public static final class DriveConstants { public static final class IntakeConstants { public static final int kIntakeMotorID = 25; public static final int kArmMotorID = 39; - public static final int kArmEncoderChannel = 0; + public static final int kArmEncoderChannel = 1; // In degrees public static final double kIntakeLoweredAngle = -193; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 2a8cd03..52e7e47 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -218,8 +218,11 @@ private void configureBindings() { })); // soft reset, should stop driving + // new JoystickButton(m_driverController, Button.kA.value) + // .onTrue(new InstantCommand(() -> m_intakeSubsystem.reset())); + new JoystickButton(m_driverController, Button.kA.value) - .onTrue(new InstantCommand(() -> m_intakeSubsystem.reset())); + .onTrue(new InstantCommand(() -> m_intakeSubsystem.resetEvenHarder())); // slightly harder reset new JoystickButton(m_driverController, Button.kB.value) @@ -229,6 +232,9 @@ private void configureBindings() { new JoystickButton(m_driverController, Button.kX.value) .onTrue(new InstantCommand(() -> m_intakeSubsystem.daveImSorry())); + new JoystickButton(m_driverController, Button.kBack.value) + .onTrue(new InstantCommand(() -> m_intakeSubsystem.heCantKillMeTwice())); + // new JoystickButton(m_driverController, Button.kX.value) // .onTrue(new InstantCommand(() -> { // // m_intakeSubsystem.getCurrentCommand().cancel(); diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index ca54034..135bd94 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -71,11 +71,24 @@ public void resetHard() { m_armEncoder.reset(); } + public void resetEvenHarder() { + reset(); + + // m_armEncoder.reset(); + m_armEncoder.setPositionOffset(0.7); + // m_armEncoder.reset(); + } + /** just play some hans zimmer and hope he gets distracted */ public void daveImSorry() { IntakeConstants.kArmEncoderOffset = m_armEncoder.getAbsolutePosition(); } + /** i wish i was at the hans zimmer concert rn */ + public void heCantKillMeTwice() { + IntakeConstants.kArmEncoderOffset = m_armEncoder.getAbsolutePosition() - IntakeConstants.kIntakeLoweredAngle; + } + public void setArmPosition(ArmPosition position) { m_armPosition = position; switch (position) { From ea72825b3410c3689ef626ae8a00ac8f3335bbb5 Mon Sep 17 00:00:00 2001 From: Anay Nagar Date: Mon, 7 Oct 2024 23:12:21 -0700 Subject: [PATCH 06/12] just thought it was worth mentioning that pressing Y on the driver controller caused the robot code to crash without an error message --- src/main/java/frc/robot/subsystems/IntakeSubsystem.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 135bd94..cc3f6e4 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -71,6 +71,7 @@ public void resetHard() { m_armEncoder.reset(); } + /** CS swears the problem isnt their fault yet here I am */ public void resetEvenHarder() { reset(); @@ -192,6 +193,7 @@ public void colorSensorToggle() { * yolo */ public void resetArmEncoder() { + // Double initalizing the encoder crashes the code // m_armEncoder = new DutyCycleEncoder(IntakeConstants.kArmEncoderChannel); // m_armEncoder.setPositionOffset(IntakeConstants.kArmEncoderOffset); From 4cb3aa49944d8a5f8e76b7295f5f02dbd09b7ad6 Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Wed, 9 Oct 2024 17:23:41 -0700 Subject: [PATCH 07/12] just thought we might want to climb sometime --- .../robot/subsystems/ClimberSubsystem.java | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 6eed73a..4fe897f 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -13,73 +13,73 @@ import frc.robot.Constants.ClimberConstants; public class ClimberSubsystem extends SubsystemBase { - // private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - // ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); - // private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - // ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); - // private PneumaticHub m_pHub; + private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); + private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); + private PneumaticHub m_pHub; - // private boolean m_compressorEnabled; + private boolean m_compressorEnabled; - // private Value m_state; + private Value m_state; public ClimberSubsystem() { - // m_pHub = new PneumaticHub(2); + m_pHub = new PneumaticHub(2); - // solenoidOff(); + solenoidOff(); - // m_compressorEnabled = false; + m_compressorEnabled = false; } // Runs once every tick (~20ms) public void periodic() { - // m_leftSolenoid.set(m_state); - // m_rightSolenoid.set(m_state); - // SmartDashboard.putString("pneumatics state", m_state.name()); - // SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); - // SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); - // SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); + m_leftSolenoid.set(m_state); + m_rightSolenoid.set(m_state); + SmartDashboard.putString("pneumatics state", m_state.name()); + SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); + SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); + SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); } public void reset() { - // m_state = kOff; + m_state = kOff; } /** * Sets the state of the solenoid to off */ public void solenoidOff() { - // m_state = kOff; + m_state = kOff; } /** * Extends both arms */ public void forward() { - // m_state = kForward; + m_state = kForward; } /** * Retracts both arms */ public void reverse() { - // m_state = kReverse; + m_state = kReverse; } public Value getState(){ - // return m_state; - return Value.kOff; + return m_state; + // return Value.kOff; } /** * Toggles the state of the compressor (on/off) */ public void toggleCompressor() { - // m_compressorEnabled = !m_compressorEnabled; - // if (m_compressorEnabled) { - // m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); - // } else { - // m_pHub.disableCompressor(); - // } + m_compressorEnabled = !m_compressorEnabled; + if (m_compressorEnabled) { + m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); + } else { + m_pHub.disableCompressor(); + } } } From 0648c684f89f0133f19f05f8731b92fd19ebecbd Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Wed, 9 Oct 2024 17:37:10 -0700 Subject: [PATCH 08/12] this probably doesnt need to be tested --- .../pathplanner/autos/1-AmpSide-Leave.auto | 31 ++++++ .../pathplanner/autos/2-SourceSide-Leave.auto | 6 ++ .../pathplanner/autos/4-Center-Stays.auto | 57 +++++++++++ .../pathplanner/autos/5-Center-Stays.auto | 95 +++++++++++++++++++ .../deploy/pathplanner/paths/praying.path | 84 ++++++++++++++++ 5 files changed, 273 insertions(+) create mode 100644 src/main/deploy/pathplanner/paths/praying.path diff --git a/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto b/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto index b83e34c..16e0de4 100644 --- a/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto +++ b/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto @@ -32,9 +32,40 @@ "data": { "pathName": "MoveOut-Left" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + } + ] + } } ] } + }, + { + "type": "named", + "data": { + "name": "Prep-Speed - 60%" + } + }, + { + "type": "named", + "data": { + "name": "Outtake" + } } ] } diff --git a/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto b/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto index 8d2f7b2..863d559 100644 --- a/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto +++ b/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto @@ -11,6 +11,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Intake in" + } + }, { "type": "named", "data": { diff --git a/src/main/deploy/pathplanner/autos/4-Center-Stays.auto b/src/main/deploy/pathplanner/autos/4-Center-Stays.auto index 2964dc9..73d8f39 100644 --- a/src/main/deploy/pathplanner/autos/4-Center-Stays.auto +++ b/src/main/deploy/pathplanner/autos/4-Center-Stays.auto @@ -50,6 +50,25 @@ "data": { "name": "Spin up Shooter" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake in" + } + } + ] + } } ] } @@ -81,6 +100,25 @@ "data": { "name": "Intake" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake in" + } + } + ] + } } ] } @@ -112,6 +150,25 @@ "data": { "name": "Intake" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake in" + } + } + ] + } } ] } diff --git a/src/main/deploy/pathplanner/autos/5-Center-Stays.auto b/src/main/deploy/pathplanner/autos/5-Center-Stays.auto index 7d849f7..36dc3d6 100644 --- a/src/main/deploy/pathplanner/autos/5-Center-Stays.auto +++ b/src/main/deploy/pathplanner/autos/5-Center-Stays.auto @@ -11,6 +11,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Intake in" + } + }, { "type": "named", "data": { @@ -44,6 +50,25 @@ "data": { "name": "Spin up Shooter" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake in" + } + } + ] + } } ] } @@ -75,6 +100,25 @@ "data": { "name": "Intake" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake in" + } + } + ] + } } ] } @@ -106,6 +150,25 @@ "data": { "name": "Intake" } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 3.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake in" + } + } + ] + } } ] } @@ -121,6 +184,38 @@ "data": { "name": "Outtake" } + }, + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "praying" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 0.5 + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + } + ] + } + } + ] + } } ] } diff --git a/src/main/deploy/pathplanner/paths/praying.path b/src/main/deploy/pathplanner/paths/praying.path new file mode 100644 index 0000000..8f370f6 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/praying.path @@ -0,0 +1,84 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.4, + "y": 5.5216374597852385 + }, + "prevControl": null, + "nextControl": { + "x": 3.1394462788925583, + "y": 5.042853514278457 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.727856598570341, + "y": 4.0606698356253865 + }, + "prevControl": { + "x": 6.452483762110382, + "y": 3.9287347146122866 + }, + "nextControl": { + "x": 7.9485168895402, + "y": 4.083496762277441 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.3470318873095533, + "y": 5.5216374597852385 + }, + "prevControl": { + "x": 4.590732610036649, + "y": 4.456475198664683 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.9, + "rotationDegrees": -5.22608757192024, + "rotateFast": false + }, + { + "waypointRelativePos": 1.5, + "rotationDegrees": -30.73809745377298, + "rotateFast": false + }, + { + "waypointRelativePos": 0.5, + "rotationDegrees": -30.768435452329488, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.25, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 0, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 0, + "velocity": 0 + }, + "useDefaultConstraints": false +} \ No newline at end of file From daef5aa5de0bfd6d7d0622c95582ad20a301f904 Mon Sep 17 00:00:00 2001 From: Anay Nagar Date: Fri, 11 Oct 2024 22:04:15 -0700 Subject: [PATCH 09/12] its gonna be another weekend as the only programmer at comp!!! --- vendordeps/PathplannerLib.json | 6 ++--- vendordeps/Phoenix6.json | 48 +++++++++++++++++----------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json index a019706..6dc648d 100644 --- a/vendordeps/PathplannerLib.json +++ b/vendordeps/PathplannerLib.json @@ -1,7 +1,7 @@ { "fileName": "PathplannerLib.json", "name": "PathplannerLib", - "version": "2024.2.7", + "version": "2024.2.8", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", "frcYear": "2024", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-java", - "version": "2024.2.7" + "version": "2024.2.8" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2024.2.7", + "version": "2024.2.8", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/vendordeps/Phoenix6.json b/vendordeps/Phoenix6.json index 2b7d172..0322385 100644 --- a/vendordeps/Phoenix6.json +++ b/vendordeps/Phoenix6.json @@ -1,7 +1,7 @@ { "fileName": "Phoenix6.json", "name": "CTRE-Phoenix (v6)", - "version": "24.2.0", + "version": "24.3.0", "frcYear": 2024, "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ @@ -19,14 +19,14 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "24.2.0" + "version": "24.3.0" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -39,7 +39,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -52,7 +52,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -65,7 +65,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonFX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -78,7 +78,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -91,7 +91,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -104,7 +104,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -117,7 +117,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -130,7 +130,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -143,7 +143,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.2.0", + "version": "24.3.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -158,7 +158,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -173,7 +173,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -188,7 +188,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -203,7 +203,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -218,7 +218,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -233,7 +233,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonFX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -248,7 +248,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -263,7 +263,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -278,7 +278,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -293,7 +293,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -308,7 +308,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -323,7 +323,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.2.0", + "version": "24.3.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, From 9894a7d43bd77ffce0bc39d14c964fd593a1e90c Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Mon, 14 Oct 2024 16:38:43 -0700 Subject: [PATCH 10/12] maybe it did need to be tested... --- .../pathplanner/autos/1-AmpSide-Leave.auto | 31 ------ .../pathplanner/autos/2-SourceSide-Leave.auto | 6 -- .../pathplanner/autos/4-Center-Stays.auto | 57 ----------- .../pathplanner/autos/5-Center-Stays.auto | 95 ------------------- .../deploy/pathplanner/paths/praying.path | 84 ---------------- .../robot/subsystems/ClimberSubsystem.java | 56 +++++------ vendordeps/PathplannerLib.json | 6 +- vendordeps/Phoenix6.json | 48 +++++----- 8 files changed, 55 insertions(+), 328 deletions(-) delete mode 100644 src/main/deploy/pathplanner/paths/praying.path diff --git a/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto b/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto index 16e0de4..b83e34c 100644 --- a/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto +++ b/src/main/deploy/pathplanner/autos/1-AmpSide-Leave.auto @@ -32,40 +32,9 @@ "data": { "pathName": "MoveOut-Left" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 1.5 - } - }, - { - "type": "named", - "data": { - "name": "Intake" - } - } - ] - } } ] } - }, - { - "type": "named", - "data": { - "name": "Prep-Speed - 60%" - } - }, - { - "type": "named", - "data": { - "name": "Outtake" - } } ] } diff --git a/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto b/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto index 863d559..8d2f7b2 100644 --- a/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto +++ b/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto @@ -11,12 +11,6 @@ "type": "sequential", "data": { "commands": [ - { - "type": "named", - "data": { - "name": "Intake in" - } - }, { "type": "named", "data": { diff --git a/src/main/deploy/pathplanner/autos/4-Center-Stays.auto b/src/main/deploy/pathplanner/autos/4-Center-Stays.auto index 73d8f39..2964dc9 100644 --- a/src/main/deploy/pathplanner/autos/4-Center-Stays.auto +++ b/src/main/deploy/pathplanner/autos/4-Center-Stays.auto @@ -50,25 +50,6 @@ "data": { "name": "Spin up Shooter" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 3.0 - } - }, - { - "type": "named", - "data": { - "name": "Intake in" - } - } - ] - } } ] } @@ -100,25 +81,6 @@ "data": { "name": "Intake" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 3.0 - } - }, - { - "type": "named", - "data": { - "name": "Intake in" - } - } - ] - } } ] } @@ -150,25 +112,6 @@ "data": { "name": "Intake" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 3.0 - } - }, - { - "type": "named", - "data": { - "name": "Intake in" - } - } - ] - } } ] } diff --git a/src/main/deploy/pathplanner/autos/5-Center-Stays.auto b/src/main/deploy/pathplanner/autos/5-Center-Stays.auto index 36dc3d6..7d849f7 100644 --- a/src/main/deploy/pathplanner/autos/5-Center-Stays.auto +++ b/src/main/deploy/pathplanner/autos/5-Center-Stays.auto @@ -11,12 +11,6 @@ "type": "sequential", "data": { "commands": [ - { - "type": "named", - "data": { - "name": "Intake in" - } - }, { "type": "named", "data": { @@ -50,25 +44,6 @@ "data": { "name": "Spin up Shooter" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 3.0 - } - }, - { - "type": "named", - "data": { - "name": "Intake in" - } - } - ] - } } ] } @@ -100,25 +75,6 @@ "data": { "name": "Intake" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 3.0 - } - }, - { - "type": "named", - "data": { - "name": "Intake in" - } - } - ] - } } ] } @@ -150,25 +106,6 @@ "data": { "name": "Intake" } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 3.0 - } - }, - { - "type": "named", - "data": { - "name": "Intake in" - } - } - ] - } } ] } @@ -184,38 +121,6 @@ "data": { "name": "Outtake" } - }, - { - "type": "deadline", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "praying" - } - }, - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "wait", - "data": { - "waitTime": 0.5 - } - }, - { - "type": "named", - "data": { - "name": "Intake" - } - } - ] - } - } - ] - } } ] } diff --git a/src/main/deploy/pathplanner/paths/praying.path b/src/main/deploy/pathplanner/paths/praying.path deleted file mode 100644 index 8f370f6..0000000 --- a/src/main/deploy/pathplanner/paths/praying.path +++ /dev/null @@ -1,84 +0,0 @@ -{ - "version": 1.0, - "waypoints": [ - { - "anchor": { - "x": 1.4, - "y": 5.5216374597852385 - }, - "prevControl": null, - "nextControl": { - "x": 3.1394462788925583, - "y": 5.042853514278457 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 7.727856598570341, - "y": 4.0606698356253865 - }, - "prevControl": { - "x": 6.452483762110382, - "y": 3.9287347146122866 - }, - "nextControl": { - "x": 7.9485168895402, - "y": 4.083496762277441 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 1.3470318873095533, - "y": 5.5216374597852385 - }, - "prevControl": { - "x": 4.590732610036649, - "y": 4.456475198664683 - }, - "nextControl": null, - "isLocked": false, - "linkedName": null - } - ], - "rotationTargets": [ - { - "waypointRelativePos": 0.9, - "rotationDegrees": -5.22608757192024, - "rotateFast": false - }, - { - "waypointRelativePos": 1.5, - "rotationDegrees": -30.73809745377298, - "rotateFast": false - }, - { - "waypointRelativePos": 0.5, - "rotationDegrees": -30.768435452329488, - "rotateFast": false - } - ], - "constraintZones": [], - "eventMarkers": [], - "globalConstraints": { - "maxVelocity": 3.0, - "maxAcceleration": 3.25, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0 - }, - "goalEndState": { - "velocity": 0, - "rotation": 0, - "rotateFast": false - }, - "reversed": false, - "folder": null, - "previewStartingState": { - "rotation": 0, - "velocity": 0 - }, - "useDefaultConstraints": false -} \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 4fe897f..6eed73a 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -13,73 +13,73 @@ import frc.robot.Constants.ClimberConstants; public class ClimberSubsystem extends SubsystemBase { - private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); - private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); - private PneumaticHub m_pHub; + // private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + // ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); + // private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + // ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); + // private PneumaticHub m_pHub; - private boolean m_compressorEnabled; + // private boolean m_compressorEnabled; - private Value m_state; + // private Value m_state; public ClimberSubsystem() { - m_pHub = new PneumaticHub(2); + // m_pHub = new PneumaticHub(2); - solenoidOff(); + // solenoidOff(); - m_compressorEnabled = false; + // m_compressorEnabled = false; } // Runs once every tick (~20ms) public void periodic() { - m_leftSolenoid.set(m_state); - m_rightSolenoid.set(m_state); - SmartDashboard.putString("pneumatics state", m_state.name()); - SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); - SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); - SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); + // m_leftSolenoid.set(m_state); + // m_rightSolenoid.set(m_state); + // SmartDashboard.putString("pneumatics state", m_state.name()); + // SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); + // SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); + // SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); } public void reset() { - m_state = kOff; + // m_state = kOff; } /** * Sets the state of the solenoid to off */ public void solenoidOff() { - m_state = kOff; + // m_state = kOff; } /** * Extends both arms */ public void forward() { - m_state = kForward; + // m_state = kForward; } /** * Retracts both arms */ public void reverse() { - m_state = kReverse; + // m_state = kReverse; } public Value getState(){ - return m_state; - // return Value.kOff; + // return m_state; + return Value.kOff; } /** * Toggles the state of the compressor (on/off) */ public void toggleCompressor() { - m_compressorEnabled = !m_compressorEnabled; - if (m_compressorEnabled) { - m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); - } else { - m_pHub.disableCompressor(); - } + // m_compressorEnabled = !m_compressorEnabled; + // if (m_compressorEnabled) { + // m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); + // } else { + // m_pHub.disableCompressor(); + // } } } diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json index 6dc648d..a019706 100644 --- a/vendordeps/PathplannerLib.json +++ b/vendordeps/PathplannerLib.json @@ -1,7 +1,7 @@ { "fileName": "PathplannerLib.json", "name": "PathplannerLib", - "version": "2024.2.8", + "version": "2024.2.7", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", "frcYear": "2024", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-java", - "version": "2024.2.8" + "version": "2024.2.7" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2024.2.8", + "version": "2024.2.7", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/vendordeps/Phoenix6.json b/vendordeps/Phoenix6.json index 0322385..2b7d172 100644 --- a/vendordeps/Phoenix6.json +++ b/vendordeps/Phoenix6.json @@ -1,7 +1,7 @@ { "fileName": "Phoenix6.json", "name": "CTRE-Phoenix (v6)", - "version": "24.3.0", + "version": "24.2.0", "frcYear": 2024, "uuid": "e995de00-2c64-4df5-8831-c1441420ff19", "mavenUrls": [ @@ -19,14 +19,14 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-java", - "version": "24.3.0" + "version": "24.2.0" } ], "jniDependencies": [ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -39,7 +39,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -52,7 +52,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -65,7 +65,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonFX", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -78,7 +78,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -91,7 +91,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -104,7 +104,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -117,7 +117,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -130,7 +130,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -143,7 +143,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.3.0", + "version": "24.2.0", "isJar": false, "skipInvalidPlatforms": true, "validPlatforms": [ @@ -158,7 +158,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "wpiapi-cpp", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_Phoenix6_WPI", "headerClassifier": "headers", "sharedLibrary": true, @@ -173,7 +173,7 @@ { "groupId": "com.ctre.phoenix6", "artifactId": "tools", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_PhoenixTools", "headerClassifier": "headers", "sharedLibrary": true, @@ -188,7 +188,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "wpiapi-cpp-sim", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_Phoenix6_WPISim", "headerClassifier": "headers", "sharedLibrary": true, @@ -203,7 +203,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "tools-sim", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_PhoenixTools_Sim", "headerClassifier": "headers", "sharedLibrary": true, @@ -218,7 +218,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonSRX", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimTalonSRX", "headerClassifier": "headers", "sharedLibrary": true, @@ -233,7 +233,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simTalonFX", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -248,7 +248,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simVictorSPX", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimVictorSPX", "headerClassifier": "headers", "sharedLibrary": true, @@ -263,7 +263,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simPigeonIMU", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimPigeonIMU", "headerClassifier": "headers", "sharedLibrary": true, @@ -278,7 +278,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simCANCoder", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimCANCoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -293,7 +293,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProTalonFX", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimProTalonFX", "headerClassifier": "headers", "sharedLibrary": true, @@ -308,7 +308,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProCANcoder", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimProCANcoder", "headerClassifier": "headers", "sharedLibrary": true, @@ -323,7 +323,7 @@ { "groupId": "com.ctre.phoenix6.sim", "artifactId": "simProPigeon2", - "version": "24.3.0", + "version": "24.2.0", "libName": "CTRE_SimProPigeon2", "headerClassifier": "headers", "sharedLibrary": true, From 490de71b180a36d0c2b0483145f1a79a4f77627f Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Mon, 14 Oct 2024 16:39:40 -0700 Subject: [PATCH 11/12] girls gen changes --- .../pathplanner/autos/2-SourceSide-Leave.auto | 6 ++ .../robot/subsystems/ClimberSubsystem.java | 56 +++++++++---------- .../frc/robot/subsystems/IntakeSubsystem.java | 2 + 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto b/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto index 8d2f7b2..863d559 100644 --- a/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto +++ b/src/main/deploy/pathplanner/autos/2-SourceSide-Leave.auto @@ -11,6 +11,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "Intake in" + } + }, { "type": "named", "data": { diff --git a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java index 6eed73a..4fe897f 100644 --- a/src/main/java/frc/robot/subsystems/ClimberSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ClimberSubsystem.java @@ -13,73 +13,73 @@ import frc.robot.Constants.ClimberConstants; public class ClimberSubsystem extends SubsystemBase { - // private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - // ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); - // private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, - // ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); - // private PneumaticHub m_pHub; + private final DoubleSolenoid m_leftSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + ClimberConstants.leftForwardChannel, ClimberConstants.leftReverseChannel); + private final DoubleSolenoid m_rightSolenoid = new DoubleSolenoid(2, PneumaticsModuleType.REVPH, + ClimberConstants.rightReverseChannel, ClimberConstants.rightForwardChannel); + private PneumaticHub m_pHub; - // private boolean m_compressorEnabled; + private boolean m_compressorEnabled; - // private Value m_state; + private Value m_state; public ClimberSubsystem() { - // m_pHub = new PneumaticHub(2); + m_pHub = new PneumaticHub(2); - // solenoidOff(); + solenoidOff(); - // m_compressorEnabled = false; + m_compressorEnabled = false; } // Runs once every tick (~20ms) public void periodic() { - // m_leftSolenoid.set(m_state); - // m_rightSolenoid.set(m_state); - // SmartDashboard.putString("pneumatics state", m_state.name()); - // SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); - // SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); - // SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); + m_leftSolenoid.set(m_state); + m_rightSolenoid.set(m_state); + SmartDashboard.putString("pneumatics state", m_state.name()); + SmartDashboard.putNumber("pressure", m_pHub.getPressure(0)); + SmartDashboard.putBoolean("Compressor Enabled", m_compressorEnabled); + SmartDashboard.putBoolean("Compressor Running", m_pHub.getCompressor()); } public void reset() { - // m_state = kOff; + m_state = kOff; } /** * Sets the state of the solenoid to off */ public void solenoidOff() { - // m_state = kOff; + m_state = kOff; } /** * Extends both arms */ public void forward() { - // m_state = kForward; + m_state = kForward; } /** * Retracts both arms */ public void reverse() { - // m_state = kReverse; + m_state = kReverse; } public Value getState(){ - // return m_state; - return Value.kOff; + return m_state; + // return Value.kOff; } /** * Toggles the state of the compressor (on/off) */ public void toggleCompressor() { - // m_compressorEnabled = !m_compressorEnabled; - // if (m_compressorEnabled) { - // m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); - // } else { - // m_pHub.disableCompressor(); - // } + m_compressorEnabled = !m_compressorEnabled; + if (m_compressorEnabled) { + m_pHub.enableCompressorAnalog(ClimberConstants.minPressure, ClimberConstants.maxPressure); + } else { + m_pHub.disableCompressor(); + } } } diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index cc3f6e4..740d13f 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -87,7 +87,9 @@ public void daveImSorry() { /** i wish i was at the hans zimmer concert rn */ public void heCantKillMeTwice() { + SmartDashboard.putNumber("yolo", m_armEncoder.getAbsolutePosition() - IntakeConstants.kIntakeLoweredAngle); IntakeConstants.kArmEncoderOffset = m_armEncoder.getAbsolutePosition() - IntakeConstants.kIntakeLoweredAngle; + // m_armSetpoint = m_armEncoder.get() - 60; } public void setArmPosition(ArmPosition position) { From 426ee6e0ca8dc119303ad911ead0c6781b5a8383 Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Fri, 6 Dec 2024 17:17:54 -0800 Subject: [PATCH 12/12] outeach mode: Bennet changes, fast mode has to be enabled through OutlineViewer --- src/main/java/frc/robot/Constants.java | 4 ++-- src/main/java/frc/robot/RobotContainer.java | 23 +++++++++++-------- .../robot/subsystems/ShooterSubsystem.java | 6 ++++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 09e625f..85c7735 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -41,7 +41,7 @@ public static final class DriveConstants { // TODO: set motor and encoder constants public static final int kFrontLeftDriveMotorPort = 32; public static final int kRearLeftDriveMotorPort = 29; - public static final int kFrontRightDriveMotorPort = 38; + public static final int kFrontRightDriveMotorPort = 36; public static final int kRearRightDriveMotorPort = 34; public static final int kFrontLeftTurningMotorPort = 28; @@ -101,7 +101,7 @@ public static final class IntakeConstants { public static final int kArmEncoderChannel = 1; // In degrees - public static final double kIntakeLoweredAngle = -193; + public static final double kIntakeLoweredAngle = -188; public static final double kIntakeRaisedAngle = 0; public static final double kIntakeAmpScoringAngle = -71; // 193 - 100 (previous angle) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 52e7e47..5420005 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -72,6 +72,12 @@ public class RobotContainer { * The container for the robot. Contains subsystems, IO devices, and commands. */ public RobotContainer() { + + SmartDashboard.putBoolean("fast", false); + SmartDashboard.putBoolean("shoot fast", false); + + + NamedCommands.registerCommand("Shoot", new SequentialCommandGroup( new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime), @@ -151,24 +157,21 @@ public RobotContainer() { scaleJoysticks(-m_driverController.getLeftY(), -m_driverController.getLeftX()), IOConstants.kControllerDeadband) * DriveConstants.kMaxSpeedMetersPerSecond - * (1 - m_driverController - .getRightTriggerAxis() + * (1 - (SmartDashboard.getBoolean("fast", false) ? m_driverController.getRightTriggerAxis() : 1) * IOConstants.kSlowModeScalar), // * 0.8, MathUtil.applyDeadband( scaleJoysticks(-m_driverController.getLeftX(), -m_driverController.getLeftY()), IOConstants.kControllerDeadband) * DriveConstants.kMaxSpeedMetersPerSecond - * (1 - m_driverController - .getRightTriggerAxis() + * (1 - (SmartDashboard.getBoolean("fast", false) ? m_driverController.getRightTriggerAxis() : 1) * IOConstants.kSlowModeScalar), // * 0.8, MathUtil.applyDeadband( -m_driverController.getRightX(), IOConstants.kControllerDeadband) * DriveConstants.kMaxAngularSpeedRadiansPerSecond - * (1 - m_driverController - .getRightTriggerAxis() + * (1 - (SmartDashboard.getBoolean("fast", false) ? m_driverController.getRightTriggerAxis() : 1) * IOConstants.kSlowModeScalar) * 0.7, !m_driverController.getLeftBumper()), @@ -202,7 +205,7 @@ private void configureBindings() { new JoystickButton(m_driverController, Button.kX.value) .onTrue(new SequentialCommandGroup( - new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime), + new ShooterSetSpeedCommand(m_shooterSubsystem, SmartDashboard.getBoolean("shoot fast", false) ? ShootSpeed.Shooting : ShootSpeed.Prep, ShooterConstants.kShooterOnTime), new ParallelDeadlineGroup(new WaitCommand(1), new NoteOuttakeCommand(m_intakeSubsystem)))) .onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)); @@ -229,8 +232,8 @@ private void configureBindings() { .onTrue(new InstantCommand(() -> m_intakeSubsystem.resetHard())); // i better run - new JoystickButton(m_driverController, Button.kX.value) - .onTrue(new InstantCommand(() -> m_intakeSubsystem.daveImSorry())); + // new JoystickButton(m_driverController, Button.kX.value) + // .onTrue(new InstantCommand(() -> m_intakeSubsystem.daveImSorry())); new JoystickButton(m_driverController, Button.kBack.value) .onTrue(new InstantCommand(() -> m_intakeSubsystem.heCantKillMeTwice())); @@ -285,7 +288,7 @@ private void configureBindings() { // Spin up Shooter, Operator Controller Left Trigger new Trigger(() -> { return m_operatorController.getLeftTriggerAxis() > 0.5; - }).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime)) + }).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, SmartDashboard.getBoolean("shoot fast", false) ? ShootSpeed.Shooting : ShootSpeed.SlowShoot, ShooterConstants.kShooterOnTime)) .onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)); // Climber Up, Operator Controller Right Bumper + A Button diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index 54ffc08..be02068 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -46,9 +46,12 @@ public void setShootingSpeed(ShootSpeed speed) { m_topSpeed = ShooterConstants.kShooterSpeedTop; m_bottomSpeed = ShooterConstants.kShooterSpeedBottom; break; + case SlowShoot: + // m_topSpeed = case Amp: m_topSpeed = 0.2; m_bottomSpeed = 0.3; + break; case Prep: m_topSpeed = ShooterConstants.kPrepShooterSpeed; m_bottomSpeed = ShooterConstants.kPrepShooterSpeed; @@ -80,6 +83,7 @@ public static enum ShootSpeed { Shooting, Prep, Amp, - Off + Off, + SlowShoot } }