From f21e5d981bcbeddf5822411a4d5a7c328f63184b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AEZach=20Wilke?= <90875734+76842@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:09:55 -0600 Subject: [PATCH] It Builds(sort of) I fixed it to now build but to make it not the in the code I am uploading a version with a simple error just so this doesn't get taken as "done" --- src/main/java/frc4388/robot/Constants.java | 4 +- .../java/frc4388/robot/RobotContainer.java | 10 +++-- src/main/java/frc4388/robot/RobotMap.java | 2 + .../frc4388/robot/commands/ShootYourShot.java | 37 ------------------- .../frc4388/robot/subsystems/ShootTube.java | 14 +++---- src/main/java/frc4388/utility/DPrint.java | 12 +++--- 6 files changed, 23 insertions(+), 56 deletions(-) delete mode 100644 src/main/java/frc4388/robot/commands/ShootYourShot.java diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index a114a94..22609dc 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -56,7 +56,7 @@ public final class Constants { } public static final class DebugConstants { public static final boolean CAN_BUILD = no; - public static final boolean SHOW_INFO = yes; - public static final Str TYPE_INFO = "INFO"; + public static final boolean SHOW_INFO = true; + public static final String TYPE_INFO = "INFO"; } } \ No newline at end of file diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 5d9621b..6e129a7 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -8,6 +8,7 @@ package frc4388.robot; import edu.wpi.first.wpilibj.Joystick; +import edu.wpi.first.wpilibj.Solenoid; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.InstantCommand; import edu.wpi.first.wpilibj2.command.RunCommand; @@ -18,6 +19,7 @@ import frc4388.robot.subsystems.Horn; import frc4388.robot.subsystems.ShootTube; import frc4388.robot.subsystems.LED; import frc4388.utility.LEDPatterns; +import frc4388.utility.DPrint; import frc4388.utility.controller.IHandController; import frc4388.utility.controller.XboxController; @@ -67,7 +69,7 @@ public class RobotContainer { }; private final ShootTube m_robotShooter = new ShootTube(SolenoidArray); - private final DPrinter m_debugLogger = m_robotMap.DPrinter; + private final DPrint m_debugLogger = m_robotMap.DPrinter; /* Controllers */ private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); private final XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); @@ -101,19 +103,19 @@ public class RobotContainer { .whileHeld(() -> m_robotDrive.driveWithInput(0, 1)); */ /* Operator Buttons */ - // activates ""🔥👌💯" Mode"™⁋ + // activates "lit" Mode" /* new JoystickButton(getOperatorJoystick(), XboxController.A_BUTTON) .whenPressed(() -> m_robotLED.setPattern(LEDPatterns.LAVA_RAINBOW)) .whenReleased(() -> m_robotLED.setPattern(LEDConstants.DEFAULT_PATTERN)); */ /* Fire horn */ - new JoystickButton(getOperatorJoystick(), XboxController.LEFT_TRIGGER) + new JoystickButton(getOperatorJoystick(), XboxController.LEFT_TRIGGER_AXIS) .whenPressed(() -> m_robotHorn.hornSet(true)) .whenReleased(() -> m_robotHorn.hornSet(false)); /* Shoot T-Shirt, Also cycles the array */ - new JoystickButton(getOperatorJoystick(), XboxController.RIGHT_TRIGGER) + new JoystickButton(getOperatorJoystick(), XboxController.RIGHT_TRIGGER_AXIS) .whenPressed(() -> m_robotShooter.ShootTubeSet(true)) .whenReleased(() -> m_robotShooter.ShootTubeSet(false)); diff --git a/src/main/java/frc4388/robot/RobotMap.java b/src/main/java/frc4388/robot/RobotMap.java index fd5c672..d70541c 100644 --- a/src/main/java/frc4388/robot/RobotMap.java +++ b/src/main/java/frc4388/robot/RobotMap.java @@ -18,6 +18,8 @@ import edu.wpi.first.wpilibj.drive.DifferentialDrive; import frc4388.robot.Constants.DriveConstants; import frc4388.robot.Constants.HornConstants; import frc4388.robot.Constants.LEDConstants; +import frc4388.robot.Constants.ShooterConstants; +import frc4388.robot.Constants.DebugConstants;; import frc4388.utility.RobotGyro; import frc4388.utility.DPrint; diff --git a/src/main/java/frc4388/robot/commands/ShootYourShot.java b/src/main/java/frc4388/robot/commands/ShootYourShot.java deleted file mode 100644 index bfa7751..0000000 --- a/src/main/java/frc4388/robot/commands/ShootYourShot.java +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - -/* This Command has been gutted. Like a fish */ -package frc4388.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; - -public class ShootYourShot extends CommandBase { - - /** Creates a new ShootYourShot - *. */ - public ShootYourShot(Solenoid[] solenoids) { - } - - // Called when the command is initially scheduled. - @Override - public void initialize() {} - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - ShootTube.ShootTubeSet(true); - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} \ No newline at end of file diff --git a/src/main/java/frc4388/robot/subsystems/ShootTube.java b/src/main/java/frc4388/robot/subsystems/ShootTube.java index 53dbffd..c51dc94 100644 --- a/src/main/java/frc4388/robot/subsystems/ShootTube.java +++ b/src/main/java/frc4388/robot/subsystems/ShootTube.java @@ -7,13 +7,13 @@ package frc4388.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.utility.DPrint; import frc4388.robot.Constants.DebugConstants; -import edu.wpi.first.wbilib.Solnoid; - -DPrint DPrinter = new DPrint(DebugConstants.TYPE_INFO) +import edu.wpi.first.wpilibj.Solenoid; + public class ShootTube extends SubsystemBase { Solenoid[] m_solenoids; int m_cycleCount = 0; int m_maxCount; + DPrint m_DPrinter = new DPrint(DebugConstants.TYPE_INFO); public ShootTube(Solenoid[] solenoids) { m_solenoids = solenoids; m_maxCount = m_solenoids.length; @@ -27,21 +27,21 @@ public class ShootTube extends SubsystemBase { if (m_cycleCount >= m_maxCount || m_cycleCount < 0) { m_cycleCount = 0; } - DPrinter.println("Current CycleCount: "+m_cycleCount) + m_DPrinter.println("Current CycleCount: "+m_cycleCount); } public void CycleDown() { m_cycleCount--; if (m_cycleCount >= m_maxCount || m_cycleCount < 0) { m_cycleCount = 0; } - DPrinter.println("Current CycleCount: "+m_cycleCount) + m_DPrinter.println("Current CycleCount: "+m_cycleCount); } /* Normal Shoot Tube and Normal Shoot Tube Index Functions */ /* Function "ShootTubeSet" cycles up automaticly */ public void ShootTubeSet(Boolean arg) { - m_solenoids[CycleCount].set(arg); + m_solenoids[m_cycleCount].set(arg); /* If closing valve: Increse the CycleCount by one, if the CycleCount >= the length of the array OR CycleCount < 0: @@ -52,7 +52,7 @@ public class ShootTube extends SubsystemBase { m_cycleCount = 0; } } - DPrinter.println("Current CycleCount: "+m_cycleCount) + m_DPrinter.println("Current CycleCount: "+m_cycleCount); } /* Function "ShootTubeIndex" won't cycle up automaticly */ /* Not used, yet Useful */ diff --git a/src/main/java/frc4388/utility/DPrint.java b/src/main/java/frc4388/utility/DPrint.java index efd458b..91bbb54 100644 --- a/src/main/java/frc4388/utility/DPrint.java +++ b/src/main/java/frc4388/utility/DPrint.java @@ -4,26 +4,26 @@ package frc4388.utility; import frc4388.robot.Constants.DebugConstants; public class DPrint { - str m_debugMsgType = DebugConstants.TYPE_INFO; - public DPrint(str type) { + String m_debugMsgType = DebugConstants.TYPE_INFO; + public DPrint(String type) { m_debugMsgType = type; } - public println(str mesage) { + public void println(String mesage) { switch (m_debugMsgType) { case DebugConstants.TYPE_INFO: if (DebugConstants.SHOW_INFO) { - system.out.println("Debug_INFO: "+mesage); + System.out.println("Debug_INFO: "+mesage); } ; default: ; } } - public print(str mesage) { + public void print(String mesage) { switch (m_debugMsgType) { case DebugConstants.TYPE_INFO: if (DebugConstants.SHOW_INFO) { - system.out.print("Debug_INFO: "+mesage); + System.out.print("Debug_INFO: "+mesage); } ; default: