diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 261c744..32c926f 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -154,4 +154,9 @@ public class RobotVersion2024 implements RobotVersionConstants { } public static final RobotVersion defaultRobotVersion = RobotVersion.v2024; + + /** DETAILED EXPLANATION */ + public static int Explanation() { + return 1; + } } 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..963c3eb --- /dev/null +++ b/src/main/java/frc/robot/Other/Explanations.java @@ -0,0 +1,92 @@ +package frc.robot.Other; + +import frc.robot.subsystems.*; +import frc.robot.Constants; +import frc.robot.Robot; +import frc.robot.RobotContainer; +import frc.robot.commands.*; + +/** + * Here, Explanations of How everything works are held. + * + *
When Within The class: + * + *
{@code - Hover over the Green Part to Get a basic explanation} + * + *
{@code - Hover over the Yellow Part for a More Detailed explanation} + * + *
{@code - Hover over The Blue Part to find what your getting an Explanation of} + * + *
EX: int {@link #DriveTrainExplanation} (Blue) = {@link DriveTrain} (Green) {@link + * DriveTrain#Explanation} (Yellow) + * + *
Sub Explanations are down Below: + * + *
In here, we initialize our swerve modules (example -> {@link #m_frontLeft}), Get input from - * autonomous and initialize our odometry -> {@link #m_odometry}. + *
In here, we: * - *
Various other DriveTrain Related thing are initalized here too. + *
Various other DriveTrain Related things are initalized here too. * * @param RobotVersion */ @@ -292,7 +297,7 @@ public void driveChassisSpeeds(ChassisSpeeds chassisSpeed) { /** * Resets the Position of the Odometer, given our Current position. * - * @param Pose2d (pose2d) - The current position of the robot on the field. This is a {@link + * @param pose2d (pose2d) - The current position of the robot on the field. This is a {@link * #resetOdometry(Pose2d)} */ public void resetPose(Pose2d pose2d) { @@ -425,4 +430,9 @@ public void initSendable(SendableBuilder builder) { m_backLeft.initSendable(builder); m_backRight.initSendable(builder); } + + /** DETAILED EXPLANATION */ + 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..e020835 100644 --- a/src/main/java/frc/robot/subsystems/Hanger.java +++ b/src/main/java/frc/robot/subsystems/Hanger.java @@ -7,14 +7,44 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; +/** + * This is the Hanger Class. + * + *
In the Hanger Class, we have our Multi-HangModule Functions and Commands Such as: + * + *
{@link #RaiseHangAuto()} (Which Automatically Raises the Hang Via encoder values) + *
{@link #LowerHangAuto()} (Which Automatically Lowers the Hang until the Switchs are hit) + *
We also Define other commands, like: + * + *
{@link #HangStopCommand()} (which Stops Both Hanger Modules) + *
{@link #ResetHangCmd()} (Which Resets the position on each of the two encoders) + *
{@link #leftHangerModule()} for the Left Hanger + *
{@link #rightHangerModule()} for the Right hanger. + *
We run our hanger subsystem like other Command-Based Subsystems are ran: + * + *
This class is used to create individual HangerModules + * + *
We do this because it is unneccesary to recreate The MotorController, Limit switch, and + * Encoder 2 times. + */ public class HangerModule extends SubsystemBase { private DigitalInput hangerMagSwitch; private CANSparkMax hangerMtr; @@ -22,42 +30,74 @@ public HangerModule( ResetHangEnc(); } + /** + * This is a void function. + * + *
It sets the position on the encoder to 0 + */ public void ResetHangEnc() { hangerMtrEnc.setPosition(0); } + /** This is a command that runs the void function {@link #ResetHangEnc} */ public Command ResetHangCmd() { return this.runOnce(this::ResetHangEnc); } + /** + * This void function runs the Motor at what ever speed is provided. + * + * @param speed (double) + */ public void MoveHang(double speed) { hangerMtr.set(speed); } + /** + * This void function runs {@link #MoveHang} and tells the Hanger to run at {@link + * Hanger#s_hangSpeedUp} + *
In this class, we use void functions to run actions, and have commands run those void + * functions. + * + *
Void functions don't occupy the command scheduler, but commands do. + * + *
If we wanted to indivdually run the module motor up while a button is held: + * + *
We would run the Command. + * + *
But, If we wanted to have a sequence of actions happening (like us running it until a + * certain point): + * + *
We would run a set of void functions in a singular command, not held in this class (Would be + * in {@link Hanger}). + * + *
EX: {@link Hanger#LowerHangAuto} + * + *
In the Example, we run a set of void functions and boolean functions on diffrent modules in + * parellel. + * + *
This command runs the void function {@link #MoveHangDown} to run the motors down on each + * individual module. + * + *
This command also runs {@link #HangIsAtPosition}, which checks when both hangers are down + * + *
When both hangers, are down, it will run the {@link #HangStop} void function. + * + *
If we were to run commands instead of void functions within the {@link Hanger#LowerHangAuto} + * command, it would not work. + * + *
The command scheduler can only run 1 command at the same time within in a subsystem. + * + *
That means if there are multiple commands being called at the same time, one of the commands + * would not run. + * + *
Since we are calling the {@link Hanger#LowerHangAuto} command, all the commands within it + * would not be able to run if they were commands. + * + *
But, since there are void functions, they are not required to be called by the Command
+ * scheduler, and can run smoothly.
+ */
+ public static int Explanation() {
+ return 3;
+ }
}
diff --git a/src/main/java/frc/robot/subsystems/Intake.java b/src/main/java/frc/robot/subsystems/Intake.java
index 171a234..40037d5 100644
--- a/src/main/java/frc/robot/subsystems/Intake.java
+++ b/src/main/java/frc/robot/subsystems/Intake.java
@@ -174,4 +174,9 @@ public void initSendable(SendableBuilder builder) {
builder.addDoubleProperty("Motor/Velocity", intakeAngleMtrEnc::getVelocity, null);
builder.addStringProperty("State", () -> this.GetIntakeState().toString(), null);
}
+
+ /** DETAILED EXPLANATION */
+ public static int Explanation() {
+ return 4;
+ }
}
diff --git a/src/main/java/frc/robot/subsystems/IntakeWheels.java b/src/main/java/frc/robot/subsystems/IntakeWheels.java
index fb23b14..04c0a74 100644
--- a/src/main/java/frc/robot/subsystems/IntakeWheels.java
+++ b/src/main/java/frc/robot/subsystems/IntakeWheels.java
@@ -105,4 +105,9 @@ public void initSendable(SendableBuilder builder) {
builder.addIntegerProperty("Color Sensor/Proximity", m_colorSensorV3::getProximity, null);
builder.addBooleanProperty("Note/Is Loaded", this::NoteIsLoaded, null);
}
+
+ /** DETAILED EXPLANATION */
+ public static int Explanation() {
+ return 5;
+ }
}
diff --git a/src/main/java/frc/robot/subsystems/Limelight.java b/src/main/java/frc/robot/subsystems/Limelight.java
index bd2da4a..ba7e342 100644
--- a/src/main/java/frc/robot/subsystems/Limelight.java
+++ b/src/main/java/frc/robot/subsystems/Limelight.java
@@ -92,4 +92,9 @@ public void initSendable(SendableBuilder builder) {
builder.addDoubleProperty("AprilTag/pose/Y", m_currentAprilTag.pose::getY, null);
builder.addDoubleProperty("AprilTag/pose/Z", m_currentAprilTag.pose::getZ, null);
}
+
+ /** DETAILED EXPLANATION */
+ public static int Explanation() {
+ return 6;
+ }
}
diff --git a/src/main/java/frc/robot/subsystems/Shooter.java b/src/main/java/frc/robot/subsystems/Shooter.java
index d995afe..e0a262b 100644
--- a/src/main/java/frc/robot/subsystems/Shooter.java
+++ b/src/main/java/frc/robot/subsystems/Shooter.java
@@ -334,4 +334,9 @@ public void initSendable(SendableBuilder builder) {
builder.addBooleanProperty("Top Limit Switch/Tripped", this::TopLimitSwitchTripped, null);
builder.addBooleanProperty("Bottom Limit Switch/Tripped", this::BottomLimitSwitchTripped, null);
}
+
+ /** DETAILED EXPLANATION */
+ public static int Explanation() {
+ return 7;
+ }
}
diff --git a/src/main/java/frc/robot/subsystems/SwerveModule.java b/src/main/java/frc/robot/subsystems/SwerveModule.java
index 024e371..2807dc0 100644
--- a/src/main/java/frc/robot/subsystems/SwerveModule.java
+++ b/src/main/java/frc/robot/subsystems/SwerveModule.java
@@ -21,11 +21,6 @@
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
-/**
- * This is the code to run a single swerve module
- *
- * It is called by the Drivetrain subsysem
- */
public class SwerveModule extends SubsystemBase {
private static final double kPositionConversionFactor =
@@ -223,4 +218,9 @@ public void initSendable(SendableBuilder builder) {
builder.setSafeState(this::stop);
}
+
+ /** DETAILED EXPLANATION */
+ public static int Explanation() {
+ return 8;
+ }
}
diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json
index ff15fab..6dc648d 100644
--- a/vendordeps/PathplannerLib.json
+++ b/vendordeps/PathplannerLib.json
@@ -1,7 +1,7 @@
{
"fileName": "PathplannerLib.json",
"name": "PathplannerLib",
- "version": "2024.2.3",
+ "version": "2024.2.8",
"uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786",
"frcYear": "2024",
"mavenUrls": [
@@ -12,7 +12,7 @@
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-java",
- "version": "2024.2.3"
+ "version": "2024.2.8"
}
],
"jniDependencies": [],
@@ -20,7 +20,7 @@
{
"groupId": "com.pathplanner.lib",
"artifactId": "PathplannerLib-cpp",
- "version": "2024.2.3",
+ "version": "2024.2.8",
"libName": "PathplannerLib",
"headerClassifier": "headers",
"sharedLibrary": false,
diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json
index 0f3520e..f85acd4 100644
--- a/vendordeps/REVLib.json
+++ b/vendordeps/REVLib.json
@@ -1,7 +1,7 @@
{
"fileName": "REVLib.json",
"name": "REVLib",
- "version": "2024.2.0",
+ "version": "2024.2.4",
"frcYear": "2024",
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
"mavenUrls": [
@@ -12,14 +12,14 @@
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-java",
- "version": "2024.2.0"
+ "version": "2024.2.4"
}
],
"jniDependencies": [
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-driver",
- "version": "2024.2.0",
+ "version": "2024.2.4",
"skipInvalidPlatforms": true,
"isJar": false,
"validPlatforms": [
@@ -37,7 +37,7 @@
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-cpp",
- "version": "2024.2.0",
+ "version": "2024.2.4",
"libName": "REVLib",
"headerClassifier": "headers",
"sharedLibrary": false,
@@ -55,7 +55,7 @@
{
"groupId": "com.revrobotics.frc",
"artifactId": "REVLib-driver",
- "version": "2024.2.0",
+ "version": "2024.2.4",
"libName": "REVLibDriver",
"headerClassifier": "headers",
"sharedLibrary": false,