From 19b043aa82a8bf173b75094d610b96a030392206 Mon Sep 17 00:00:00 2001 From: BLlakers Date: Sat, 6 Apr 2024 16:52:25 -0400 Subject: [PATCH 1/7] Intial Outline for how I will comment everything. --- src/main/java/frc/robot/Constants.java | 4 ++ .../java/frc/robot/Other/Explanations.java | 37 +++++++++++ src/main/java/frc/robot/Robot.java | 4 ++ src/main/java/frc/robot/RobotContainer.java | 4 ++ .../AprilAlignToSpeakerRadiallyCommand.java | 3 + .../AprilAlignToTransformCommand.java | 3 + .../java/frc/robot/commands/AutoIntake.java | 61 ++----------------- .../java/frc/robot/commands/AutoShooter.java | 4 ++ .../robot/commands/OrientShooterAngle.java | 4 ++ .../OrientShooterAngleByEncoderValue.java | 4 ++ .../robot/commands/SwerveDriveCommand.java | 4 ++ .../java/frc/robot/subsystems/DriveTrain.java | 5 ++ .../java/frc/robot/subsystems/Hanger.java | 22 ++++++- .../frc/robot/subsystems/HangerModule.java | 4 ++ .../java/frc/robot/subsystems/Intake.java | 3 + .../frc/robot/subsystems/IntakeWheels.java | 3 + .../java/frc/robot/subsystems/Limelight.java | 4 ++ .../java/frc/robot/subsystems/Shooter.java | 3 + .../frc/robot/subsystems/SwerveModule.java | 3 + 19 files changed, 122 insertions(+), 57 deletions(-) create mode 100644 src/main/java/frc/robot/Other/Explanations.java diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 261c744..965065c 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -154,4 +154,8 @@ public class RobotVersion2024 implements RobotVersionConstants { } public static final RobotVersion defaultRobotVersion = RobotVersion.v2024; + + public interface ConstantsExplanation{ + + } } diff --git a/src/main/java/frc/robot/Other/Explanations.java b/src/main/java/frc/robot/Other/Explanations.java new file mode 100644 index 0000000..d9274fe --- /dev/null +++ b/src/main/java/frc/robot/Other/Explanations.java @@ -0,0 +1,37 @@ +package frc.robot.Other; +import frc.robot.subsystems.*; +import frc.robot.commands.*; + +/** Here, Explanations of How everything works are held. + * When Within The class: + * EX: int {@link #DriveTrainExplanation} (Blue) = DriveTrain (Green).Explanation (Yellow) */ +public class Explanations { + + int DriveTrainExplanation = DriveTrain.Explanation(); + + int HangerExplanation = Hanger.Explanation(); + + + + + + + + + + + + + + + + + + + + + +} \ No newline at end of file diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index 5f28f59..1364366 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -74,4 +74,8 @@ public void simulationInit() {} @Override public void simulationPeriodic() {} + + public interface RobotExplanation{ + + } } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 4c7d03b..19001af 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -320,4 +320,8 @@ public Command getAutonomousCommand() { return autoCommand.beforeStarting( () -> m_DriveTrain.resetPose(new Pose2d(1.27, 5.55, new Rotation2d()))); } + + public interface RobotContainerExplanation{ + + } } diff --git a/src/main/java/frc/robot/commands/AprilAlignToSpeakerRadiallyCommand.java b/src/main/java/frc/robot/commands/AprilAlignToSpeakerRadiallyCommand.java index e1eec59..365794b 100644 --- a/src/main/java/frc/robot/commands/AprilAlignToSpeakerRadiallyCommand.java +++ b/src/main/java/frc/robot/commands/AprilAlignToSpeakerRadiallyCommand.java @@ -147,4 +147,7 @@ public boolean RobotIsWithinGoalRadius() { public boolean isFinished() { return omegaController.atGoal() && RobotIsWithinGoalRadius(); } + public interface AprilAlignToSpeakerRadiallyCommandExplanation{ + + } } diff --git a/src/main/java/frc/robot/commands/AprilAlignToTransformCommand.java b/src/main/java/frc/robot/commands/AprilAlignToTransformCommand.java index cc913ac..6203cf7 100644 --- a/src/main/java/frc/robot/commands/AprilAlignToTransformCommand.java +++ b/src/main/java/frc/robot/commands/AprilAlignToTransformCommand.java @@ -144,4 +144,7 @@ public void end(boolean interrupted) { public boolean isFinished() { return m_rotController.atGoal() && m_xController.atGoal() && m_yController.atGoal(); } + public interface AprilAlignToSpeakerTransformCommandExplanation{ + + } } diff --git a/src/main/java/frc/robot/commands/AutoIntake.java b/src/main/java/frc/robot/commands/AutoIntake.java index c8f9fb5..e1674a8 100644 --- a/src/main/java/frc/robot/commands/AutoIntake.java +++ b/src/main/java/frc/robot/commands/AutoIntake.java @@ -54,35 +54,7 @@ public void SetIsAmpFlag(boolean isAmp) {} @Override public void execute() { - // System.out.println(m_CurrentIntakeDrivingState); - /* - * if (m_IsAmp == true) { - * m_CurrentIntakeDrivingState = DrivingState.DriveIntakeAmp; - * if (m_Intake.GetIntakeMotorAngle().getDegrees() < Intake.PosAmpAngle + - * s_IntakePositioningTolerence) { - * m_Intake.RaiseIntake(); - * } else if (m_Intake.GetIntakeMotorAngle().getDegrees() > Intake.PosAmpAngle - - * s_IntakePositioningTolerence) { - * m_Intake.LowerIntake(); - * } else if (m_Intake.GetIntakeMotorAngle().getDegrees() < Intake.PosAmpAngle + - * s_IntakePositioningTolerence - * && m_Intake.GetIntakeMotorAngle().getDegrees() > Intake.PosAmpAngle - - * s_IntakePositioningTolerence) { - * m_Intake.StopIntake(); - * m_CommandIsFinished = true; - * } - * - * } - * - * - * - * - * - * - * else - */ if (m_CurrentIntakeDrivingState == DrivingState.DriveIntakeDown) { - // if (m_Intake.GetIntakeMotorAngle().getDegrees() < Intake.PosDownAngle) { if (m_Intake.GetIntakeMotorAngle().getDegrees() < Intake.PosDownAngle - 40) { m_Intake.LowerIntake(); } else { @@ -118,31 +90,8 @@ public void end(boolean interrupted) { public boolean isFinished() { return m_CommandIsFinished; } -} -/* - * CurrentIntakePose = m_Intake.GetIntakeMotorAngle().getDegrees(); - * if (m_Intake.IntakePos == 1){ - * TargetDeg = Pos1; - * if (CurrentIntakePose > TargetDeg + IntakeTolerence){ - * if (CurrentIntakePose > StaticSetpointDeg){ - * m_Intake.intakeAngleMtr.set(-.25); - * } else { - * m_Intake.intakeAngleMtr.set(-.45); - * } - * } else{ - * m_Intake.intakeAngleMtr.set(0); - * m_Intake.intakeAngleMtrEnc.setPosition(0); - * } - * } - * - * if (m_Intake.IntakePos == 2){ - * TargetDeg = Pos2; - * if (CurrentIntakePose < TargetDeg - IntakeTolerence){ - * m_Intake.intakeAngleMtr.set(.17); - * } - * else { - * m_Intake.intakeAngleMtr.set(0); - * } - * } - * - */ + +public interface AutoIntakeExplanation{ + + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/AutoShooter.java b/src/main/java/frc/robot/commands/AutoShooter.java index 886b2f6..ea56d7b 100644 --- a/src/main/java/frc/robot/commands/AutoShooter.java +++ b/src/main/java/frc/robot/commands/AutoShooter.java @@ -96,4 +96,8 @@ public void end(boolean interrupted) { public boolean isFinished() { return m_aprilAlignCommand.isFinished() && m_orientShooterAngleCommand.getController().atGoal(); } + + public interface AutoShooterExplanation{ + +} } diff --git a/src/main/java/frc/robot/commands/OrientShooterAngle.java b/src/main/java/frc/robot/commands/OrientShooterAngle.java index d4efb0e..e6e7c28 100644 --- a/src/main/java/frc/robot/commands/OrientShooterAngle.java +++ b/src/main/java/frc/robot/commands/OrientShooterAngle.java @@ -108,4 +108,8 @@ public boolean isFinished() { return false; return getController().atGoal(); } + + public interface OrientShooterAngleExplanation{ + + } } diff --git a/src/main/java/frc/robot/commands/OrientShooterAngleByEncoderValue.java b/src/main/java/frc/robot/commands/OrientShooterAngleByEncoderValue.java index 1679003..2ba8987 100644 --- a/src/main/java/frc/robot/commands/OrientShooterAngleByEncoderValue.java +++ b/src/main/java/frc/robot/commands/OrientShooterAngleByEncoderValue.java @@ -61,4 +61,8 @@ public void end(boolean interrupted) { public boolean isFinished() { return getController().atGoal(); } + + public interface OrientShooterAngleByEncoderValueExplanation{ + + } } diff --git a/src/main/java/frc/robot/commands/SwerveDriveCommand.java b/src/main/java/frc/robot/commands/SwerveDriveCommand.java index b96728f..2b76929 100644 --- a/src/main/java/frc/robot/commands/SwerveDriveCommand.java +++ b/src/main/java/frc/robot/commands/SwerveDriveCommand.java @@ -111,4 +111,8 @@ public void end(boolean interrupted) {} public boolean isFinished() { return false; } + + public interface SwerveDriveCommandExplanation{ + + } } diff --git a/src/main/java/frc/robot/subsystems/DriveTrain.java b/src/main/java/frc/robot/subsystems/DriveTrain.java index 5a4b3a7..48b03c9 100644 --- a/src/main/java/frc/robot/subsystems/DriveTrain.java +++ b/src/main/java/frc/robot/subsystems/DriveTrain.java @@ -425,4 +425,9 @@ public void initSendable(SendableBuilder builder) { m_backLeft.initSendable(builder); m_backRight.initSendable(builder); } + + /** TEST */ + public static int Explanation(){ + return 1; + } } diff --git a/src/main/java/frc/robot/subsystems/Hanger.java b/src/main/java/frc/robot/subsystems/Hanger.java index 752e637..18e624a 100644 --- a/src/main/java/frc/robot/subsystems/Hanger.java +++ b/src/main/java/frc/robot/subsystems/Hanger.java @@ -8,13 +8,30 @@ import frc.robot.Constants; public class Hanger extends SubsystemBase { + + // Here, We create each of our two Hangers: One on the left, and one on the right. + // These will be initialized in the contructor, although this really doesnt matter. private HangerModule m_leftHanger; private HangerModule m_rightHanger; + // We create 2 varibles for our speeds public static final double s_hangSpeedUp = 0.75; public static final double s_hangSpeedDown = -0.75; - public Hanger() { // Limelight - get Rotation3d rel to tag. / get navx pose (Can navx get 3d?) +/** This is the Hanger Class.

+ *In the Hanger Class, we have our Multi-HangModule Functions and Commands Such as: + *

+ *

We also Define other commands, like: + *

+ *In order to Access each individual hanger run the following Functions: