mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[docs] Add missing JavaDocs (#6146)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user