From 1aeb4f9f7c1652650b52910d1baead6c943dace9 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 19 Jan 2026 16:06:34 -0500 Subject: [PATCH 1/2] Fix classpath --- .classpath | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.classpath b/.classpath index d0fbb01..2285bed 100644 --- a/.classpath +++ b/.classpath @@ -9,10 +9,5 @@ - - - - - From ed7c3ca1d6319975b6640c087ce44737d9c8502f Mon Sep 17 00:00:00 2001 From: James Date: Thu, 22 Jan 2026 21:32:07 -0500 Subject: [PATCH 2/2] Add needed documentation to the library. --- src/org/parts3492/partslib/AprilTag.java | 2 +- src/org/parts3492/partslib/PARTsCandle.java | 8 +++++++- src/org/parts3492/partslib/PARTsUnit.java | 3 ++- src/org/parts3492/partslib/RobotUtils.java | 16 ++++++++++++++++ .../partslib/command/IPARTsSubsystem.java | 1 + .../partslib/command/PARTsCommandUtils.java | 9 ++++++++- .../partslib/command/PARTsSubsystem.java | 12 ++++++------ .../partslib/input/PARTsCommandController.java | 15 +++++++++++++++ 8 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/org/parts3492/partslib/AprilTag.java b/src/org/parts3492/partslib/AprilTag.java index 78a3f1c..bc09e93 100644 --- a/src/org/parts3492/partslib/AprilTag.java +++ b/src/org/parts3492/partslib/AprilTag.java @@ -6,7 +6,7 @@ import edu.wpi.first.math.geometry.Pose3d; -/** This class stores information about a tag. */ +/** This class stores information about an AprilTag. */ public class AprilTag { private final int id; diff --git a/src/org/parts3492/partslib/PARTsCandle.java b/src/org/parts3492/partslib/PARTsCandle.java index 9cffc9e..bc23079 100644 --- a/src/org/parts3492/partslib/PARTsCandle.java +++ b/src/org/parts3492/partslib/PARTsCandle.java @@ -142,7 +142,13 @@ public enum Color { private final int LED_LENGTH; - /** Creates a new light. */ + /** + * Create a new PARTsCANdle. + * + * @param className The class name. E.g. PARTsCANdle + * @param canID The ID of the CANdle hardware. + * @param ledLength The length of LEDs attached to the CANdle. + */ public PARTsCandle(String className, int canID, int ledLength) { super(className); CANBus canbus = new CANBus("rio"); diff --git a/src/org/parts3492/partslib/PARTsUnit.java b/src/org/parts3492/partslib/PARTsUnit.java index f5ae6b9..7f28581 100644 --- a/src/org/parts3492/partslib/PARTsUnit.java +++ b/src/org/parts3492/partslib/PARTsUnit.java @@ -10,7 +10,8 @@ public class PARTsUnit { public enum PARTsUnitType { - Angle, // Degrees. todo: change to degree? + /** Degrees. */ + Angle, // TODO: change to degree? Radian, Meter, Inch, diff --git a/src/org/parts3492/partslib/RobotUtils.java b/src/org/parts3492/partslib/RobotUtils.java index 942e01f..58be095 100644 --- a/src/org/parts3492/partslib/RobotUtils.java +++ b/src/org/parts3492/partslib/RobotUtils.java @@ -9,18 +9,34 @@ import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj.RuntimeType; +/** + * Robot Utility Functions + * + *

Miscellaneous functions that are needed for PARTsLib. + */ public class RobotUtils { private static Alliance alliance; + /** + * Check if the robot is on the blue alliance. + * + * @return True if the robot is on the blue alliance, else false. + */ public static boolean isBlue() { return alliance == Alliance.Blue; } + /** + * Check if the robot is real or in sim. + * + * @return True if real, else false. + */ public static boolean isReal() { RuntimeType runtimeType = RobotBase.getRuntimeType(); return runtimeType == RuntimeType.kRoboRIO || runtimeType == RuntimeType.kRoboRIO2; } + /** Get the alliance the robot is currently on. */ public void getAlliance() { if (DriverStation.getAlliance().isPresent()) { alliance = DriverStation.getAlliance().get(); diff --git a/src/org/parts3492/partslib/command/IPARTsSubsystem.java b/src/org/parts3492/partslib/command/IPARTsSubsystem.java index 555a5f9..cdf5b1f 100644 --- a/src/org/parts3492/partslib/command/IPARTsSubsystem.java +++ b/src/org/parts3492/partslib/command/IPARTsSubsystem.java @@ -7,6 +7,7 @@ import edu.wpi.first.util.sendable.Sendable; import edu.wpi.first.wpilibj2.command.Subsystem; +/** PARTsSubsystem Interface. The base subsystem class for PARTs. */ public interface IPARTsSubsystem extends Subsystem, Sendable { public void outputTelemetry(); diff --git a/src/org/parts3492/partslib/command/PARTsCommandUtils.java b/src/org/parts3492/partslib/command/PARTsCommandUtils.java index beafdc5..e54c507 100644 --- a/src/org/parts3492/partslib/command/PARTsCommandUtils.java +++ b/src/org/parts3492/partslib/command/PARTsCommandUtils.java @@ -6,9 +6,16 @@ import edu.wpi.first.wpilibj2.command.Command; -/** Add your docs here. */ +/** Command Utilities for PARTs. */ public class PARTsCommandUtils { + /** + * Set the given command's name. + * + * @param name The name to set the command. + * @param c The target command. + * @return The modified command with the given name. + */ public static Command setCommandName(String name, Command c) { c.setName(name); return c; diff --git a/src/org/parts3492/partslib/command/PARTsSubsystem.java b/src/org/parts3492/partslib/command/PARTsSubsystem.java index d539c33..6b80d60 100644 --- a/src/org/parts3492/partslib/command/PARTsSubsystem.java +++ b/src/org/parts3492/partslib/command/PARTsSubsystem.java @@ -37,8 +37,8 @@ public PARTsSubsystem() { * *

Comes with instances of PARTs tools that use the "Generic" name. * - * @param enableLogging Enable the {@link org.parts3492.partslib.PARTsLogger} instance for this - * subsystem. + * @param enableLogging Enable the {@link org.parts3492.partslib.PARTsLogger PARTsLogger} + * instance for this subsystem. */ public PARTsSubsystem(boolean enableLogging) { partsNT = new PARTsNT(this.getName()); @@ -65,8 +65,8 @@ public PARTsSubsystem(Object o) { *

Comes with instances of PARTs tools that use given class name. * * @param o The object that the subsystem will use for the name. - * @param enableLogging Enable the {@link org.parts3492.partslib.PARTsLogger} instance for this - * subsystem. + * @param enableLogging Enable the {@link org.parts3492.partslib.PARTsLogger PARTsLogger} + * instance for this subsystem. */ public PARTsSubsystem(Object o, boolean enableLogging) { partsNT = new PARTsNT(o); @@ -93,8 +93,8 @@ public PARTsSubsystem(String className) { *

Comes with instances of PARTs tools that use given class name. * * @param className The name that this subsystem should use as it's name. - * @param enableLogging Enable the {@link org.parts3492.partslib.PARTsLogger} instance for this - * subsystem. + * @param enableLogging Enable the {@link org.parts3492.partslib.PARTsLogger PARTsLogger} + * instance for this subsystem. */ public PARTsSubsystem(String className, boolean enableLogging) { partsNT = new PARTsNT(className); diff --git a/src/org/parts3492/partslib/input/PARTsCommandController.java b/src/org/parts3492/partslib/input/PARTsCommandController.java index 33bde2c..27fbe07 100644 --- a/src/org/parts3492/partslib/input/PARTsCommandController.java +++ b/src/org/parts3492/partslib/input/PARTsCommandController.java @@ -24,6 +24,15 @@ public class PARTsCommandController { private CommandJoystick joystick; private String err_msg = ""; + /** + * Create a new PARTsCommandController + * + * @param port The controller port. + * @param disableAutomaticDetection This will default the controller to {@link + * PARTsController.ControllerType#OTHER ControllerType.OTHER} if disabled. Refer to {@link + * #PARTsCommandController(int, ControllerType) PARTsCommandController(port, + * ControllerType)} for setting the desired controller type. + */ public PARTsCommandController(int port, boolean disableAutomaticDetection) { if (!disableAutomaticDetection) { if (DriverStation.getJoystickIsXbox(port)) { @@ -42,6 +51,12 @@ public PARTsCommandController(int port, boolean disableAutomaticDetection) { initialize(port); } + /** + * Create a new PARTsCommandController + * + * @param port The controller port. + * @param controllerType The desired controller type. + */ public PARTsCommandController(int port, ControllerType controllerType) { this.controllerType = controllerType; initialize(port);