[docs] Add missing JavaDocs (#6146)

This commit is contained in:
Tyler Veness
2024-01-04 08:38:06 -08:00
committed by GitHub
parent 6e58db398d
commit f29a7d2e50
145 changed files with 1106 additions and 94 deletions

View File

@@ -25,8 +25,10 @@ import java.util.function.BooleanSupplier;
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class Command implements Sendable {
/** Requirements set. */
protected Set<Subsystem> m_requirements = new HashSet<>();
/** Default constructor. */
@SuppressWarnings("this-escape")
protected Command() {
String name = getClass().getName();

View File

@@ -16,4 +16,9 @@ import edu.wpi.first.util.sendable.Sendable;
*/
@Deprecated(since = "2024", forRemoval = true)
@SuppressWarnings("PMD.AbstractClassWithoutAnyMethod")
public abstract class CommandBase extends Command {}
public abstract class CommandBase extends Command {
/** Default constructor. */
public CommandBase() {
super();
}
}

View File

@@ -19,9 +19,16 @@ import java.util.function.DoubleSupplier;
* <p>This class is provided by the NewCommands VendorDep
*/
public class PIDCommand extends Command {
/** PID controller. */
protected final PIDController m_controller;
/** Measurement getter. */
protected DoubleSupplier m_measurement;
/** Setpoint getter. */
protected DoubleSupplier m_setpoint;
/** PID controller output consumer. */
protected DoubleConsumer m_useOutput;
/**

View File

@@ -15,7 +15,10 @@ import edu.wpi.first.math.controller.PIDController;
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class PIDSubsystem extends SubsystemBase {
/** PID controller. */
protected final PIDController m_controller;
/** Whether PID controller output is enabled. */
protected boolean m_enabled;
/**
@@ -47,6 +50,11 @@ public abstract class PIDSubsystem extends SubsystemBase {
}
}
/**
* Returns the PIDController.
*
* @return The controller.
*/
public PIDController getController() {
return m_controller;
}

View File

@@ -21,9 +21,16 @@ import java.util.function.Supplier;
* <p>This class is provided by the NewCommands VendorDep
*/
public class ProfiledPIDCommand extends Command {
/** Profiled PID controller. */
protected final ProfiledPIDController m_controller;
/** Measurement getter. */
protected DoubleSupplier m_measurement;
/** Goal getter. */
protected Supplier<State> m_goal;
/** Profiled PID controller output consumer. */
protected BiConsumer<Double, State> m_useOutput;
/**

View File

@@ -17,7 +17,10 @@ import edu.wpi.first.math.trajectory.TrapezoidProfile;
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class ProfiledPIDSubsystem extends SubsystemBase {
/** Profiled PID controller. */
protected final ProfiledPIDController m_controller;
/** Whether the profiled PID controller output is enabled. */
protected boolean m_enabled;
/**
@@ -47,6 +50,11 @@ public abstract class ProfiledPIDSubsystem extends SubsystemBase {
}
}
/**
* Returns the ProfiledPIDController.
*
* @return The controller.
*/
public ProfiledPIDController getController() {
return m_controller;
}

View File

@@ -14,7 +14,9 @@ import edu.wpi.first.wpilibj.Timer;
* <p>This class is provided by the NewCommands VendorDep
*/
public class WaitCommand extends Command {
/** The timer used for waiting. */
protected Timer m_timer = new Timer();
private final double m_duration;
/**

View File

@@ -42,10 +42,20 @@ public class InternalButton extends Trigger {
this.m_inverted = inverted;
}
/**
* Sets whether to invert button state.
*
* @param inverted Whether button state should be inverted.
*/
public void setInverted(boolean inverted) {
m_inverted.set(inverted);
}
/**
* Sets whether button is pressed.
*
* @param pressed Whether button is pressed.
*/
public void setPressed(boolean pressed) {
m_pressed.set(pressed);
}