diff --git a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagDetector.java b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagDetector.java index 61756854a9..a0774da171 100644 --- a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagDetector.java +++ b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagDetector.java @@ -57,8 +57,21 @@ public class AprilTagDetector implements AutoCloseable { */ public boolean debug; + /** Default constructor. */ public Config() {} + /** + * Constructs a detector configuration. + * + * @param numThreads How many threads should be used for computation. + * @param quadDecimate Quad decimation. + * @param quadSigma What Gaussian blur should be applied to the segmented image (used for quad + * detection). + * @param refineEdges When true, the edges of the each quad are adjusted to "snap to" strong + * gradients nearby. + * @param decodeSharpening How much sharpening should be done to decoded images. + * @param debug Debug mode. + */ Config( int numThreads, float quadDecimate, @@ -139,8 +152,21 @@ public class AprilTagDetector implements AutoCloseable { */ public boolean deglitch; + /** Default constructor. */ public QuadThresholdParameters() {} + /** + * Constructs quad threshold parameters. + * + * @param minClusterPixels Threshold used to reject quads containing too few pixels. + * @param maxNumMaxima How many corner candidates to consider when segmenting a group of pixels + * into a quad. + * @param criticalAngle Critical angle, in radians. + * @param maxLineFitMSE When fitting lines to the contours, the maximum mean squared error + * allowed. + * @param minWhiteBlackDiff Minimum brightness offset. + * @param deglitch Whether the thresholded image be should be deglitched. + */ QuadThresholdParameters( int minClusterPixels, int maxNumMaxima, diff --git a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFieldLayout.java b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFieldLayout.java index c4b1eb8de8..5d0e424887 100644 --- a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFieldLayout.java +++ b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFieldLayout.java @@ -44,8 +44,11 @@ import java.util.Optional; @JsonIgnoreProperties(ignoreUnknown = true) @JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE) public class AprilTagFieldLayout { + /** Common origin positions for the AprilTag coordinate system. */ public enum OriginPosition { + /** Blue alliance wall, right side. */ kBlueAllianceWallRightSide, + /** Red alliance wall, right side. */ kRedAllianceWallRightSide, } diff --git a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java index dda8d343c5..8c5bfc2d93 100644 --- a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java +++ b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagFields.java @@ -7,15 +7,20 @@ package edu.wpi.first.apriltag; import java.io.IOException; import java.io.UncheckedIOException; +/** Loadable AprilTag field layouts. */ public enum AprilTagFields { + /** 2022 Rapid React. */ k2022RapidReact("2022-rapidreact.json"), + /** 2023 Charged Up. */ k2023ChargedUp("2023-chargedup.json"); + /** Base resource directory. */ public static final String kBaseResourceDir = "/edu/wpi/first/apriltag/"; /** Alias to the current game. */ public static final AprilTagFields kDefaultField = k2023ChargedUp; + /** Resource filename. */ public final String m_resourceFile; AprilTagFields(String resourceFile) { diff --git a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagPoseEstimator.java b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagPoseEstimator.java index 2b7f68a526..182f394a31 100644 --- a/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagPoseEstimator.java +++ b/apriltag/src/main/java/edu/wpi/first/apriltag/AprilTagPoseEstimator.java @@ -29,10 +29,19 @@ public class AprilTagPoseEstimator { this.cy = cy; } + /** Tag size, in meters. */ public double tagSize; + + /** Camera horizontal focal length, in pixels. */ public double fx; + + /** Camera vertical focal length, in pixels. */ public double fy; + + /** Camera horizontal focal center, in pixels. */ public double cx; + + /** Camera vertical focal center, in pixels. */ public double cy; @Override diff --git a/apriltag/src/main/native/include/frc/apriltag/AprilTagFieldLayout.h b/apriltag/src/main/native/include/frc/apriltag/AprilTagFieldLayout.h index 2b57d2ce4a..1f5397b25a 100644 --- a/apriltag/src/main/native/include/frc/apriltag/AprilTagFieldLayout.h +++ b/apriltag/src/main/native/include/frc/apriltag/AprilTagFieldLayout.h @@ -38,8 +38,13 @@ namespace frc { * towards the opposing alliance). */ class WPILIB_DLLEXPORT AprilTagFieldLayout { public: + /** + * Common origin positions for the AprilTag coordinate system. + */ enum class OriginPosition { + /// Blue alliance wall, right side. kBlueAllianceWallRightSide, + /// Red alliance wall, right side. kRedAllianceWallRightSide, }; diff --git a/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h b/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h index 4bab29919c..3f2b8a470f 100644 --- a/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h +++ b/apriltag/src/main/native/include/frc/apriltag/AprilTagFields.h @@ -12,8 +12,13 @@ namespace frc { +/** + * Loadable AprilTag field layouts. + */ enum class AprilTagField { + /// 2022 Rapid React. k2022RapidReact, + /// 2023 Charged Up. k2023ChargedUp, // This is a placeholder for denoting the last supported field. This should diff --git a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java index 24f2ba28d0..12dfbf66a1 100644 --- a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java +++ b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServer.java @@ -39,6 +39,7 @@ import java.util.concurrent.atomic.AtomicInteger; * NetworkTables. */ public final class CameraServer { + /** CameraServer base port. */ public static final int kBasePort = 1181; private static final String kPublishName = "/CameraPublisher"; diff --git a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerShared.java b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerShared.java index 4726de184f..dfa570f85c 100644 --- a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerShared.java +++ b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerShared.java @@ -4,6 +4,7 @@ package edu.wpi.first.cameraserver; +/** CameraServer shared functions. */ public interface CameraServerShared { /** * get the main thread id func. diff --git a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java index 3d9e119406..b129d55291 100644 --- a/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java +++ b/cameraserver/src/main/java/edu/wpi/first/cameraserver/CameraServerSharedStore.java @@ -4,6 +4,7 @@ package edu.wpi.first.cameraserver; +/** Storage for CameraServerShared instance. */ public final class CameraServerSharedStore { private static CameraServerShared cameraServerShared; diff --git a/cameraserver/src/main/native/include/cameraserver/CameraServer.h b/cameraserver/src/main/native/include/cameraserver/CameraServer.h index 5553710a0d..09606128bd 100644 --- a/cameraserver/src/main/native/include/cameraserver/CameraServer.h +++ b/cameraserver/src/main/native/include/cameraserver/CameraServer.h @@ -22,10 +22,8 @@ namespace frc { */ class CameraServer { public: + /// CameraServer base port. static constexpr uint16_t kBasePort = 1181; - static constexpr int kSize640x480 = 0; - static constexpr int kSize320x240 = 1; - static constexpr int kSize160x120 = 2; /** * Start automatically capturing images to send to the dashboard. diff --git a/datalogtool/src/main/generate/WPILibVersion.cpp.in b/datalogtool/src/main/generate/WPILibVersion.cpp.in index b0a4490520..cfe2441158 100644 --- a/datalogtool/src/main/generate/WPILibVersion.cpp.in +++ b/datalogtool/src/main/generate/WPILibVersion.cpp.in @@ -1,4 +1,4 @@ -/* +/** * Autogenerated file! Do not manually edit this file. This version is regenerated * any time the publish task is run, or when this file is deleted. */ diff --git a/glass/src/app/generate/WPILibVersion.cpp.in b/glass/src/app/generate/WPILibVersion.cpp.in index b0a4490520..cfe2441158 100644 --- a/glass/src/app/generate/WPILibVersion.cpp.in +++ b/glass/src/app/generate/WPILibVersion.cpp.in @@ -1,4 +1,4 @@ -/* +/** * Autogenerated file! Do not manually edit this file. This version is regenerated * any time the publish task is run, or when this file is deleted. */ diff --git a/hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java b/hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java index e93a92127d..7c66563a32 100644 --- a/hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java +++ b/hal/src/main/java/edu/wpi/first/hal/simulation/BufferCallback.java @@ -4,6 +4,14 @@ package edu.wpi.first.hal.simulation; +/** Interface for simulation buffer callbacks. */ public interface BufferCallback { + /** + * Simulation buffer callback function. + * + * @param name Buffer name. + * @param buffer Buffer. + * @param count Buffer size. + */ void callback(String name, byte[] buffer, int count); } diff --git a/outlineviewer/src/main/generate/WPILibVersion.cpp.in b/outlineviewer/src/main/generate/WPILibVersion.cpp.in index b0a4490520..cfe2441158 100644 --- a/outlineviewer/src/main/generate/WPILibVersion.cpp.in +++ b/outlineviewer/src/main/generate/WPILibVersion.cpp.in @@ -1,4 +1,4 @@ -/* +/** * Autogenerated file! Do not manually edit this file. This version is regenerated * any time the publish task is run, or when this file is deleted. */ diff --git a/roborioteamnumbersetter/src/main/generate/WPILibVersion.cpp.in b/roborioteamnumbersetter/src/main/generate/WPILibVersion.cpp.in index b0a4490520..cfe2441158 100644 --- a/roborioteamnumbersetter/src/main/generate/WPILibVersion.cpp.in +++ b/roborioteamnumbersetter/src/main/generate/WPILibVersion.cpp.in @@ -1,4 +1,4 @@ -/* +/** * Autogenerated file! Do not manually edit this file. This version is regenerated * any time the publish task is run, or when this file is deleted. */ diff --git a/sysid/src/main/generate/WPILibVersion.cpp.in b/sysid/src/main/generate/WPILibVersion.cpp.in index b0a4490520..cfe2441158 100644 --- a/sysid/src/main/generate/WPILibVersion.cpp.in +++ b/sysid/src/main/generate/WPILibVersion.cpp.in @@ -1,4 +1,4 @@ -/* +/** * Autogenerated file! Do not manually edit this file. This version is regenerated * any time the publish task is run, or when this file is deleted. */ diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java index f46feb1b2a..5ea1a362ec 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java @@ -25,8 +25,10 @@ import java.util.function.BooleanSupplier; *
This class is provided by the NewCommands VendorDep
*/
public abstract class Command implements Sendable {
+ /** Requirements set. */
protected Set 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;
/**
diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/PIDSubsystem.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/PIDSubsystem.java
index e1c0dc893e..8146ca4d7b 100644
--- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/PIDSubsystem.java
+++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/PIDSubsystem.java
@@ -15,7 +15,10 @@ import edu.wpi.first.math.controller.PIDController;
* 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;
}
diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProfiledPIDCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProfiledPIDCommand.java
index f7175fc2eb..4e82811739 100644
--- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProfiledPIDCommand.java
+++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProfiledPIDCommand.java
@@ -21,9 +21,16 @@ import java.util.function.Supplier;
* 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 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;
}
diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/WaitCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/WaitCommand.java
index 828e8f5932..6d4c52bb61 100644
--- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/WaitCommand.java
+++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/WaitCommand.java
@@ -14,7 +14,9 @@ import edu.wpi.first.wpilibj.Timer;
* 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;
/**
diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/InternalButton.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/InternalButton.java
index f4897f2aca..87c9b739b3 100644
--- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/InternalButton.java
+++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/InternalButton.java
@@ -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);
}
diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h
index 27f5f18407..ad6aa79040 100644
--- a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h
+++ b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h
@@ -426,6 +426,7 @@ class Command : public wpi::Sendable, public wpi::SendableHelper A plant is a mathematical model of a system's dynamics.
+ *
+ * For more on the underlying math, read
+ * https://file.tavsys.net/control/controls-engineering-in-frc.pdf.
+ *
+ * @param The number of states.
+ * @param The number of inputs.
+ * @param {
private static final int kMaxPastObserverStates = 300;
private final List xHat;
+
+ /** The error covariance. */
public final Matrix errorCovariances;
+
+ /** The inputs. */
public final Matrix inputs;
+
+ /** The local measurements. */
public final Matrix