Skip to content
Merged
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
5 changes: 0 additions & 5 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@
<classpathentry kind="src" path="build/generated/sources/annotationProcessor/java/main"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="src" path="bin/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin/default"/>
</classpath>
2 changes: 1 addition & 1 deletion src/org/parts3492/partslib/AprilTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/org/parts3492/partslib/PARTsCandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion src/org/parts3492/partslib/PARTsUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 16 additions & 0 deletions src/org/parts3492/partslib/RobotUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,34 @@
import edu.wpi.first.wpilibj.RobotBase;
import edu.wpi.first.wpilibj.RuntimeType;

/**
* Robot Utility Functions
*
* <p>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();
Expand Down
1 change: 1 addition & 0 deletions src/org/parts3492/partslib/command/IPARTsSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 8 additions & 1 deletion src/org/parts3492/partslib/command/PARTsCommandUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/org/parts3492/partslib/command/PARTsSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public PARTsSubsystem() {
*
* <p>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());
Expand All @@ -65,8 +65,8 @@ public PARTsSubsystem(Object o) {
* <p>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);
Expand All @@ -93,8 +93,8 @@ public PARTsSubsystem(String className) {
* <p>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);
Expand Down
15 changes: 15 additions & 0 deletions src/org/parts3492/partslib/input/PARTsCommandController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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);
Expand Down
Loading