Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

# This grabs the WPILib docker container
container: wpilib/roborio-cross-ubuntu:2024-22.04
container: wpilib/roborio-cross-ubuntu:2025-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ tasks.spotbugsMain {
}
}

//Javadoc Gradle task configuation
// Javadoc Gradle task configuation
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
failOnError = false
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.caching=true
11 changes: 6 additions & 5 deletions src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void run() {
/**
* Starts the given commands whenever the condition changes from `false` to `true`.
*
* @param command the command to start
* @param commands the commands to start
* @return this trigger, so calls can be chained
*/
public Trigger onTrue(Command... commands) {
Expand Down Expand Up @@ -276,7 +276,7 @@ public void run() {
* <p>Doesn't re-start the command if it ends while the condition is still `true`. If the
* command should restart, see {@link edu.wpi.first.wpilibj2.command.RepeatCommand}.
*
* @param command the command to start
* @param commands the commands to start
* @return this trigger, so calls can be chained
*/
public Trigger whileTrue(Command... commands) {
Expand Down Expand Up @@ -422,9 +422,10 @@ public void run() {
/**
* Run a command while true. Also runs a command for a certain timeout when released.
*
* @param trigger
* @param runCommand
* @param endCommand
* @param runCommand the command to run while the trigger is true
* @param endCommand the command to run when the trigger becomes false
* @param endTimeout the timeout for the end command
* @return this trigger, so calls can be chained
*/
public Trigger runWithEndSequence(Command runCommand, Command endCommand, double endTimeout) {
this.whileTrue(runCommand);
Expand Down
41 changes: 21 additions & 20 deletions src/main/java/frc/reefscape/FieldHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ public static int indexOfSmallest(double[] array) {
/**
* Converts an index to a reef tag ID
*
* @param index
* @return
* @param index The reef index (0-5)
* @return The corresponding reef tag ID (17-22)
*/
public static int indexToReefTagID(int index) {
return index + 17;
Expand All @@ -154,8 +154,8 @@ public static int indexToReefTagID(int index) {
/**
* Converts a given Reef Tag Id into index form for center faces to pull from
*
* @param tagID
* @return
* @param tagID The blue reef tag ID (17-22)
* @return The reef index (0-5), or -1 if invalid
*/
public static int blueReefTagIDToIndex(int tagID) {

Expand All @@ -170,8 +170,8 @@ public static int blueReefTagIDToIndex(int tagID) {
/**
* Converts a blue reef tag ID to a red reef tag ID
*
* @param blueTagID
* @return
* @param blueTagID The blue alliance reef tag ID (17-22)
* @return The corresponding red alliance reef tag ID (6-11)
*/
public static int blueToRedTagID(int blueTagID) {
switch (blueTagID) {
Expand Down Expand Up @@ -214,8 +214,8 @@ public static int redToBlueTagID(int redTagID) {
/**
* Returns the reef tag ID based on the robot's pose
*
* @param pose
* @return
* @param pose The robot's current pose on the field
* @return The reef tag ID corresponding to the robot's zone
*/
public static int getReefZoneTagID(Pose2d pose) {
pose = flipIfRedSide(pose);
Expand All @@ -235,8 +235,8 @@ public static int getReefZoneTagID(Pose2d pose) {
* Returns the reef index zone based on the robot's pose changed to blue pose including the
* center is consistently blue center
*
* @param pose
* @return
* @param pose The robot's current pose on the field
* @return The reef zone index (0-5)
*/
public static int getReefZone(Pose2d pose) {
Translation2d point = pose.getTranslation();
Expand Down Expand Up @@ -327,8 +327,9 @@ public static Pose2d getOffsetPosition(int tagID, double offsetMeters, double of
* Converts a target angle into a reverse rotation if the back is closer; otherwise, returns the
* original target angle for front heading.
*
* <p>variable robotAngle The current angle of the robot in radians. variable reefRotation The
* rotation adjustment factor in radians. targetAngle The desired target angle in radians.
* <p>The method considers: robotAngle - The current angle of the robot in radians. reefRotation
* - The rotation adjustment factor in radians. targetAngle - The desired target angle in
* radians.
*
* @return true/false if robot heading is reversed to reef face
*/
Expand Down Expand Up @@ -370,7 +371,7 @@ public static boolean reverseRotationBlue() {
/**
* Returns the reef face pose based on the tag ID sent from either red or blue
*
* @param tagID
* @param tagID The reef tag ID
* @return Pose2d of reef side
*/
public static Pose2d getReefSideFromTagID(int faceIndex) {
Expand All @@ -392,7 +393,7 @@ public static Pose2d getReefSideFromTagID(int faceIndex) {
*
* @param blueReefTagID may also be a red reef tag ID that will later be converted from a blue
* reef tagID
* @return
* @return The calculated scoring pose for the robot
*/
public static Pose2d getScorePoseFromTagID(int blueReefTagID) {
if (blueReefTagID < 0 || blueReefTagID > 22 || blueReefTagID == 16) {
Expand All @@ -414,12 +415,12 @@ public static double getTagAngleOffset(int tagID) {
}

/**
* Method gets
* Gets the pose offset from a tag position
*
* @param tagID
* @param distanceAway
* @param centerOffset
* @return
* @param tagID The AprilTag ID
* @param distanceAway The distance away from the tag in meters
* @param centerOffset The offset from the center in meters
* @return The calculated pose offset from the tag
*/
public static Pose2d getXYOffsetFromTag(int tagID, double distanceAway, double centerOffset) {
Pose2d tagPose;
Expand Down Expand Up @@ -456,7 +457,7 @@ public static double getReefOffsetFromTagY() {
/**
* Get the angle the robot should turn to based on the id the limelight is seeing.
*
* @return
* @return The target angle in degrees
*/
public static double getReefTagAngle() {
double[][] reefFrontAngles = {
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/frc/reefscape/TagProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ public class TagProperties {
@Getter private final double angle;

/**
* @param frontOffsetInchesLeft
* @param frontOffsetInchesRight
* @param rearOffsetInchesLeft
* @param rearOffsetInchesRight
* @param frontCenterOffsetInchesLeft
* @param frontCenterOffsetInchesRight
* @param rearCenterOffsetInchesLeft
* @param rearCenterOffsetInchesRight
* @param taGoal
* @param angle
* @param frontOffsetInchesLeft Front offset in inches for left side
* @param frontOffsetInchesRight Front offset in inches for right side
* @param rearOffsetInchesLeft Rear offset in inches for left side
* @param rearOffsetInchesRight Rear offset in inches for right side
* @param frontCenterOffsetInchesLeft Front center offset in inches for left side
* @param frontCenterOffsetInchesRight Front center offset in inches for right side
* @param rearCenterOffsetInchesLeft Rear center offset in inches for left side
* @param rearCenterOffsetInchesRight Rear center offset in inches for right side
* @param taGoal Target area goal
* @param angleDegrees Angle in degrees
*/
public TagProperties(
double frontOffsetInchesLeft,
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/reefscape/Zones.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public class Zones {
/**
* Depending on the offsets file used, change the tag offsets here.
*
* <p>getTagOffset automatically checks if the offset taken is < 0 or greater than the given tag
* limit. If the tag is blue (> 16), it subtracts 17 from the given tag
* <p>getTagOffset automatically checks if the offset taken is &lt; 0 or greater than the given
* tag limit. If the tag is blue (&gt; 16), it subtracts 17 from the given tag
*
* @param tag
* @return
* @param tag The AprilTag ID
* @return The distance offset for the tag in meters
*/
public double getTagOffset(int tag) {
return offsets.getReefTagDistanceOffset(tag);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/reefscape/offsets/StateChampsOffsets.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public class StateChampsOffsets {
/**
* Converts inches to meters and adds half the robot length to the offset
*
* @param offsetInches
* @return
* @param offsetInches The offset distance in inches
* @return The offset distance in meters including half robot length
*/
private static double meterConverter(double offsetInches) {
double meterConversion = Units.inchesToMeters(offsetInches);
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/frc/robot/swerve/Swerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ public Trigger inYzone(double minYmeter, double maxYmeter) {
* This method is used to check if the robot is in the X zone of the field flips the values if
* Red Alliance
*
* @param minXmeter
* @param maxXmeter
* @return
* @param minXmeter Minimum X coordinate in meters
* @param maxXmeter Maximum X coordinate in meters
* @return Trigger that is true when robot is within the X zone
*/
public Trigger inXzoneAlliance(double minXmeter, double maxXmeter) {
return new Trigger(
Expand All @@ -230,9 +230,9 @@ public Trigger inXzoneAlliance(double minXmeter, double maxXmeter) {
* This method is used to check if the robot is in the Y zone of the field flips the values if
* Red Alliance
*
* @param minYmeter
* @param maxYmeter
* @return
* @param minYmeter Minimum Y coordinate in meters
* @param maxYmeter Maximum Y coordinate in meters
* @return Trigger that is true when robot is within the Y zone
*/
public Trigger inYzoneAlliance(double minYmeter, double maxYmeter) {
return new Trigger(
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/vision/Vision.java
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ private boolean rejectionCheck(Pose2d pose, double targetSize) {
/**
* Choose the limelight with the best view of multiple tags
*
* @return
* @return The Limelight with the best scoring view
*/
public Limelight getBestLimelight() {
Limelight bestLimelight = frontLL;
Expand Down Expand Up @@ -732,7 +732,7 @@ public boolean resetPoseToVision(
/**
* If at least one LL has an accurate pose
*
* @return
* @return True if at least one Limelight has an accurate pose
*/
public boolean hasAccuratePose() {
for (Limelight limelight : allLimelights) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/spectrumLib/SpectrumState.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Command toggleToTrue() {
* Command to set state to true, and then to false, ensuring your state will trigger change to
* false actions
*
* @return
* @return Command that toggles state to false
*/
public Command toggleToFalse() {
return setTrue()
Expand All @@ -119,8 +119,8 @@ public Command toggleToFalse() {
}

/**
* @param value
* @return
* @param value The boolean value to set the state to
* @return Command that sets the state
*/
public Command set(boolean value) {
return Commands.runOnce(() -> setState(value)).ignoringDisable(true);
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/frc/spectrumLib/gamepads/Gamepad.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,16 @@ public Config(String name, int port) {
/**
* Constructs a Gamepad object with the specified configuration.
*
* <p>The constructor initializes the following:
*
* <ul>
* <li>Superclass with port and attachment status from the configuration
* <li>Curve objects for left stick, right stick, and triggers using exponential curves
* <li>If the gamepad is attached, initializes the Xbox controller and its buttons, triggers,
* sticks, and D-pad
* </ul>
*
* @param config the configuration object containing settings for the gamepad
* <p>The constructor initializes the following: - Superclass with port and attachment
* status from the configuration. - Curve objects for left stick, right stick, and triggers
* using exponential curves. - If the gamepad is attached, initializes the Xbox controller
* and its buttons, triggers, sticks, and D-pad.
*/
protected Gamepad(Config config) {
this.config = config;
Expand Down Expand Up @@ -283,7 +288,7 @@ public double getRightStickMagnitude() {
/**
* Get proper stick angles for each alliance
*
* @return
* @return The cardinal direction angle in radians
*/
public double chooseCardinalDirections() {
// hotfix
Expand Down Expand Up @@ -319,7 +324,7 @@ else if (stickAngle < -Math.PI / 8 && stickAngle >= -3 * Math.PI / 8) {
/**
* Flips the stick direction for the red alliance.
*
* @return
* @return The cardinal direction angle in radians for red alliance
*/
public double getRedAllianceStickCardinals() {
double stickAngle = getRightStickDirection().getRadians();
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/frc/spectrumLib/mechanism/Mechanism.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* Control Modes Docs:
* https://pro.docs.ctr-electronics.com/en/latest/docs/migration/migration-guide/control-requests-guide.html
* Closed-loop & Motion Magic Docs:
* Closed-loop and Motion Magic Docs:
* https://pro.docs.ctr-electronics.com/en/latest/docs/migration/migration-guide/closed-loop-guide.html
*/
public abstract class Mechanism implements NTSendable, SpectrumSubsystem {
Expand Down Expand Up @@ -232,7 +232,7 @@ public Trigger aboveCurrent(DoubleSupplier target, DoubleSupplier tolerance) {
/**
* Update the value of the stator current for the motor
*
* @return
* @return The current stator current value in amps
*/
public double updateCurrent() {
if (config.attached) {
Expand All @@ -259,7 +259,8 @@ public double getVoltage() {
/**
* Percentage to Rotations
*
* @return
* @param percent The percentage value supplier
* @return The equivalent rotation count
*/
public double percentToRotations(DoubleSupplier percent) {
return (percent.getAsDouble() / 100) * config.maxRotations;
Expand All @@ -268,8 +269,8 @@ public double percentToRotations(DoubleSupplier percent) {
/**
* Rotations to Percentage
*
* @param rotations
* @return
* @param rotations The rotation count supplier
* @return The equivalent percentage value
*/
public double rotationsToPercent(DoubleSupplier rotations) {
return (rotations.getAsDouble() / config.maxRotations) * 100;
Expand Down Expand Up @@ -361,8 +362,8 @@ public Command runVelocity(DoubleSupplier velocityRPM) {
/**
* Run the mechanism at given velocity rpm in TorqueCurrentFOC mode
*
* @param velocityRPM
* @return
* @param velocityRPM The target velocity in RPM
* @return Command that runs the mechanism at the specified velocity
*/
public Command runVelocityTcFocRpm(DoubleSupplier velocityRPM) {
return run(() -> setVelocityTorqueCurrentFOC(() -> Conversions.RPMtoRPS(velocityRPM)))
Expand Down Expand Up @@ -509,7 +510,7 @@ protected void setVelocityTorqueCurrentFOC(DoubleSupplier velocityRPS) {
/**
* Closed-loop Velocity with torque control (requires Pro)
*
* @param velocity rotations per second
* @param velocityRPS rotations per second
*/
protected void setVelocityTCFOCrpm(DoubleSupplier velocityRPS) {
if (isAttached()) {
Expand Down
Loading