diff --git a/.VSCodeCounter/details.md b/.VSCodeCounter/details.md new file mode 100644 index 0000000..1306275 --- /dev/null +++ b/.VSCodeCounter/details.md @@ -0,0 +1,98 @@ +# Details + +Date : 2020-03-13 19:46:18 + +Directory c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main + +Total : 83 files, 4888 codes, 1770 comments, 1110 blanks, all 7768 lines + +[summary](results.md) + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | +| [src/main/deploy/paths/DriveOffLineBackward.wpilib.json](/src/main/deploy/paths/DriveOffLineBackward.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/DriveOffLineForward.wpilib.json](/src/main/deploy/paths/DriveOffLineForward.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMid0.wpilib.json](/src/main/deploy/paths/EightBallMid0.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMid1.wpilib.json](/src/main/deploy/paths/EightBallMid1.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMid2.wpilib.json](/src/main/deploy/paths/EightBallMid2.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/EightBallMidComplete.wpilib.json](/src/main/deploy/paths/EightBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/FiveBallMidComplete.wpilib.json](/src/main/deploy/paths/FiveBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/SixBallMid0.wpilib.json](/src/main/deploy/paths/SixBallMid0.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/SixBallMid1.wpilib.json](/src/main/deploy/paths/SixBallMid1.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/SixBallMidComplete.wpilib.json](/src/main/deploy/paths/SixBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/deploy/paths/TenBallMidComplete.wpilib.json](/src/main/deploy/paths/TenBallMidComplete.wpilib.json) | JSON | 1 | 0 | 0 | 1 | +| [src/main/driverStation/GOAT DRIVERSTATION.json](/src/main/driverStation/GOAT DRIVERSTATION.json) | JSON | 1,014 | 0 | 0 | 1,014 | +| [src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css](/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css) | CSS | 8 | 0 | 1 | 9 | +| [src/main/java/frc4388/robot/Constants.java](/src/main/java/frc4388/robot/Constants.java) | Java | 157 | 32 | 41 | 230 | +| [src/main/java/frc4388/robot/Main.java](/src/main/java/frc4388/robot/Main.java) | Java | 9 | 16 | 5 | 30 | +| [src/main/java/frc4388/robot/Robot.java](/src/main/java/frc4388/robot/Robot.java) | Java | 59 | 63 | 24 | 146 | +| [src/main/java/frc4388/robot/RobotContainer.java](/src/main/java/frc4388/robot/RobotContainer.java) | Java | 312 | 145 | 96 | 553 | +| [src/main/java/frc4388/robot/commands/InterruptSubystem.java](/src/main/java/frc4388/robot/commands/InterruptSubystem.java) | Java | 21 | 14 | 8 | 43 | +| [src/main/java/frc4388/robot/commands/auto/AutoPath1FromCenter.java](/src/main/java/frc4388/robot/commands/auto/AutoPath1FromCenter.java) | Java | 22 | 19 | 6 | 47 | +| [src/main/java/frc4388/robot/commands/auto/AutoPath2FromRight.java](/src/main/java/frc4388/robot/commands/auto/AutoPath2FromRight.java) | Java | 26 | 23 | 6 | 55 | +| [src/main/java/frc4388/robot/commands/auto/DriveOffLineBackward.java](/src/main/java/frc4388/robot/commands/auto/DriveOffLineBackward.java) | Java | 13 | 14 | 5 | 32 | +| [src/main/java/frc4388/robot/commands/auto/DriveOffLineForward.java](/src/main/java/frc4388/robot/commands/auto/DriveOffLineForward.java) | Java | 11 | 14 | 5 | 30 | +| [src/main/java/frc4388/robot/commands/auto/EightBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/EightBallAutoMiddle.java) | Java | 11 | 14 | 5 | 30 | +| [src/main/java/frc4388/robot/commands/auto/FiveBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/FiveBallAutoMiddle.java) | Java | 12 | 13 | 4 | 29 | +| [src/main/java/frc4388/robot/commands/auto/SixBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/SixBallAutoMiddle.java) | Java | 16 | 14 | 6 | 36 | +| [src/main/java/frc4388/robot/commands/auto/TankDriveVelocity.java](/src/main/java/frc4388/robot/commands/auto/TankDriveVelocity.java) | Java | 42 | 14 | 12 | 68 | +| [src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java](/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java) | Java | 40 | 16 | 4 | 60 | +| [src/main/java/frc4388/robot/commands/auto/Wait.java](/src/main/java/frc4388/robot/commands/auto/Wait.java) | Java | 40 | 16 | 16 | 72 | +| [src/main/java/frc4388/robot/commands/climber/DisengageRachet.java](/src/main/java/frc4388/robot/commands/climber/DisengageRachet.java) | Java | 26 | 14 | 9 | 49 | +| [src/main/java/frc4388/robot/commands/climber/RunClimberWithTriggers.java](/src/main/java/frc4388/robot/commands/climber/RunClimberWithTriggers.java) | Java | 42 | 15 | 9 | 66 | +| [src/main/java/frc4388/robot/commands/climber/RunLevelerWithJoystick.java](/src/main/java/frc4388/robot/commands/climber/RunLevelerWithJoystick.java) | Java | 28 | 17 | 9 | 54 | +| [src/main/java/frc4388/robot/commands/drive/DrivePositionMPAux.java](/src/main/java/frc4388/robot/commands/drive/DrivePositionMPAux.java) | Java | 60 | 25 | 9 | 94 | +| [src/main/java/frc4388/robot/commands/drive/DriveStraightAtVelocityPID.java](/src/main/java/frc4388/robot/commands/drive/DriveStraightAtVelocityPID.java) | Java | 29 | 17 | 7 | 53 | +| [src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java](/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java) | Java | 56 | 22 | 9 | 87 | +| [src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java](/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java) | Java | 49 | 22 | 9 | 80 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java) | Java | 54 | 43 | 14 | 111 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystickAuxPID.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystickAuxPID.java) | Java | 48 | 17 | 13 | 78 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystickDriveStraight.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystickDriveStraight.java) | Java | 93 | 31 | 19 | 143 | +| [src/main/java/frc4388/robot/commands/drive/DriveWithJoystickUsingDeadAssistPID.java](/src/main/java/frc4388/robot/commands/drive/DriveWithJoystickUsingDeadAssistPID.java) | Java | 132 | 41 | 22 | 195 | +| [src/main/java/frc4388/robot/commands/drive/GotoCoordinatesFieldRelative.java](/src/main/java/frc4388/robot/commands/drive/GotoCoordinatesFieldRelative.java) | Java | 10 | 14 | 5 | 29 | +| [src/main/java/frc4388/robot/commands/drive/GotoCoordinatesRobotRelative.java](/src/main/java/frc4388/robot/commands/drive/GotoCoordinatesRobotRelative.java) | Java | 54 | 14 | 20 | 88 | +| [src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java](/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java) | Java | 28 | 16 | 9 | 53 | +| [src/main/java/frc4388/robot/commands/drive/SkipSong.java](/src/main/java/frc4388/robot/commands/drive/SkipSong.java) | Java | 32 | 14 | 11 | 57 | +| [src/main/java/frc4388/robot/commands/drive/TurnDegrees.java](/src/main/java/frc4388/robot/commands/drive/TurnDegrees.java) | Java | 41 | 16 | 17 | 74 | +| [src/main/java/frc4388/robot/commands/intake/RunExtenderOutIn.java](/src/main/java/frc4388/robot/commands/intake/RunExtenderOutIn.java) | Java | 46 | 16 | 16 | 78 | +| [src/main/java/frc4388/robot/commands/intake/RunIntake.java](/src/main/java/frc4388/robot/commands/intake/RunIntake.java) | Java | 25 | 14 | 8 | 47 | +| [src/main/java/frc4388/robot/commands/intake/RunIntakeWithTriggers.java](/src/main/java/frc4388/robot/commands/intake/RunIntakeWithTriggers.java) | Java | 36 | 19 | 9 | 64 | +| [src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java](/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java) | Java | 44 | 15 | 11 | 70 | +| [src/main/java/frc4388/robot/commands/shooter/HoodPositionPID.java](/src/main/java/frc4388/robot/commands/shooter/HoodPositionPID.java) | Java | 33 | 18 | 9 | 60 | +| [src/main/java/frc4388/robot/commands/shooter/PrepChecker.java](/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java) | Java | 28 | 14 | 11 | 53 | +| [src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java](/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java) | Java | 29 | 17 | 9 | 55 | +| [src/main/java/frc4388/robot/commands/shooter/ShootPrepGroup.java](/src/main/java/frc4388/robot/commands/shooter/ShootPrepGroup.java) | Java | 16 | 15 | 4 | 35 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java](/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java) | Java | 32 | 13 | 8 | 53 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterManual.java](/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java) | Java | 25 | 13 | 8 | 46 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java](/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java) | Java | 32 | 13 | 8 | 53 | +| [src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java](/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java) | Java | 37 | 15 | 10 | 62 | +| [src/main/java/frc4388/robot/commands/shooter/TrackTarget.java](/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java) | Java | 84 | 30 | 22 | 136 | +| [src/main/java/frc4388/robot/commands/shooter/TrimShooter.java](/src/main/java/frc4388/robot/commands/shooter/TrimShooter.java) | Java | 41 | 14 | 11 | 66 | +| [src/main/java/frc4388/robot/commands/storage/ManageStorage.java](/src/main/java/frc4388/robot/commands/storage/ManageStorage.java) | Java | 90 | 35 | 23 | 148 | +| [src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java](/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java) | Java | 86 | 33 | 24 | 143 | +| [src/main/java/frc4388/robot/commands/storage/RunStorage.java](/src/main/java/frc4388/robot/commands/storage/RunStorage.java) | Java | 25 | 14 | 8 | 47 | +| [src/main/java/frc4388/robot/commands/storage/StoragePrep.java](/src/main/java/frc4388/robot/commands/storage/StoragePrep.java) | Java | 33 | 14 | 8 | 55 | +| [src/main/java/frc4388/robot/subsystems/Camera.java](/src/main/java/frc4388/robot/subsystems/Camera.java) | Java | 24 | 15 | 6 | 45 | +| [src/main/java/frc4388/robot/subsystems/Climber.java](/src/main/java/frc4388/robot/subsystems/Climber.java) | Java | 58 | 20 | 16 | 94 | +| [src/main/java/frc4388/robot/subsystems/Drive.java](/src/main/java/frc4388/robot/subsystems/Drive.java) | Java | 506 | 275 | 148 | 929 | +| [src/main/java/frc4388/robot/subsystems/Intake.java](/src/main/java/frc4388/robot/subsystems/Intake.java) | Java | 36 | 36 | 14 | 86 | +| [src/main/java/frc4388/robot/subsystems/LED.java](/src/main/java/frc4388/robot/subsystems/LED.java) | Java | 44 | 32 | 12 | 88 | +| [src/main/java/frc4388/robot/subsystems/Leveler.java](/src/main/java/frc4388/robot/subsystems/Leveler.java) | Java | 29 | 18 | 11 | 58 | +| [src/main/java/frc4388/robot/subsystems/LimeLight.java](/src/main/java/frc4388/robot/subsystems/LimeLight.java) | Java | 18 | 10 | 8 | 36 | +| [src/main/java/frc4388/robot/subsystems/Pneumatics.java](/src/main/java/frc4388/robot/subsystems/Pneumatics.java) | Java | 50 | 27 | 14 | 91 | +| [src/main/java/frc4388/robot/subsystems/Shooter.java](/src/main/java/frc4388/robot/subsystems/Shooter.java) | Java | 73 | 38 | 32 | 143 | +| [src/main/java/frc4388/robot/subsystems/ShooterAim.java](/src/main/java/frc4388/robot/subsystems/ShooterAim.java) | Java | 108 | 31 | 39 | 178 | +| [src/main/java/frc4388/robot/subsystems/ShooterHood.java](/src/main/java/frc4388/robot/subsystems/ShooterHood.java) | Java | 65 | 20 | 23 | 108 | +| [src/main/java/frc4388/robot/subsystems/Storage.java](/src/main/java/frc4388/robot/subsystems/Storage.java) | Java | 84 | 33 | 28 | 145 | +| [src/main/java/frc4388/utility/Gains.java](/src/main/java/frc4388/utility/Gains.java) | Java | 33 | 28 | 5 | 66 | +| [src/main/java/frc4388/utility/LEDPatterns.java](/src/main/java/frc4388/utility/LEDPatterns.java) | Java | 30 | 10 | 6 | 46 | +| [src/main/java/frc4388/utility/ShooterTables.java](/src/main/java/frc4388/utility/ShooterTables.java) | Java | 125 | 15 | 31 | 171 | +| [src/main/java/frc4388/utility/Trims.java](/src/main/java/frc4388/utility/Trims.java) | Java | 9 | 6 | 3 | 18 | +| [src/main/java/frc4388/utility/controller/ButtonFox.java](/src/main/java/frc4388/utility/controller/ButtonFox.java) | Java | 8 | 10 | 3 | 21 | +| [src/main/java/frc4388/utility/controller/IHandController.java](/src/main/java/frc4388/utility/controller/IHandController.java) | Java | 10 | 3 | 9 | 22 | +| [src/main/java/frc4388/utility/controller/JoystickManualButton.java](/src/main/java/frc4388/utility/controller/JoystickManualButton.java) | Java | 24 | 22 | 8 | 54 | +| [src/main/java/frc4388/utility/controller/XboxController.java](/src/main/java/frc4388/utility/controller/XboxController.java) | Java | 151 | 26 | 46 | 223 | +| [src/main/java/frc4388/utility/controller/XboxTriggerButton.java](/src/main/java/frc4388/utility/controller/XboxTriggerButton.java) | Java | 55 | 8 | 6 | 69 | + +[summary](results.md) \ No newline at end of file diff --git a/.VSCodeCounter/results.csv b/.VSCodeCounter/results.csv new file mode 100644 index 0000000..bcfdb2f --- /dev/null +++ b/.VSCodeCounter/results.csv @@ -0,0 +1,85 @@ +filename, language, JSON, Java, CSS, comment, blank, total +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineBackward.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineForward.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid0.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid1.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid2.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\FiveBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid0.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid1.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\TenBallMidComplete.wpilib.json, JSON, 1, 0, 0, 0, 0, 1 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\GOAT DRIVERSTATION.json, JSON, 1014, 0, 0, 0, 0, 1014 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\themes\Ridgbotics\ridgeboticstheme.css, CSS, 0, 0, 8, 0, 1, 9 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Constants.java, Java, 0, 157, 0, 32, 41, 230 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Main.java, Java, 0, 9, 0, 16, 5, 30 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Robot.java, Java, 0, 59, 0, 63, 24, 146 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\RobotContainer.java, Java, 0, 312, 0, 145, 96, 553 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\InterruptSubystem.java, Java, 0, 21, 0, 14, 8, 43 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath1FromCenter.java, Java, 0, 22, 0, 19, 6, 47 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath2FromRight.java, Java, 0, 26, 0, 23, 6, 55 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineBackward.java, Java, 0, 13, 0, 14, 5, 32 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineForward.java, Java, 0, 11, 0, 14, 5, 30 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\EightBallAutoMiddle.java, Java, 0, 11, 0, 14, 5, 30 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\FiveBallAutoMiddle.java, Java, 0, 12, 0, 13, 4, 29 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\SixBallAutoMiddle.java, Java, 0, 16, 0, 14, 6, 36 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TankDriveVelocity.java, Java, 0, 42, 0, 14, 12, 68 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TenBallAutoMiddle.java, Java, 0, 40, 0, 16, 4, 60 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\Wait.java, Java, 0, 40, 0, 16, 16, 72 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\DisengageRachet.java, Java, 0, 26, 0, 14, 9, 49 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunClimberWithTriggers.java, Java, 0, 42, 0, 15, 9, 66 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunLevelerWithJoystick.java, Java, 0, 28, 0, 17, 9, 54 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DrivePositionMPAux.java, Java, 0, 60, 0, 25, 9, 94 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightAtVelocityPID.java, Java, 0, 29, 0, 17, 7, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionMM.java, Java, 0, 56, 0, 22, 9, 87 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionPID.java, Java, 0, 49, 0, 22, 9, 80 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystick.java, Java, 0, 54, 0, 43, 14, 111 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickAuxPID.java, Java, 0, 48, 0, 17, 13, 78 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickDriveStraight.java, Java, 0, 93, 0, 31, 19, 143 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickUsingDeadAssistPID.java, Java, 0, 132, 0, 41, 22, 195 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesFieldRelative.java, Java, 0, 10, 0, 14, 5, 29 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesRobotRelative.java, Java, 0, 54, 0, 14, 20, 88 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\PlaySongDrive.java, Java, 0, 28, 0, 16, 9, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\SkipSong.java, Java, 0, 32, 0, 14, 11, 57 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\TurnDegrees.java, Java, 0, 41, 0, 16, 17, 74 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunExtenderOutIn.java, Java, 0, 46, 0, 16, 16, 78 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntake.java, Java, 0, 25, 0, 14, 8, 47 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntakeWithTriggers.java, Java, 0, 36, 0, 19, 9, 64 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\CalibrateShooter.java, Java, 0, 44, 0, 15, 11, 70 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\HoodPositionPID.java, Java, 0, 33, 0, 18, 9, 60 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\PrepChecker.java, Java, 0, 28, 0, 14, 11, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\RunHoodWithJoystick.java, Java, 0, 29, 0, 17, 9, 55 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShootPrepGroup.java, Java, 0, 16, 0, 15, 4, 35 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterGoalPosition.java, Java, 0, 32, 0, 13, 8, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterManual.java, Java, 0, 25, 0, 13, 8, 46 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterTrenchPosition.java, Java, 0, 32, 0, 13, 8, 53 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterVelocityControlPID.java, Java, 0, 37, 0, 15, 10, 62 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrackTarget.java, Java, 0, 84, 0, 30, 22, 136 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrimShooter.java, Java, 0, 41, 0, 14, 11, 66 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStorage.java, Java, 0, 90, 0, 35, 23, 148 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStoragePID.java, Java, 0, 86, 0, 33, 24, 143 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\RunStorage.java, Java, 0, 25, 0, 14, 8, 47 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\StoragePrep.java, Java, 0, 33, 0, 14, 8, 55 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Camera.java, Java, 0, 24, 0, 15, 6, 45 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Climber.java, Java, 0, 58, 0, 20, 16, 94 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Drive.java, Java, 0, 506, 0, 275, 148, 929 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Intake.java, Java, 0, 36, 0, 36, 14, 86 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LED.java, Java, 0, 44, 0, 32, 12, 88 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Leveler.java, Java, 0, 29, 0, 18, 11, 58 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LimeLight.java, Java, 0, 18, 0, 10, 8, 36 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Pneumatics.java, Java, 0, 50, 0, 27, 14, 91 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Shooter.java, Java, 0, 73, 0, 38, 32, 143 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterAim.java, Java, 0, 108, 0, 31, 39, 178 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterHood.java, Java, 0, 65, 0, 20, 23, 108 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Storage.java, Java, 0, 84, 0, 33, 28, 145 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Gains.java, Java, 0, 33, 0, 28, 5, 66 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\LEDPatterns.java, Java, 0, 30, 0, 10, 6, 46 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\ShooterTables.java, Java, 0, 125, 0, 15, 31, 171 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Trims.java, Java, 0, 9, 0, 6, 3, 18 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\ButtonFox.java, Java, 0, 8, 0, 10, 3, 21 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\IHandController.java, Java, 0, 10, 0, 3, 9, 22 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\JoystickManualButton.java, Java, 0, 24, 0, 22, 8, 54 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxController.java, Java, 0, 151, 0, 26, 46, 223 +c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxTriggerButton.java, Java, 0, 55, 0, 8, 6, 69 +Total, -, 1025, 3855, 8, 1770, 1110, 7768 \ No newline at end of file diff --git a/.VSCodeCounter/results.md b/.VSCodeCounter/results.md new file mode 100644 index 0000000..47eec3f --- /dev/null +++ b/.VSCodeCounter/results.md @@ -0,0 +1,41 @@ +# Summary + +Date : 2020-03-13 19:46:18 + +Directory c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main + +Total : 83 files, 4888 codes, 1770 comments, 1110 blanks, all 7768 lines + +[details](details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| Java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| JSON | 12 | 1,025 | 0 | 0 | 1,025 | +| CSS | 1 | 8 | 0 | 1 | 9 | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| . | 83 | 4,888 | 1,770 | 1,110 | 7,768 | +| deploy | 11 | 11 | 0 | 0 | 11 | +| deploy\paths | 11 | 11 | 0 | 0 | 11 | +| driverStation | 2 | 1,022 | 0 | 1 | 1,023 | +| driverStation\themes | 1 | 8 | 0 | 1 | 9 | +| driverStation\themes\Ridgbotics | 1 | 8 | 0 | 1 | 9 | +| java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388 | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388\robot | 61 | 3,410 | 1,642 | 992 | 6,044 | +| java\frc4388\robot\commands | 45 | 1,778 | 831 | 475 | 3,084 | +| java\frc4388\robot\commands\auto | 10 | 233 | 157 | 69 | 459 | +| java\frc4388\robot\commands\climber | 3 | 96 | 46 | 27 | 169 | +| java\frc4388\robot\commands\drive | 13 | 686 | 292 | 164 | 1,142 | +| java\frc4388\robot\commands\intake | 3 | 107 | 49 | 33 | 189 | +| java\frc4388\robot\commands\shooter | 11 | 401 | 177 | 111 | 689 | +| java\frc4388\robot\commands\storage | 4 | 234 | 96 | 63 | 393 | +| java\frc4388\robot\subsystems | 12 | 1,095 | 555 | 351 | 2,001 | +| java\frc4388\utility | 9 | 445 | 128 | 117 | 690 | +| java\frc4388\utility\controller | 5 | 248 | 69 | 72 | 389 | + +[details](details.md) \ No newline at end of file diff --git a/.VSCodeCounter/results.txt b/.VSCodeCounter/results.txt new file mode 100644 index 0000000..78f07a1 --- /dev/null +++ b/.VSCodeCounter/results.txt @@ -0,0 +1,127 @@ +Date : 2020-03-13 19:46:18 +Directory : c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main +Total : 83 files, 4888 codes, 1770 comments, 1110 blanks, all 7768 lines + +Languages ++----------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------+------------+------------+------------+------------+------------+ +| Java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| JSON | 12 | 1,025 | 0 | 0 | 1,025 | +| CSS | 1 | 8 | 0 | 1 | 9 | ++----------+------------+------------+------------+------------+------------+ + +Directories ++-------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++-------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| . | 83 | 4,888 | 1,770 | 1,110 | 7,768 | +| deploy | 11 | 11 | 0 | 0 | 11 | +| deploy\paths | 11 | 11 | 0 | 0 | 11 | +| driverStation | 2 | 1,022 | 0 | 1 | 1,023 | +| driverStation\themes | 1 | 8 | 0 | 1 | 9 | +| driverStation\themes\Ridgbotics | 1 | 8 | 0 | 1 | 9 | +| java | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388 | 70 | 3,855 | 1,770 | 1,109 | 6,734 | +| java\frc4388\robot | 61 | 3,410 | 1,642 | 992 | 6,044 | +| java\frc4388\robot\commands | 45 | 1,778 | 831 | 475 | 3,084 | +| java\frc4388\robot\commands\auto | 10 | 233 | 157 | 69 | 459 | +| java\frc4388\robot\commands\climber | 3 | 96 | 46 | 27 | 169 | +| java\frc4388\robot\commands\drive | 13 | 686 | 292 | 164 | 1,142 | +| java\frc4388\robot\commands\intake | 3 | 107 | 49 | 33 | 189 | +| java\frc4388\robot\commands\shooter | 11 | 401 | 177 | 111 | 689 | +| java\frc4388\robot\commands\storage | 4 | 234 | 96 | 63 | 393 | +| java\frc4388\robot\subsystems | 12 | 1,095 | 555 | 351 | 2,001 | +| java\frc4388\utility | 9 | 445 | 128 | 117 | 690 | +| java\frc4388\utility\controller | 5 | 248 | 69 | 72 | 389 | ++-------------------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ + +Files ++-------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++-------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineBackward.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\DriveOffLineForward.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid0.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid1.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMid2.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\EightBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\FiveBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid0.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMid1.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\SixBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\deploy\paths\TenBallMidComplete.wpilib.json | JSON | 1 | 0 | 0 | 1 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\GOAT DRIVERSTATION.json | JSON | 1,014 | 0 | 0 | 1,014 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\driverStation\themes\Ridgbotics\ridgeboticstheme.css | CSS | 8 | 0 | 1 | 9 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Constants.java | Java | 157 | 32 | 41 | 230 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Main.java | Java | 9 | 16 | 5 | 30 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\Robot.java | Java | 59 | 63 | 24 | 146 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\RobotContainer.java | Java | 312 | 145 | 96 | 553 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\InterruptSubystem.java | Java | 21 | 14 | 8 | 43 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath1FromCenter.java | Java | 22 | 19 | 6 | 47 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\AutoPath2FromRight.java | Java | 26 | 23 | 6 | 55 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineBackward.java | Java | 13 | 14 | 5 | 32 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\DriveOffLineForward.java | Java | 11 | 14 | 5 | 30 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\EightBallAutoMiddle.java | Java | 11 | 14 | 5 | 30 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\FiveBallAutoMiddle.java | Java | 12 | 13 | 4 | 29 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\SixBallAutoMiddle.java | Java | 16 | 14 | 6 | 36 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TankDriveVelocity.java | Java | 42 | 14 | 12 | 68 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\TenBallAutoMiddle.java | Java | 40 | 16 | 4 | 60 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\auto\Wait.java | Java | 40 | 16 | 16 | 72 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\DisengageRachet.java | Java | 26 | 14 | 9 | 49 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunClimberWithTriggers.java | Java | 42 | 15 | 9 | 66 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\climber\RunLevelerWithJoystick.java | Java | 28 | 17 | 9 | 54 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DrivePositionMPAux.java | Java | 60 | 25 | 9 | 94 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightAtVelocityPID.java | Java | 29 | 17 | 7 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionMM.java | Java | 56 | 22 | 9 | 87 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveStraightToPositionPID.java | Java | 49 | 22 | 9 | 80 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystick.java | Java | 54 | 43 | 14 | 111 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickAuxPID.java | Java | 48 | 17 | 13 | 78 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickDriveStraight.java | Java | 93 | 31 | 19 | 143 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\DriveWithJoystickUsingDeadAssistPID.java | Java | 132 | 41 | 22 | 195 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesFieldRelative.java | Java | 10 | 14 | 5 | 29 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\GotoCoordinatesRobotRelative.java | Java | 54 | 14 | 20 | 88 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\PlaySongDrive.java | Java | 28 | 16 | 9 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\SkipSong.java | Java | 32 | 14 | 11 | 57 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\drive\TurnDegrees.java | Java | 41 | 16 | 17 | 74 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunExtenderOutIn.java | Java | 46 | 16 | 16 | 78 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntake.java | Java | 25 | 14 | 8 | 47 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\intake\RunIntakeWithTriggers.java | Java | 36 | 19 | 9 | 64 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\CalibrateShooter.java | Java | 44 | 15 | 11 | 70 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\HoodPositionPID.java | Java | 33 | 18 | 9 | 60 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\PrepChecker.java | Java | 28 | 14 | 11 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\RunHoodWithJoystick.java | Java | 29 | 17 | 9 | 55 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShootPrepGroup.java | Java | 16 | 15 | 4 | 35 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterGoalPosition.java | Java | 32 | 13 | 8 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterManual.java | Java | 25 | 13 | 8 | 46 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterTrenchPosition.java | Java | 32 | 13 | 8 | 53 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\ShooterVelocityControlPID.java | Java | 37 | 15 | 10 | 62 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrackTarget.java | Java | 84 | 30 | 22 | 136 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\shooter\TrimShooter.java | Java | 41 | 14 | 11 | 66 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStorage.java | Java | 90 | 35 | 23 | 148 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\ManageStoragePID.java | Java | 86 | 33 | 24 | 143 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\RunStorage.java | Java | 25 | 14 | 8 | 47 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\commands\storage\StoragePrep.java | Java | 33 | 14 | 8 | 55 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Camera.java | Java | 24 | 15 | 6 | 45 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Climber.java | Java | 58 | 20 | 16 | 94 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Drive.java | Java | 506 | 275 | 148 | 929 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Intake.java | Java | 36 | 36 | 14 | 86 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LED.java | Java | 44 | 32 | 12 | 88 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Leveler.java | Java | 29 | 18 | 11 | 58 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\LimeLight.java | Java | 18 | 10 | 8 | 36 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Pneumatics.java | Java | 50 | 27 | 14 | 91 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Shooter.java | Java | 73 | 38 | 32 | 143 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterAim.java | Java | 108 | 31 | 39 | 178 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\ShooterHood.java | Java | 65 | 20 | 23 | 108 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\robot\subsystems\Storage.java | Java | 84 | 33 | 28 | 145 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Gains.java | Java | 33 | 28 | 5 | 66 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\LEDPatterns.java | Java | 30 | 10 | 6 | 46 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\ShooterTables.java | Java | 125 | 15 | 31 | 171 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\Trims.java | Java | 9 | 6 | 3 | 18 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\ButtonFox.java | Java | 8 | 10 | 3 | 21 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\IHandController.java | Java | 10 | 3 | 9 | 22 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\JoystickManualButton.java | Java | 24 | 22 | 8 | 54 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxController.java | Java | 151 | 26 | 46 | 223 | +| c:\Users\Ridgebotics\Documents\GitHub\RiseOfRidgebotics2020\src\main\java\frc4388\utility\controller\XboxTriggerButton.java | Java | 55 | 8 | 6 | 69 | +| Total | | 4,888 | 1,770 | 1,110 | 7,768 | ++-------------------------------------------------------------------------------------------------------------------------------------------------+----------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/PathWeaver/Groups/TenBallAuto b/PathWeaver/Groups/TenBallAuto new file mode 100644 index 0000000..87ec839 --- /dev/null +++ b/PathWeaver/Groups/TenBallAuto @@ -0,0 +1,2 @@ +SixBallMidComplete +TenBallMidComplete diff --git a/PathWeaver/Paths/TenBallMidComplete b/PathWeaver/Paths/TenBallMidComplete index ead609f..a87ff34 100644 --- a/PathWeaver/Paths/TenBallMidComplete +++ b/PathWeaver/Paths/TenBallMidComplete @@ -1,6 +1,4 @@ X,Y,Tangent X,Tangent Y,Fixed Theta,Name -3.2,-2.4,0.2,2.5,true, -5.0,-1.1,3.0,0.0,true, 7.2,-1.1,1.5,0.0,true, 6.981146126504424,-1.7267749571307522,-0.16656954801462032,-0.6424825423421034,true, 6.766985279057057,-2.6072139966365975,-0.1189782485818709,-0.2974456214546768,true, diff --git a/README.md b/README.md index 9020b7f..df29521 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# Robot-Essentials - Basic code for any Ridgebotics robot project +# Rise-of-Ridgebotics +The codebase which never lost us a single match diff --git a/src/main/deploy/Robot Data - Distances.csv b/src/main/deploy/Robot Data - Distances.csv index a63fa24..e33cc7b 100644 --- a/src/main/deploy/Robot Data - Distances.csv +++ b/src/main/deploy/Robot Data - Distances.csv @@ -1,14 +1,7 @@ Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg) -1,10,8000,2 -70,21,8000,2, check -100,24,9000,2 -145,28,10000,1 -230,31,12000,0,Add a 270 -246,32,15000,0 -320,32,17000,0,change 17000 and mark them lower -331,33,17000,0 -397,33,16000,0 -415,33,16250,0 -436,31,18000,0 -500,33,18000,0 -501,33,18000,0 \ No newline at end of file +70,20,7000,2.5, +127,27,8467,2, +223,31.25,10398,2.75, +272,32.4,11776,2.5, +342,33,13733,2, +458,30.5,17000,0, \ No newline at end of file diff --git a/src/main/deploy/Robot Data - DistancesOLD.csv b/src/main/deploy/Robot Data - DistancesOLD.csv new file mode 100644 index 0000000..a15874a --- /dev/null +++ b/src/main/deploy/Robot Data - DistancesOLD.csv @@ -0,0 +1,8 @@ +Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg) +1,10,7769,0 +70,21,7769,0, check +100,24,8580,0 +145,28,9390,0 +230,31,11010,0,Add a 270 +397,33,14250,0 +415,33,14452,0 \ No newline at end of file diff --git a/src/main/driverStation/GOAT DRIVERSTATION.json b/src/main/driverStation/GOAT DRIVERSTATION.json new file mode 100644 index 0000000..e61f688 --- /dev/null +++ b/src/main/driverStation/GOAT DRIVERSTATION.json @@ -0,0 +1,1014 @@ +{ + "tabPane": [ + { + "title": "SmartDashboard", + "autoPopulate": true, + "autoPopulatePrefix": "SmartDashboard/", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/limelight_Stream", + "_title": "limelight_Stream" + } + }, + "1,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/limelight_PipelineName", + "_title": "limelight_PipelineName" + } + }, + "2,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/limelight_Interface", + "_title": "limelight_Interface" + } + }, + "3,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Auto?", + "_title": "Auto?" + } + }, + "4,0": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Pigeon Gyro", + "_title": "Pigeon Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "6,0": { + "size": [ + 3, + 2 + ], + "content": { + "_type": "Differential Drivebase", + "_source0": "network_table:///SmartDashboard/Drive Train", + "_title": "Drive Train", + "Wheels/Number of wheels": 4, + "Wheels/Wheel diameter": 80.0, + "Visuals/Show velocity vectors": true + } + }, + "9,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Position Raw", + "_title": "Left Motor Position Raw" + } + }, + "0,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Position Raw", + "_title": "Right Motor Position Raw" + } + }, + "1,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Average Motor Position Raw", + "_title": "Average Motor Position Raw" + } + }, + "2,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "Avg Speed MPH" + } + }, + "3,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Gear Shift", + "_title": "Gear Shift", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "9,1": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity", + "_title": "Drum Velocity" + } + }, + "0,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Drum Velocity CSV", + "_title": "Drum Velocity CSV" + } + }, + "1,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Temp C", + "_title": "Shooter Temp C" + } + }, + "2,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Shooter Current", + "_title": "Shooter Current" + } + }, + "3,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Drum Ready", + "_title": "Drum Ready", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Turret Angle Raw", + "_title": "Turret Angle Raw" + } + }, + "5,2": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "7,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Turret Aimed", + "_title": "Turret Aimed", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "8,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Fire Angle CSV", + "_title": "Fire Angle CSV" + } + }, + "9,2": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "Hood Angle Raw" + } + }, + "0,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Climber Safety", + "_title": "Climber Safety", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "1,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Rachet", + "_title": "Rachet", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "2,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Intake Beam", + "_title": "Intake Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "3,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Storage Beam", + "_title": "Storage Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Upper Beam", + "_title": "Upper Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "7,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Shooter Beam", + "_title": "Shooter Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "8,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Distance to Target", + "_title": "Distance to Target" + } + }, + "9,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball in Intake!", + "_title": "!Ball in Intake!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "0,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball Storage!", + "_title": "!Ball Storage!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "1,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/!Ball Shooter!", + "_title": "!Ball Shooter!", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "2,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Center Displacement", + "_title": "Center Displacement" + } + }, + "3,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Is Auto Start?", + "_title": "Is Auto Start?" + } + }, + "4,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/trajectoryPath Initial", + "_title": "trajectoryPath Initial" + } + }, + "5,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Pos Inches", + "_title": "Left Motor Pos Inches" + } + }, + "6,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Pos Inches", + "_title": "Right Motor Pos Inches" + } + }, + "7,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Left Motor Pos Meters", + "_title": "Left Motor Pos Meters" + } + }, + "8,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Right Motor Pos Meters", + "_title": "Right Motor Pos Meters" + } + }, + "9,4": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Odometry Values Meters", + "_title": "Odometry Values Meters" + } + }, + "0,5": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Text View", + "_source0": "network_table:///SmartDashboard/Trajectory Total Time", + "_title": "Trajectory Total Time" + } + } + } + } + }, + { + "title": "LiveWindow", + "autoPopulate": true, + "autoPopulatePrefix": "LiveWindow/", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Climber", + "_title": "Climber", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "2,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Ungrouped", + "_title": "Ungrouped", + "Layout/Label position": "BOTTOM", + "_children": [ + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Talon FX [5]", + "_title": "Talon FX [5]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Differential Drivebase", + "_source0": "network_table:///LiveWindow/Ungrouped/DifferentialDrive[1]", + "_title": "DifferentialDrive[1]", + "Wheels/Number of wheels": 4, + "Wheels/Wheel diameter": 80.0, + "Visuals/Show velocity vectors": true + }, + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Talon FX [3]", + "_title": "Talon FX [3]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Spark[0]", + "_title": "Spark[0]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Speed Controller", + "_source0": "network_table:///LiveWindow/Ungrouped/Talon FX [8]", + "_title": "Talon FX [8]", + "Visuals/Orientation": "HORIZONTAL" + }, + { + "_type": "Text View", + "_source0": "network_table:///LiveWindow/Ungrouped/Servo[4]/Value", + "_title": "Servo[4]/Value" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[3]/Value", + "_title": "DigitalInput[3]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[1]/Value", + "_title": "DigitalInput[1]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Text View", + "_source0": "network_table:///LiveWindow/Ungrouped/DoubleSolenoid[7,0]/Value", + "_title": "DoubleSolenoid[7,0]/Value" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[4]/Value", + "_title": "DigitalInput[4]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[2]/Value", + "_title": "DigitalInput[2]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Text View", + "_source0": "network_table:///LiveWindow/Ungrouped/DoubleSolenoid[7,3]/Value", + "_title": "DoubleSolenoid[7,3]/Value" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[13]/Value", + "_title": "DigitalInput[13]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[11]/Value", + "_title": "DigitalInput[11]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[14]/Value", + "_title": "DigitalInput[14]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + }, + { + "_type": "Boolean Box", + "_source0": "network_table:///LiveWindow/Ungrouped/DigitalInput[12]/Value", + "_title": "DigitalInput[12]/Value", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + ] + } + }, + "4,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/LimeLight", + "_title": "LimeLight", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "6,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Leveler", + "_title": "Leveler", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "8,0": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Drive", + "_title": "Drive", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "0,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Intake", + "_title": "Intake", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "2,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/ShooterHood", + "_title": "ShooterHood", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "4,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/LED", + "_title": "LED", + "Layout/Label position": "BOTTOM", + "_children": [] + } + }, + "6,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Shooter", + "_title": "Shooter", + "Layout/Label position": "BOTTOM", + "_children": [ + { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/ShooterHood", + "_title": "LiveWindow/ShooterHood", + "Layout/Label position": "BOTTOM", + "_children": [] + }, + { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/ShooterAim", + "_title": "LiveWindow/ShooterAim", + "Layout/Label position": "BOTTOM", + "_children": [] + } + ] + } + }, + "8,4": { + "size": [ + 2, + 4 + ], + "content": { + "_type": "Subsystem Layout", + "_source0": "network_table:///LiveWindow/Camera", + "_title": "Camera", + "Layout/Label position": "BOTTOM", + "_children": [] + } + } + } + } + }, + { + "title": "Driver Station", + "autoPopulate": false, + "autoPopulatePrefix": "", + "widgetPane": { + "gridSize": 128.0, + "showGrid": true, + "hgap": 16.0, + "vgap": 16.0, + "tiles": { + "0,0": { + "size": [ + 4, + 4 + ], + "content": { + "_type": "Camera Stream", + "_source0": "camera_server://front", + "_title": "front", + "Crosshair/Show crosshair": true, + "Crosshair/Crosshair color": "#FFFFFFFF", + "Controls/Show controls": true, + "Controls/Rotation": "NONE", + "compression": -1.0, + "fps": -1, + "imageWidth": 0, + "imageHeight": 0 + } + }, + "3,4": { + "size": [ + 5, + 5 + ], + "content": { + "_type": "Camera Stream", + "_source0": "camera_server://limelight", + "_title": "limelight", + "Crosshair/Show crosshair": true, + "Crosshair/Crosshair color": "#FFFFFFFF", + "Controls/Show controls": true, + "Controls/Rotation": "NONE", + "compression": -1.0, + "fps": -1, + "imageWidth": 0, + "imageHeight": 0 + } + }, + "8,4": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Drum Velocity", + "_title": "SmartDashboard/Drum Velocity", + "Range/Min": 0.0, + "Range/Max": 20000.0, + "Visuals/Show value": true + } + }, + "4,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Gear Shift", + "_title": "Gear Shift", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Rachet", + "_title": "Rachet", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "6,3": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Climber Safety", + "_title": "Climber Safety", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,1": { + "size": [ + 3, + 2 + ], + "content": { + "_type": "Differential Drivebase", + "_source0": "network_table:///SmartDashboard/Drive Train", + "_title": "SmartDashboard/Drive Train", + "Wheels/Number of wheels": 4, + "Wheels/Wheel diameter": 80.0, + "Visuals/Show velocity vectors": true + } + }, + "8,8": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Turret Aimed", + "_title": "/SmartDashboard/Turret Aimed", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "9,8": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Drum Ready", + "_title": "/SmartDashboard/Drum Ready", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "6,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Upper Beam", + "_title": "/SmartDashboard/Upper Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "5,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Storage Beam", + "_title": "/SmartDashboard/Storage Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "7,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Shooter Beam", + "_title": "/SmartDashboard/Shooter Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "4,0": { + "size": [ + 1, + 1 + ], + "content": { + "_type": "Boolean Box", + "_source0": "network_table:///SmartDashboard/Intake Beam", + "_title": "/SmartDashboard/Intake Beam", + "Colors/Color when true": "#7CFC00FF", + "Colors/Color when false": "#8B0000FF" + } + }, + "8,6": { + "size": [ + 2, + 2 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Turret Angle", + "_title": "SmartDashboard/Turret Angle", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "7,1": { + "size": [ + 3, + 3 + ], + "content": { + "_type": "Gyro", + "_source0": "network_table:///SmartDashboard/Pigeon Gyro", + "_title": "SmartDashboard/Pigeon Gyro", + "Visuals/Major tick spacing": 45.0, + "Visuals/Starting angle": 180.0, + "Visuals/Show tick mark ring": true, + "Visuals/Counter clockwise": false + } + }, + "8,0": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Avg Speed MPH", + "_title": "SmartDashboard/Avg Speed MPH", + "Range/Min": 0.0, + "Range/Max": 100.0, + "Visuals/Show value": true + } + }, + "8,5": { + "size": [ + 2, + 1 + ], + "content": { + "_type": "Simple Dial", + "_source0": "network_table:///SmartDashboard/Hood Angle Raw", + "_title": "SmartDashboard/Hood Angle Raw", + "Range/Min": 0.0, + "Range/Max": 66.0, + "Visuals/Show value": true + } + } + } + } + } + ], + "windowGeometry": { + "x": -6.400000095367432, + "y": 1.600000023841858, + "width": 1547.199951171875, + "height": 828.7999877929688 + } +} \ No newline at end of file diff --git a/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css b/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css new file mode 100644 index 0000000..cb762ec --- /dev/null +++ b/src/main/driverStation/themes/Ridgbotics/ridgeboticstheme.css @@ -0,0 +1,9 @@ +@import "/edu/wpi/first/shuffleboard/app/midnight.css"; + +.root{ + -swatch-100: #66FF66; + -swatch-200: #4DFF4D; + -swatch-300: #1AFF1A; + -swatch-400: #00CC00; + -swatch-500: #009900; +} \ No newline at end of file diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index 357d94c..e38438d 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -120,8 +120,9 @@ public final class Constants { public static final int SHOOTER_SLOT_IDX = 0; public static final int SHOOTER_PID_LOOP_IDX = 1; public static final int SHOOTER_TIMEOUT_MS = 30; - public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.55, 0.0, 100, 0.0, 0, 1.0); - public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.0, 0.0, 0.0, 0.0, 0, 1.0); + public static final Gains DRUM_SHOOTER_GAINS = new Gains(1.5, 0.0, 100, 0.055, 0, 1.0); + //public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.55, 0.0, 100, 0.0, 0, 1.0); + public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.6, 0.0, 0.0, 0.0, 0, 1.0); public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3); public static final double SHOOTER_TURRET_MIN = -1.0; public static final double ENCODER_TICKS_PER_REV = 2048; @@ -135,12 +136,16 @@ public final class Constants { public static final int TURRET_LEFT_SOFT_LIMIT = -55; public static final double TURRET_SPEED_MULTIPLIER = 0.3; public static final double TURRET_CALIBRATE_SPEED = 0.075; + public static final double TURRET_MOTOR_ROTS_PER_ROT = 101.04972; //89.56696; + public static final double TURRET_MOTOR_POS_AT_ZERO_ROT = -28.452166; public static final int HOOD_UP_SOFT_LIMIT = 33; public static final int HOOD_DOWN_SOFT_LIMIT = 3; public static final double HOOD_CONVERT_SLOPE = 0.47; public static final double HOOD_CONVERT_B = 40.5; public static final double HOOD_CALIBRATE_SPEED = 0.2; + public static final double HOOD_MOTOR_ROTS_PER_ROT = 1; //TODO: Find + public static final double HOOD_MOTOR_POS_AT_ZERO_ROT = 0; //TODO: Find public static final double DRUM_RAMP_LIMIT = 1000; public static final double DRUM_VELOCITY_BOUND = 300; @@ -166,7 +171,7 @@ public final class Constants { public static final int STORAGE_CAN_ID = 11; public static final double STORAGE_PARTIAL_BALL = 2; public static final double STORAGE_FULL_BALL = 7; - public static final double STORAGE_SPEED = 1.0; + public static final double STORAGE_SPEED = 0.5; public static final double STORAGE_TIMEOUT = 3000; /* Storage Characteristics */ @@ -208,9 +213,9 @@ public final class Constants { public static final double FOV = 29.8; //Field of view of limelight public static final double TARGET_HEIGHT = 71.5; public static final double LIME_ANGLE = 24.7; - public static final double TURN_P_VALUE = 0.6; + public static final double TURN_P_VALUE = 0.8; public static final double X_ANGLE_ERROR = 1.3; - public static final double MOTOR_DEAD_ZONE = 0.3; + public static final double MOTOR_DEAD_ZONE = 0.2; public static final double DISTANCE_ERROR_EQUATION_M = 1.1279; public static final double DISTANCE_ERROR_EQUATION_B = -15.0684; public static final double GRAV = 385.83; @@ -233,5 +238,6 @@ public final class Constants { public static final class OIConstants { public static final int XBOX_DRIVER_ID = 0; public static final int XBOX_OPERATOR_ID = 1; + public static final int BUTTON_FOX_ID = 2; } } diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index 283cea7..66745cf 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -49,14 +49,24 @@ import frc4388.robot.commands.climber.RunClimberWithTriggers; import frc4388.robot.commands.climber.RunLevelerWithJoystick; import frc4388.robot.commands.drive.DriveStraightAtVelocityPID; import frc4388.robot.commands.drive.DriveWithJoystick; +import frc4388.robot.commands.drive.PlaySongDrive; +import frc4388.robot.commands.drive.SkipSong; import frc4388.robot.commands.drive.TurnDegrees; import frc4388.robot.commands.intake.RunIntakeWithTriggers; import frc4388.robot.commands.shooter.CalibrateShooter; +import frc4388.robot.commands.shooter.TrackTarget; +import frc4388.robot.commands.shooter.TrimShooter; +import frc4388.robot.commands.shooter.RunHoodWithJoystick; import frc4388.robot.commands.shooter.ShootPrepGroup; +import frc4388.robot.commands.shooter.ShooterGoalPosition; +import frc4388.robot.commands.shooter.ShooterManual; +import frc4388.robot.commands.shooter.ShooterTrenchPosition; +import frc4388.robot.commands.shooter.ShooterVelocityControlPID; import frc4388.robot.commands.shooter.TrackTarget; import frc4388.robot.commands.shooter.TrimShooter; import frc4388.robot.commands.storage.ManageStorage; import frc4388.robot.commands.storage.ManageStorage.StorageMode; +import frc4388.robot.commands.storage.StoragePrep; import frc4388.robot.subsystems.Camera; import frc4388.robot.subsystems.Climber; import frc4388.robot.subsystems.Drive; @@ -69,7 +79,10 @@ import frc4388.robot.subsystems.Shooter; import frc4388.robot.subsystems.ShooterAim; import frc4388.robot.subsystems.ShooterHood; import frc4388.robot.subsystems.Storage; +import frc4388.robot.subsystems.Storage.StorageMode; +import frc4388.utility.controller.ButtonFox; import frc4388.utility.controller.IHandController; +import frc4388.utility.controller.JoystickManualButton; import frc4388.utility.controller.XboxController; /** @@ -98,11 +111,12 @@ public class RobotContainer { private final LimeLight m_robotLime = new LimeLight(); /* Controllers */ - private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); - private final XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); - private final Joystick m_joystick = new Joystick(0); public boolean isGS = false; + private static XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID); + private static XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID); + private static XboxController m_buttonFox = new XboxController(OIConstants. BUTTON_FOX_ID); + private static XboxController m_manualXbox = new XboxController(3); /* Autos */ double m_totalTimeAuto; @@ -137,17 +151,19 @@ public class RobotContainer { GalacticSearch m_galacticSearch; + public static boolean m_isShooterManual = false; + /** * The container for the robot. Contains subsystems, OI devices, and commands. */ public RobotContainer() { /* Passing Drive and Pneumatics Subsystems */ m_robotPneumatics.passRequiredSubsystem(m_robotDrive); - m_robotDrive.passRequiredSubsystem(m_robotPneumatics); + m_robotDrive.passRequiredSubsystem(m_robotPneumatics, m_robotShooter); m_robotShooter.passRequiredSubsystem(m_robotShooterHood, m_robotShooterAim); m_robotShooterHood.passRequiredSubsystem(m_robotShooter); - m_robotShooterAim.passRequiredSubsystem(m_robotShooter); + m_robotShooterAim.passRequiredSubsystem(m_robotShooter, m_robotDrive); m_robotLeveler.passRequiredSubsystem(m_robotClimber); @@ -166,6 +182,8 @@ public class RobotContainer { m_robotIntake.setDefaultCommand(new RunIntakeWithTriggers(m_robotIntake, getOperatorController())); // runs the turret with joystick m_robotShooterAim.setDefaultCommand(new RunCommand(() -> m_robotShooterAim.runShooterWithInput(-m_operatorXbox.getLeftXAxis()), m_robotShooterAim)); + // runs the hood with joystick + m_robotShooterHood.setDefaultCommand(new RunHoodWithJoystick(m_robotShooterHood, getOperatorController())); // moves the drum not m_robotShooter.setDefaultCommand(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(0), m_robotShooter)); // drives climber with input from triggers on the opperator controller @@ -176,7 +194,7 @@ public class RobotContainer { m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED)); // runs the storage not //m_robotStorage.setDefaultCommand(new RunCommand(() -> m_robotStorage.runStorage(0), m_robotStorage)); - m_robotStorage.setDefaultCommand(new ManageStorage(m_robotStorage, StorageMode.IDLE)); + m_robotStorage.setDefaultCommand(new ManageStorage(m_robotStorage)); //m_robotLime.setDefaultCommand(new RunCommand(() -> m_robotLime.limeOff(), m_robotLime)); } @@ -189,8 +207,6 @@ public class RobotContainer { private void configureButtonBindings() { /* Test Buttons */ // A driver test button - new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON) - .whenPressed(new DriveStraightAtVelocityPID(m_robotDrive, 1000)); // B driver test button new JoystickButton(getDriverJoystick(), XboxController.B_BUTTON) @@ -218,6 +234,9 @@ public class RobotContainer { new JoystickButton(getDriverJoystick(), XboxController.BACK_BUTTON) .whileHeld(new DisengageRachet(m_robotClimber)); + + + /* Operator Buttons */ // shoots until released new JoystickButton(getOperatorJoystick(), XboxController.RIGHT_BUMPER_BUTTON) @@ -268,36 +287,100 @@ public class RobotContainer { new JoystickButton(getOperatorJoystick(), XboxController.START_BUTTON) .whileHeld(new CalibrateShooter(m_robotShooter, m_robotShooterAim, m_robotShooterHood)); - //Prepares storage for intaking - //new XboxTriggerButton(m_operatorXbox, XboxTriggerButton.LEFT_TRIGGER) - //.whileHeld(new RunCommand(() -> m_robotStorage.runStorage(0.8))) - //.whenReleased(new RunCommand(() -> m_robotStorage.runStorage(0.0))); - //.whileHeld(new StorageIntake(m_robotIntake, m_robotStorage)); - - //Runs storage to outtake - //new XboxTriggerButton(m_operatorXbox, XboxTriggerButton.RIGHT_TRIGGER) - //.whileHeld(new RunCommand(() -> m_robotStorage.runStorage(-0.8))) - //.whenReleased(new RunCommand(() -> m_robotStorage.runStorage(0.0))); //Run drum - new JoystickButton(getOperatorJoystick(), XboxController.B_BUTTON) + new JoystickManualButton(getOperatorJoystick(), XboxController.B_BUTTON, false) .whileHeld(new ShootPrepGroup(m_robotShooter, m_robotShooterAim, m_robotShooterHood, m_robotStorage), false) //.whenReleased(new ManageStorage(m_robotStorage, StorageMode.RESET)) .whenReleased(new InstantCommand(() -> m_robotLime.limeOff())); - new JoystickButton(m_joystick, 1) - .whenPressed(new IdentifyPath(m_robotLime)); + //Run drum manual + new JoystickManualButton(getOperatorJoystick(), XboxController.B_BUTTON, true) + .whileHeld(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(10000))) + .whenReleased(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(0))); + + + + /* Button Fox */ + // Storage Manual + new JoystickButton(getButtonFox(), ButtonFox.LEFT_SWITCH) + .whenPressed(new InstantCommand(() -> m_robotStorage.changeStorageMode(StorageMode.MANUAL))) + .whenReleased(new InstantCommand(() -> m_robotStorage.changeStorageMode(StorageMode.RESET))); + + // Meg + new JoystickButton(getButtonFox(), ButtonFox.MIDDLE_SWITCH) + .whileHeld(new PlaySongDrive(m_robotDrive, m_robotShooter)) + .whenReleased(new InterruptSubystem(m_robotDrive)); + + // Shooter Manual + new JoystickButton(getButtonFox(), ButtonFox.RIGHT_SWITCH) + .whileHeld(new ShooterManual(true)) + .whenReleased(new ShooterManual(false)); + + // Goal Shooter Position + new JoystickButton(getButtonFox(), ButtonFox.RIGHT_BUTTON) + .whileHeld(new PlaySongDrive(m_robotDrive, m_robotShooter)) + .whenReleased(new InterruptSubystem(m_robotDrive)); + + // Trench Shooter Position + new JoystickButton(getButtonFox(), ButtonFox.LEFT_BUTTON) + .whileHeld(new ShooterTrenchPosition(m_robotShooter, m_robotShooterHood, m_robotShooterAim)) + .whenReleased(new InterruptSubystem(m_robotShooter)) + .whenReleased(new InterruptSubystem(m_robotShooterHood)) + .whenReleased(new InterruptSubystem(m_robotShooterAim)); + //.whenPressed(new SkipSong(m_robotDrive, 1)); } public void buildAutos() { + //resetOdometry(new Pose2d(0, 0, new Rotation2d(180))); + + String[] sixBallAutoMiddlePaths = new String[]{ + "SixBallMidComplete" + }; + + m_sixBallAutoMiddle = new SixBallAutoMiddle(m_robotDrive, buildPaths(sixBallAutoMiddlePaths)); + + String[] eightBallAutoMiddlePaths = new String[]{ + "EightBallMidComplete" + }; + + m_eightBallAutoMiddle = new EightBallAutoMiddle(m_robotDrive, buildPaths(eightBallAutoMiddlePaths)); + + String[] driveOffLineForwardPaths = new String[]{ + "DriveOffLineForward" + }; + + m_driveOffLineForward = new DriveOffLineForward(m_robotDrive, buildPaths(driveOffLineForwardPaths)); + + String[] driveOffLineBackwardPaths = new String[]{ + "DriveOffLineBackward" + }; + + m_driveOffLineBackward = new DriveOffLineBackward(m_robotDrive, buildPaths(driveOffLineBackwardPaths)); + + String[] fiveBallAutoMiddlePaths = new String[]{ + "FiveBallMidComplete" + }; + + m_fiveBallAutoMiddle = new FiveBallAutoMiddle(m_robotDrive, buildPaths(fiveBallAutoMiddlePaths)); + + String[] tenBallAutoMiddlePaths = new String[]{ + "SixBallMidComplete", + "TenBallMidComplete" + }; + + m_tenBallAutoMiddle = new TenBallAutoMiddle(m_robotShooterHood, m_robotStorage, m_robotIntake, m_robotShooter, + m_robotShooterAim, m_robotDrive,buildPaths(tenBallAutoMiddlePaths)); + String[] galacticSearchPaths = new String[]{ - "GSC_ARED", - "GSC_ABLUE", - "GSC_BRED", - "GSC_BBLUE" + "GSC_ARED", + "GSC_ABLUE", + "GSC_BRED", + "GSC_BBLUE" }; idenPath(); m_galacticSearch = new GalacticSearch(m_robotLime, m_robotIntake, buildPaths(galacticSearchPaths)); + } public void idenPath() @@ -321,7 +404,7 @@ public class RobotContainer { //return m_sixBallAutoMiddle1.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_eightBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_driveOffLineForward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); - //return m_driveOffLineBackward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); + //return m_driveOffLinfeBackward.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_fiveBallAutoMiddle.andThen(() -> m_robotDrive.tankDriveVelocity(0, 0)); //return m_tenBallAutoMiddle.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); //return m_slalom.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0)); @@ -330,6 +413,7 @@ public class RobotContainer { //return m_sequentialTest.andThen(() -> m_robotDrive.tankDriveVelocity(0,0)); return m_galacticSearch.andThen(() -> m_robotDrive.tankDriveVelocity(0,0)); + } catch (Exception e) { System.err.println("ERROR"); } @@ -451,6 +535,12 @@ public class RobotContainer { return m_operatorXbox; } + public IHandController getButtonFoxObject() + { + return m_buttonFox; + } + + /** * Gets the {@link edu.wpi.first.wpilibj.GenericHID#GenericHID(int) Generic HID} for the Operator Xbox Controller. * Generic HIDs/Joysticks can be used to set up JoystickButtons. @@ -470,4 +560,15 @@ public class RobotContainer { { return m_driverXbox.getJoyStick(); } + + /** + * Gets the {@link edu.wpi.first.wpilibj.GenericHID#GenericHID(int) Generic HID} for the Button Fox. + * Generic HIDs/Joysticks can be used to set up JoystickButtons. + * @return The IHandController interface for the Button Fox. + */ + public Joystick getButtonFox() + { + return m_buttonFox.getJoyStick(); + } + } diff --git a/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java b/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java index 7ff19da..28ae59c 100644 --- a/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java +++ b/src/main/java/frc4388/robot/commands/auto/TenBallAutoMiddle.java @@ -7,9 +7,21 @@ package frc4388.robot.commands.auto; +import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup; import edu.wpi.first.wpilibj2.command.RamseteCommand; +import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; +import frc4388.robot.Constants.IntakeConstants; +import frc4388.robot.commands.shooter.CalibrateShooter; +import frc4388.robot.commands.shooter.PrepChecker; +import frc4388.robot.commands.shooter.ShootPrepGroup; +import frc4388.robot.commands.storage.RunStorage; import frc4388.robot.subsystems.Drive; +import frc4388.robot.subsystems.Intake; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; +import frc4388.robot.subsystems.ShooterHood; +import frc4388.robot.subsystems.Storage; // NOTE: Consider using this command inline, rather than writing a subclass. For more // information, see: @@ -18,11 +30,30 @@ public class TenBallAutoMiddle extends SequentialCommandGroup { /** * Creates a new TenBallAutoMiddle. */ - public TenBallAutoMiddle(Drive drive, RamseteCommand[] paths) { + public TenBallAutoMiddle(ShooterHood shooterHood, Storage storage, Intake intake, Shooter shooter, ShooterAim shooterAim, Drive drive, RamseteCommand[] paths) { // Add your commands in the super() call, e.g. // super(new FooCommand(), new BarCommand()); addCommands( - paths[0] + new ParallelDeadlineGroup( + new Wait(drive, 0.1, 0), + new CalibrateShooter(shooter, shooterAim, shooterHood) + ), + new ParallelDeadlineGroup( + new Wait(drive, 1, 0), + new RunCommand(() -> shooterAim.runShooterWithInput(-0.75), shooterAim) + ), + new ParallelDeadlineGroup( + new Wait(drive, 4, 0), + new PrepChecker(shooter, shooterAim), + new RunCommand(() -> intake.runExtender(IntakeConstants.EXTENDER_SPEED), intake), + new ShootPrepGroup(shooter, shooterAim, shooterHood, storage) + ), + new ParallelDeadlineGroup( + new ShootPrepGroup(shooter, shooterAim, shooterHood, storage), + new RunStorage(storage) + ) + //paths[0], + //paths[1] ); } } diff --git a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java index a2be80e..1ec57b0 100644 --- a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java +++ b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionMM.java @@ -33,9 +33,9 @@ public class DriveStraightToPositionMM extends CommandBase { m_pneumatics = subsystem2; try { if (m_pneumatics.m_isSpeedShiftHigh) { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH; } else { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW; } } catch (Exception e) { System.err.println("Error In Motion Magic Switch Gains."); diff --git a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java index 337ff6d..b910380 100644 --- a/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java +++ b/src/main/java/frc4388/robot/commands/drive/DriveStraightToPositionPID.java @@ -31,9 +31,9 @@ public class DriveStraightToPositionPID extends CommandBase { m_pneumatics = subsystem2; try { if (m_pneumatics.m_isSpeedShiftHigh) { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_HIGH; } else { - m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW * 2; + m_targetPosIn = targetPos * DriveConstants.TICKS_PER_INCH_LOW; } } catch (Exception e) { System.err.println("Error In Motion Magic Switch Gains."); diff --git a/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java b/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java index 75ab279..b2aba9c 100644 --- a/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java +++ b/src/main/java/frc4388/robot/commands/drive/DriveWithJoystick.java @@ -94,7 +94,7 @@ public class DriveWithJoystick extends CommandBase { } */ - m_drive.driveWithInput(moveOutput, steerOutput); + m_drive.driveWithInput(-moveOutput, steerOutput); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java b/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java index eaa0f07..10a99ee 100644 --- a/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java +++ b/src/main/java/frc4388/robot/commands/drive/PlaySongDrive.java @@ -9,6 +9,7 @@ package frc4388.robot.commands.drive; import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.subsystems.Drive; +import frc4388.robot.subsystems.Shooter; public class PlaySongDrive extends CommandBase { private Drive m_drive; @@ -16,10 +17,10 @@ public class PlaySongDrive extends CommandBase { /** * Creates a new PlaySongDrive. */ - public PlaySongDrive(Drive subsystem) { + public PlaySongDrive(Drive subsystem, Shooter shooter) { // Use addRequirements() here to declare subsystem dependencies. m_drive = subsystem; - addRequirements(m_drive); + addRequirements(m_drive, shooter); } // Called when the command is initially scheduled. diff --git a/src/main/java/frc4388/robot/commands/drive/SkipSong.java b/src/main/java/frc4388/robot/commands/drive/SkipSong.java new file mode 100644 index 0000000..0d020a1 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/drive/SkipSong.java @@ -0,0 +1,56 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.robot.commands.drive; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Drive; + +public class SkipSong extends CommandBase { + Drive m_drive; + int m_index; + + /** + * Creates a new SkipSong. + */ + public SkipSong(Drive m_robotDrive, int index) { + // Use addRequirements() here to declare subsystem dependencies. + m_drive = m_robotDrive; + m_index = index; + } + + // 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() { + String[] songs = m_drive.songsStrings; + String song = m_drive.m_currentSong; + + for (int i = 0; i < songs.length; i++) { + if (songs[i] == song) { + m_drive.selectSong(songs[i + m_index]); + break; + } + } + } + + // 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 true; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java b/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java index 23be5fa..5e28114 100644 --- a/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java +++ b/src/main/java/frc4388/robot/commands/shooter/CalibrateShooter.java @@ -7,6 +7,7 @@ package frc4388.robot.commands.shooter; +import com.revrobotics.CANDigitalInput.LimitSwitchPolarity; import com.revrobotics.CANSparkMax.SoftLimitDirection; import edu.wpi.first.wpilibj2.command.CommandBase; @@ -59,6 +60,10 @@ public class CalibrateShooter extends CommandBase { // Returns true when the command should end. @Override public boolean isFinished() { + if (m_shooterAim.m_shooterRotateMotor.getReverseLimitSwitch(LimitSwitchPolarity.kNormallyOpen).get() && + m_shooterHood.m_angleAdjustMotor.getReverseLimitSwitch(LimitSwitchPolarity.kNormallyOpen).get()) { + return true; + } return false; } } diff --git a/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java b/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java new file mode 100644 index 0000000..cc978fd --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/PrepChecker.java @@ -0,0 +1,52 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; + +public class PrepChecker extends CommandBase { + Shooter m_shooter; + ShooterAim m_shooterAim; + + /** + * Creates a new PrepChecker. + */ + public PrepChecker(Shooter shooter, ShooterAim shooterAim) { + // Use addRequirements() here to declare subsystem dependencies. + m_shooter = shooter; + m_shooterAim = shooterAim; + } + + // 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() { + + } + + // 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() { + if (m_shooterAim.m_isAimReady && m_shooter.m_isDrumReady) { + return true; + } + + return false; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java b/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java new file mode 100644 index 0000000..f406e04 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/RunHoodWithJoystick.java @@ -0,0 +1,54 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Leveler; +import frc4388.robot.subsystems.ShooterHood; +import frc4388.utility.controller.IHandController; + +public class RunHoodWithJoystick extends CommandBase { + private ShooterHood m_hood; + private IHandController m_controller; + + /** + * Creates a new RunLevelerWithJoystick to control the leveler with an Xbox controller. + * @param subsystem pass the Hood subsystem from {@link frc4388.robot.RobotContainer#RobotContainer() RobotContainer} + * @param controller pass the Operator {@link frc4388.utility.controller.IHandController#getClass() IHandController} using the + * {@link frc4388.robot.RobotContainer#getOperatorJoystick() getOperatorJoystick()} method in + * {@link frc4388.robot.RobotContainer#RobotContainer() RobotContainer} + */ + public RunHoodWithJoystick(ShooterHood subsystem, IHandController controller) { + m_hood = subsystem; + m_controller = controller; + addRequirements(m_hood); + } + + // 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() { + double input = m_controller.getRightYAxis(); + m_hood.runHood(input); + } + + // 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; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java b/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java new file mode 100644 index 0000000..b750c66 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterGoalPosition.java @@ -0,0 +1,52 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; +import frc4388.robot.subsystems.ShooterHood; + +public class ShooterGoalPosition extends CommandBase { + Shooter m_shooter; + ShooterHood m_hood; + ShooterAim m_aim; + /** + * Creates a new ShooterGoalPosition. + */ + public ShooterGoalPosition(Shooter shooterSub, ShooterHood hoodSub, ShooterAim aimSub) { + m_shooter = shooterSub; + m_hood = hoodSub; + m_aim = aimSub; + addRequirements(m_shooter,m_hood,m_aim); + } + + // 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() { + m_shooter.runDrumShooterVelocityPID(5000); + m_hood.runAngleAdjustPID(3); + m_aim.runshooterRotatePID(-26.5); + } + + // 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; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java b/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java new file mode 100644 index 0000000..2017ff4 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterManual.java @@ -0,0 +1,45 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj.XboxController; +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.RobotContainer; + +public class ShooterManual extends CommandBase { + public boolean isManual = false; + /** + * Creates a new ShooterManual. + */ + public ShooterManual(boolean man) { + isManual = man; + } + + // 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() { + RobotContainer.m_isShooterManual = isManual; + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + RobotContainer.m_isShooterManual = isManual; + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java b/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java new file mode 100644 index 0000000..ba452b7 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterTrenchPosition.java @@ -0,0 +1,52 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.robot.commands.shooter; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.subsystems.Shooter; +import frc4388.robot.subsystems.ShooterAim; +import frc4388.robot.subsystems.ShooterHood; + +public class ShooterTrenchPosition extends CommandBase { + Shooter m_shooter; + ShooterHood m_hood; + ShooterAim m_aim; + /** + * Creates a new ShooterTrenchPosition. + */ + public ShooterTrenchPosition(Shooter shooterSub, ShooterHood hoodSub, ShooterAim aimSub) { + m_shooter = shooterSub; + m_hood = hoodSub; + m_aim = aimSub; + addRequirements(m_shooter,m_hood,m_aim); + } + + // 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() { + m_shooter.runDrumShooterVelocityPID(5000); + m_hood.runAngleAdjustPID(3); + m_aim.runshooterRotatePID(-26.5); + } + + // 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; + } +} diff --git a/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java b/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java index 75a6896..b3d3ac1 100644 --- a/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java +++ b/src/main/java/frc4388/robot/commands/shooter/ShooterVelocityControlPID.java @@ -34,7 +34,18 @@ public class ShooterVelocityControlPID extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - m_shooter.runDrumShooterVelocityPID(m_shooter.addFireVel()); + //Tells whether the target velocity has been reached + m_actualVel = m_shooter.m_shooterFalcon.getSelectedSensorPosition(); + m_targetVel = m_shooter.addFireVel(); + double error = m_actualVel - m_targetVel; + if (Math.abs(error) < ShooterConstants.DRUM_VELOCITY_BOUND){ + m_shooter.m_isDrumReady = true; + m_shooter.runDrumShooterVelocityPID(m_targetVel); + } + else{ + m_shooter.m_isDrumReady = false; + m_shooter.runDrumShooterVelocityPID(m_targetVel); + } } // Called once the command ends or is interrupted. @@ -45,16 +56,6 @@ public class ShooterVelocityControlPID extends CommandBase { // Returns true when the command should end. @Override public boolean isFinished() { - //Tells whether the target velocity has been reached - double upperBound = m_targetVel + ShooterConstants.DRUM_VELOCITY_BOUND; - double lowerBound = m_targetVel - ShooterConstants.DRUM_VELOCITY_BOUND; - if (m_actualVel < upperBound && m_actualVel > lowerBound){ - m_shooter.m_isDrumReady = true; - } - else{ - m_shooter.m_isDrumReady = false; - } - return false; } } diff --git a/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java b/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java index 3d0f9a0..cf4afcc 100644 --- a/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java +++ b/src/main/java/frc4388/robot/commands/shooter/TrackTarget.java @@ -111,6 +111,7 @@ public class TrackTarget extends CommandBase { m_shooter.m_fireVel = fireVel; m_shooterHood.m_fireAngle = fireAngle;// + m_shooter.shooterTrims.m_hoodTrim; + m_shooterAim.m_targetDistance = distance; } } diff --git a/src/main/java/frc4388/robot/commands/storage/ManageStorage.java b/src/main/java/frc4388/robot/commands/storage/ManageStorage.java index 68cfd71..8b55380 100644 --- a/src/main/java/frc4388/robot/commands/storage/ManageStorage.java +++ b/src/main/java/frc4388/robot/commands/storage/ManageStorage.java @@ -11,6 +11,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.Constants.StorageConstants; import frc4388.robot.subsystems.Storage; +import frc4388.robot.subsystems.Storage.StorageMode; public class ManageStorage extends CommandBase { Storage m_storage; @@ -26,17 +27,13 @@ public class ManageStorage extends CommandBase { /* Used for intaking a ball. Keeps track off when the 2nd ball in storage has moved */ boolean m_isStorageEmpty = true; - - public enum StorageMode{IDLE, INTAKE, RESET}; - StorageMode m_storageMode = StorageMode.IDLE; /** * Creates a new ManageStorage. */ - public ManageStorage(Storage m_robotStorage, StorageMode storageMode) { + public ManageStorage(Storage m_robotStorage) { // Use addRequirements() here to declare subsystem dependencies. m_storage = m_robotStorage; - m_storageMode = storageMode; addRequirements(m_storage); } @@ -50,7 +47,7 @@ public class ManageStorage extends CommandBase { m_isStorageEmpty = !m_isBallInStorage; - if (m_storageMode == StorageMode.RESET) { + if (m_storage.m_storageMode == StorageMode.RESET) { m_resetStartTime = System.currentTimeMillis(); } } @@ -68,12 +65,14 @@ public class ManageStorage extends CommandBase { SmartDashboard.putBoolean("!Ball Storage!", m_isBallInStorage); SmartDashboard.putBoolean("!Ball Shooter!", m_isBallInShooter); - if (m_storageMode == StorageMode.IDLE) { + if (m_storage.m_storageMode == StorageMode.IDLE) { runIdle(); - } else if (m_storageMode == StorageMode.INTAKE) { + } else if (m_storage.m_storageMode == StorageMode.INTAKE) { runIntake(); - } else if (m_storageMode == StorageMode.RESET) { + } else if (m_storage.m_storageMode == StorageMode.RESET) { runReset(); + } else if (m_storage.m_storageMode == StorageMode.MANUAL) { + runManual(); } } @@ -91,10 +90,10 @@ public class ManageStorage extends CommandBase { } if (m_isStorageEmpty && m_isBallInStorage) { // If Ball moves into storage, set storage to full and swtich to idle mode m_isStorageEmpty = false; - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } else { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } @@ -106,7 +105,7 @@ public class ManageStorage extends CommandBase { m_storage.runStorage(0); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); } m_isStorageEmpty = !m_isBallInStorage; } @@ -120,17 +119,24 @@ public class ManageStorage extends CommandBase { m_storage.runStorage(-StorageConstants.STORAGE_SPEED); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); } else if (m_resetStartTime + StorageConstants.STORAGE_TIMEOUT < System.currentTimeMillis()) { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } m_isStorageEmpty = !m_isBallInStorage; } + /** + * Switches Storage to Manual only + */ + private void runManual() { + m_storage.runStorage(0); + } + // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - m_storageMode = StorageMode.RESET; + m_storage.changeStorageMode(StorageMode.RESET); } // Returns true when the command should end. diff --git a/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java b/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java index 6ed4fd3..97ff356 100644 --- a/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java +++ b/src/main/java/frc4388/robot/commands/storage/ManageStoragePID.java @@ -11,6 +11,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.CommandBase; import frc4388.robot.Constants.StorageConstants; import frc4388.robot.subsystems.Storage; +import frc4388.robot.subsystems.Storage.StorageMode; public class ManageStoragePID extends CommandBase { Storage m_storage; @@ -30,16 +31,13 @@ public class ManageStoragePID extends CommandBase { /* Used for intaking a ball. Keeps track off when the 2nd ball in storage has moved */ boolean m_isStorageEmpty = true; - public enum StorageMode{IDLE, INTAKE, RESET}; - StorageMode m_storageMode = StorageMode.IDLE; /** * Creates a new ManageStorage. */ - public ManageStoragePID(Storage m_robotStorage, StorageMode storageMode) { + public ManageStoragePID(Storage m_robotStorage) { // Use addRequirements() here to declare subsystem dependencies. m_storage = m_robotStorage; - m_storageMode = storageMode; addRequirements(m_storage); } @@ -55,7 +53,7 @@ public class ManageStoragePID extends CommandBase { m_intakeStartPos = m_storage.getEncoderPosInches(); - if (m_storageMode == StorageMode.RESET) { + if (m_storage.m_storageMode == StorageMode.RESET) { m_resetStartTime = System.currentTimeMillis(); } } @@ -73,11 +71,11 @@ public class ManageStoragePID extends CommandBase { SmartDashboard.putBoolean("!Ball Storage!", m_isBallInStorage); SmartDashboard.putBoolean("!Ball Shooter!", m_isBallInShooter); - if (m_storageMode == StorageMode.IDLE) { + if (m_storage.m_storageMode == StorageMode.IDLE) { runIdle(); - } else if (m_storageMode == StorageMode.INTAKE) { + } else if (m_storage.m_storageMode == StorageMode.INTAKE) { runIntake(); - } else if (m_storageMode == StorageMode.RESET) { + } else if (m_storage.m_storageMode == StorageMode.RESET) { runReset(); } } @@ -93,10 +91,10 @@ public class ManageStoragePID extends CommandBase { double error = (m_intakeStartPos + StorageConstants.STORAGE_FULL_BALL) - m_storage.getEncoderPosInches(); if (m_storage.getEncoderVel() == 0 && Math.abs(error) < 0.5) { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } else { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } } @@ -108,7 +106,7 @@ public class ManageStoragePID extends CommandBase { m_storage.runStorage(0); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); m_intakeStartPos = m_storage.getEncoderPosInches(); } m_isStorageEmpty = !m_isBallInStorage; @@ -123,10 +121,10 @@ public class ManageStoragePID extends CommandBase { m_storage.runStorage(-StorageConstants.STORAGE_SPEED); if (m_isBallInIntake) { - m_storageMode = StorageMode.INTAKE; + m_storage.changeStorageMode(StorageMode.INTAKE); m_intakeStartPos = m_storage.getEncoderPosInches(); } else if (m_resetStartTime + StorageConstants.STORAGE_TIMEOUT < System.currentTimeMillis()) { - m_storageMode = StorageMode.IDLE; + m_storage.changeStorageMode(StorageMode.IDLE); } m_isStorageEmpty = !m_isBallInStorage; } @@ -134,7 +132,7 @@ public class ManageStoragePID extends CommandBase { // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - m_storageMode = StorageMode.RESET; + m_storage.changeStorageMode(StorageMode.RESET); } // Returns true when the command should end. diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 3d04763..8640dca 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -54,6 +54,7 @@ public class Drive extends SubsystemBase { /* Pneumatics Subsystem */ public Pneumatics m_pneumaticsSubsystem; + Shooter m_shooter; /* Low Gear Gains */ public static Gains m_gainsDistanceLow = DriveConstants.DRIVE_DISTANCE_GAINS_LOW; @@ -96,7 +97,8 @@ public class Drive extends SubsystemBase { SendableChooser m_songChooser = new SendableChooser(); /* Misc */ - String m_currentSong = ""; + public String m_currentSong = ""; + public String[] songsStrings; /** * Add your docs here. @@ -196,6 +198,8 @@ public class Drive extends SubsystemBase { m_rightFrontMotor.configSelectedFeedbackSensor(FeedbackDevice.SensorDifference, DriveConstants.PID_PRIMARY, DriveConstants.DRIVE_TIMEOUT_MS); + m_rightFrontMotor.configSelectedFeedbackCoefficient(0.5, DriveConstants.PID_PRIMARY, DriveConstants.DRIVE_TIMEOUT_MS); + /* * Configure the Pigeon IMU to the other Remote Slot available on the right * Talon @@ -281,11 +285,12 @@ public class Drive extends SubsystemBase { /* Create chooser to choose song to play */ File songsDir = new File(Filesystem.getDeployDirectory().getAbsolutePath() + "/songs"); System.err.println(songsDir.getPath()); - String[] songsStrings = songsDir.list(); + songsStrings = songsDir.list(); for (String songString : songsStrings) { m_songChooser.addOption(songString, songsDir.getAbsolutePath() + "/" + songString); } Shuffleboard.getTab("Songs").add(m_songChooser); + selectSong(songsStrings[0]); /* Start counting time */ m_lastTimeMs = System.currentTimeMillis(); @@ -304,8 +309,10 @@ public class Drive extends SubsystemBase { * * @param subsystem Subsystem needed. */ - public void passRequiredSubsystem(Pneumatics subsystem) { + public void passRequiredSubsystem(Pneumatics subsystem, Shooter shooter) { m_pneumaticsSubsystem = subsystem; + m_shooter = shooter; + m_orchestra.addInstrument(m_shooter.m_shooterFalcon); } public void updateTime() { @@ -709,6 +716,16 @@ public class Drive extends SubsystemBase { return meters * DriveConstants.INCHES_PER_METER; } + /** + * Converts a value in inches per second to miles per hour + * @param ips The value in inches per second to convert + * @return The value in miles per hour + */ + public double inchesPerSecondToMilesPerHour(double ips) { + double mph = ips * (3600) * (1/63360); + return mph; + } + public void setRightMotorGains(boolean isHighGear) { if (!isHighGear) { m_rightFrontMotor.selectProfileSlot(DriveConstants.SLOT_VELOCITY, DriveConstants.PID_PRIMARY); @@ -828,6 +845,7 @@ public class Drive extends SubsystemBase { public void updateSmartDashboard() { try { + // SmartDashboard.putNumber("Pigeon Yaw", getGyroYaw()); // SmartDashboard.putNumber("Pigeon Pitch", getGyroPitch()); // SmartDashboard.putNumber("Pigeon Roll", getGyroRoll()); @@ -835,6 +853,14 @@ public class Drive extends SubsystemBase { SmartDashboard.putData("Pigeon Gyro", m_pigeonGyro); SmartDashboard.putData("Drive Train", m_driveTrain); + SmartDashboard.putNumber("Left Motor Position Raw", m_leftFrontMotor.getSensorCollection().getIntegratedSensorPosition()); + SmartDashboard.putNumber("Right Motor Position Raw", m_rightFrontMotor.getSensorCollection().getIntegratedSensorPosition()); + + SmartDashboard.putNumber("Average Motor Position Raw", m_rightFrontMotor.getSelectedSensorPosition(DriveConstants.PID_PRIMARY)); + + double avgSpeedMPH = inchesPerSecondToMilesPerHour(10 * ticksToInches(m_rightFrontMotor.getSelectedSensorVelocity(DriveConstants.PID_PRIMARY))); + + SmartDashboard.putNumber("Avg Speed MPH", avgSpeedMPH); //SmartDashboard.putNumber("Left Front Output", m_leftFrontMotor.get()); //SmartDashboard.putNumber("Right Front Output", m_rightFrontMotor.get()); @@ -849,8 +875,6 @@ public class Drive extends SubsystemBase { //SmartDashboard.putNumber("Left Back Motor Velocity Raw", m_leftBackMotor.getSelectedSensorVelocity()); //SmartDashboard.putNumber("Right Back Motor Velocity Raw", m_rightBackMotor.getSelectedSensorVelocity()); - //SmartDashboard.putNumber("Left Motor Position Raw", m_leftFrontMotor.getSelectedSensorPosition()); - //SmartDashboard.putNumber("Right Motor Position Raw", m_rightFrontMotor.getSelectedSensorPosition(0)); //SmartDashboard.putNumber("Right Motor Velocity Int Sensor", m_rightFrontMotor.getSensorCollection().getIntegratedSensorVelocity()); //SmartDashboard.putNumber("Left Motor Velocity Int Sensor", m_leftFrontMotor.getSensorCollection().getIntegratedSensorVelocity()); @@ -889,12 +913,13 @@ public class Drive extends SubsystemBase { SmartDashboard.putString("Odometry Values Meters", getPose().toString()); //SmartDashboard.putNumber("Odometry Heading", getHeading()); - SmartDashboard.putNumber("Time Seconds", m_currentTimeSec); - SmartDashboard.putNumber("Delta Time", m_deltaTimeMs); + //SmartDashboard.putNumber("Time Seconds", m_currentTimeSec); + //SmartDashboard.putNumber("Delta Time", m_deltaTimeMs); if (m_currentSong != m_songChooser.getSelected()){ m_currentSong = m_songChooser.getSelected(); selectSong(m_currentSong); + //System.err.println(m_currentSong); } } catch (Exception e) { @@ -902,4 +927,6 @@ public class Drive extends SubsystemBase { // e.printStackTrace(System.err); } } + + } diff --git a/src/main/java/frc4388/robot/subsystems/Shooter.java b/src/main/java/frc4388/robot/subsystems/Shooter.java index 1b7a0c2..890e0f7 100644 --- a/src/main/java/frc4388/robot/subsystems/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/Shooter.java @@ -54,7 +54,7 @@ public class Shooter extends SubsystemBase { m_shooterFalcon.setNeutralMode(NeutralMode.Coast); m_shooterFalcon.setInverted(true); m_shooterFalcon.configOpenloopRamp(1, ShooterConstants.SHOOTER_TIMEOUT_MS); - m_shooterFalcon.configClosedloopRamp(1.0, ShooterConstants.SHOOTER_TIMEOUT_MS); + m_shooterFalcon.configClosedloopRamp(0.75, ShooterConstants.SHOOTER_TIMEOUT_MS); setShooterGains(); m_shooterFalcon.configPeakOutputReverse(0, ShooterConstants.SHOOTER_TIMEOUT_MS); @@ -83,17 +83,15 @@ public class Shooter extends SubsystemBase { public void periodic() { // This method will be called once per scheduler run try{ - SmartDashboard.putNumber("Drum Velocity", m_shooterFalcon.getSelectedSensorVelocity()); + SmartDashboard.putNumber("Drum Velocity", m_shooterFalcon.getSelectedSensorVelocity()); - SmartDashboard.putNumber("Drum Velocity CSV", m_fireVel); + SmartDashboard.putNumber("Drum Velocity CSV", m_fireVel); - SmartDashboard.putNumber("Shooter Temp C", m_shooterFalcon.getTemperature()); + SmartDashboard.putNumber("Shooter Temp C", m_shooterFalcon.getTemperature()); - SmartDashboard.putNumber("Shooter Current", m_shooterFalcon.getSupplyCurrent()); + SmartDashboard.putNumber("Shooter Current", m_shooterFalcon.getSupplyCurrent()); - //SmartDashboard.putNumber("Hood Position", m_shooter.getAnglePosition()); - - SmartDashboard.putBoolean("Drum Ready" , m_isDrumReady); + SmartDashboard.putBoolean("Drum Ready" , m_isDrumReady); } catch(Exception e) diff --git a/src/main/java/frc4388/robot/subsystems/ShooterAim.java b/src/main/java/frc4388/robot/subsystems/ShooterAim.java index 424175c..db9d231 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterAim.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterAim.java @@ -17,6 +17,7 @@ import com.revrobotics.CANSparkMax.SoftLimitDirection; import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.ControlType; +import edu.wpi.first.wpilibj.GyroBase; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc4388.robot.Constants.ShooterConstants; @@ -24,10 +25,14 @@ import frc4388.utility.Gains; public class ShooterAim extends SubsystemBase { public Shooter m_shooterSubsystem; + public Drive m_driveSubsystem; public CANSparkMax m_shooterRotateMotor = new CANSparkMax(ShooterConstants.SHOOTER_ROTATE_ID, MotorType.kBrushless); public static Gains m_shooterTurretGains = ShooterConstants.SHOOTER_TURRET_GAINS; CANDigitalInput m_shooterRightLimit, m_shooterLeftLimit; + public GyroBase m_turretGyro; + + public double m_targetDistance = 0; public boolean m_isAimReady = false; @@ -42,6 +47,8 @@ public class ShooterAim extends SubsystemBase { //resetGyroShooterRotate(); m_shooterRotateMotor.setIdleMode(IdleMode.kBrake); + m_turretGyro = getGyroInterface(); + m_shooterLeftLimit = m_shooterRotateMotor.getReverseLimitSwitch(LimitSwitchPolarity.kNormallyOpen); m_shooterRightLimit = m_shooterRotateMotor.getForwardLimitSwitch(LimitSwitchPolarity.kNormallyOpen); m_shooterRightLimit.enableLimitSwitch(true); @@ -58,6 +65,10 @@ public class ShooterAim extends SubsystemBase { @Override public void periodic() { // This method will be called once per scheduler run + SmartDashboard.putNumber("Turret Angle Raw", getShooterRotatePosition()); + + SmartDashboard.putData("Turret Angle", m_turretGyro); + SmartDashboard.putBoolean("Turret Aimed" , m_isAimReady); } @@ -65,8 +76,9 @@ public class ShooterAim extends SubsystemBase { * Passes subsystem needed. * @param subsystem Subsystem needed. */ - public void passRequiredSubsystem(Shooter subsystem) { - m_shooterSubsystem = subsystem; + public void passRequiredSubsystem(Shooter subsystem0, Drive subsystem1) { + m_shooterSubsystem = subsystem0; + m_driveSubsystem = subsystem1; } public void runShooterWithInput(double input) { @@ -98,6 +110,68 @@ public class ShooterAim extends SubsystemBase { public double getShooterRotatePosition() { - return m_shooterRotateMotor.getEncoder().getPosition(); + return m_shooterRotateEncoder.getPosition(); + } + + public double getShooterAngleDegrees() { + return (m_shooterRotateEncoder.getPosition() - ShooterConstants.TURRET_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.TURRET_MOTOR_ROTS_PER_ROT; + } + + /** + * Gets the angle of the Shooter relative to the target. + */ + public double getTargetAngleDegrees() { + return m_driveSubsystem.getHeading() + getShooterAngleDegrees(); + } + + public double getTargetXDisplacement() { + return m_targetDistance * Math.cos(getTargetAngleDegrees()); + } + + public double getTargetYDisplacement() { + return m_targetDistance * Math.sin(getTargetAngleDegrees()); + } + + /** + * Gets the angle of the Shooter relative to the inner port. + * Use for tuning the Shooter Displacement + */ + public double getInnerPortAngleDegrees() { + return Math.atan( getTargetYDisplacement() / (getTargetXDisplacement() + 29.25) ); + } + + public GyroBase getGyroInterface() { + return new GyroBase(){ + + @Override + public void close() throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void reset() { + // TODO Auto-generated method stub + + } + + @Override + public double getRate() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public double getAngle() { + // TODO Auto-generated method stub + return getShooterAngleDegrees(); + } + + @Override + public void calibrate() { + // TODO Auto-generated method stub + + } + }; } } diff --git a/src/main/java/frc4388/robot/subsystems/ShooterHood.java b/src/main/java/frc4388/robot/subsystems/ShooterHood.java index c177c38..94b37f0 100644 --- a/src/main/java/frc4388/robot/subsystems/ShooterHood.java +++ b/src/main/java/frc4388/robot/subsystems/ShooterHood.java @@ -58,6 +58,8 @@ public class ShooterHood extends SubsystemBase { public void periodic() { // This method will be called once per scheduler run SmartDashboard.putNumber("Fire Angle CSV", m_fireAngle); + + SmartDashboard.putNumber("Hood Angle Raw", getAnglePositionDegrees()); } /** @@ -86,6 +88,11 @@ public class ShooterHood extends SubsystemBase { m_angleAdjustPIDController.setReference(targetAngle, ControlType.kPosition); } + public void runHood(double input) + { + m_angleAdjustMotor.set(input); + } + public void resetGyroAngleAdj(){ m_angleEncoder.setPosition(0); } @@ -93,4 +100,8 @@ public class ShooterHood extends SubsystemBase { public double getAnglePosition(){ return m_angleEncoder.getPosition(); } + + public double getAnglePositionDegrees(){ + return ((m_angleEncoder.getPosition() - ShooterConstants.HOOD_MOTOR_POS_AT_ZERO_ROT) * 360/ShooterConstants.HOOD_MOTOR_ROTS_PER_ROT) - 90; + } } diff --git a/src/main/java/frc4388/robot/subsystems/Storage.java b/src/main/java/frc4388/robot/subsystems/Storage.java index 403de25..98bc3b3 100644 --- a/src/main/java/frc4388/robot/subsystems/Storage.java +++ b/src/main/java/frc4388/robot/subsystems/Storage.java @@ -36,6 +36,9 @@ public class Storage extends SubsystemBase { public boolean m_isStorageReadyToFire = false; + public enum StorageMode{IDLE, INTAKE, RESET, MANUAL}; + public StorageMode m_storageMode = StorageMode.IDLE; + /** * Creates a new Storage. */ @@ -134,4 +137,8 @@ public class Storage extends SubsystemBase { public boolean getBeamIntake(){ return m_beamIntake.get(); } + + public void changeStorageMode(StorageMode storageMode){ + m_storageMode = storageMode; + } } diff --git a/src/main/java/frc4388/utility/controller/ButtonFox.java b/src/main/java/frc4388/utility/controller/ButtonFox.java new file mode 100644 index 0000000..5b4da00 --- /dev/null +++ b/src/main/java/frc4388/utility/controller/ButtonFox.java @@ -0,0 +1,20 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.utility.controller; + +/** + * button fox + * @author Ryan Manley + */ +public class ButtonFox { + public static final int RIGHT_SWITCH = 1; + public static final int MIDDLE_SWITCH = 2; + public static final int LEFT_SWITCH = 3; + public static final int RIGHT_BUTTON = 4; + public static final int LEFT_BUTTON = 5; +} diff --git a/src/main/java/frc4388/utility/controller/JoystickManualButton.java b/src/main/java/frc4388/utility/controller/JoystickManualButton.java new file mode 100644 index 0000000..53db6f4 --- /dev/null +++ b/src/main/java/frc4388/utility/controller/JoystickManualButton.java @@ -0,0 +1,54 @@ +/*----------------------------------------------------------------------------*/ +/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */ +/* Open Source Software - may be modified and shared by FRC teams. The code */ +/* must be accompanied by the FIRST BSD license file in the root directory of */ +/* the project. */ +/*----------------------------------------------------------------------------*/ + +package frc4388.utility.controller; + +import edu.wpi.first.wpilibj.GenericHID; +import edu.wpi.first.wpilibj2.command.button.Button; +import frc4388.robot.RobotContainer; + +import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam; + +/** + * A {@link Button} that gets its state from a {@link GenericHID}. + */ +public class JoystickManualButton extends Button { + private final GenericHID m_joystick; + private final int m_buttonNumber; + private boolean m_buttonType; + + /** + * Creates a joystick button for triggering commands. + * + * @param joystick The GenericHID object that has the button (e.g. Joystick, + * KinectStick, etc) + * @param buttonNumber The button number (see + * {@link GenericHID#getRawButton(int) } + */ + public JoystickManualButton(GenericHID joystick, int buttonNumber, boolean buttonType) { + requireNonNullParam(joystick, "joystick", "JoystickButton"); + + m_joystick = joystick; + m_buttonNumber = buttonNumber; + m_buttonType = buttonType; + } + + /** + * Gets the value of the joystick button. + * + * @return The value of the joystick button + */ + @Override + public boolean get() { + boolean m = RobotContainer.m_isShooterManual; + if (m_buttonType == m) { + return m_joystick.getRawButton(m_buttonNumber); + } else { + return false; + } + } +} diff --git a/src/main/java/frc4388/utility/controller/XboxController.java b/src/main/java/frc4388/utility/controller/XboxController.java index 4353d1e..38c4736 100644 --- a/src/main/java/frc4388/utility/controller/XboxController.java +++ b/src/main/java/frc4388/utility/controller/XboxController.java @@ -60,6 +60,10 @@ public class XboxController implements IHandController m_stick = new Joystick(portNumber); } + public void setJoystick(Joystick joy) { + m_stick = joy; + } + /** * @return Joystick for Xbox Controller */