[docs] Add missing JavaDocs (#6125)

This commit is contained in:
Tyler Veness
2024-01-01 22:56:23 -08:00
committed by GitHub
parent 5579219716
commit ad0859a8c9
137 changed files with 1202 additions and 204 deletions

View File

@@ -9,6 +9,10 @@ import java.util.TreeMap;
/**
* Interpolating Tree Maps are used to get values at points that are not defined by making a guess
* from points that are defined. This uses linear interpolation.
*
* @param <K> Key type.
* @param <R> Number of matrix rows.
* @param <C> Number of matrix columns.
*/
public class InterpolatingMatrixTreeMap<K extends Number, R extends Num, C extends Num> {
private final TreeMap<K, Matrix<R, C>> m_map = new TreeMap<>();

View File

@@ -139,7 +139,7 @@ public final class StateSpaceUtil {
* @param u The input to clamp.
* @param umin The minimum input magnitude.
* @param umax The maximum input magnitude.
* @param <I> The number of inputs.
* @param <I> Number of inputs.
* @return The clamped input.
*/
public static <I extends Num> Matrix<I, N1> clampInputMaxMagnitude(
@@ -157,7 +157,7 @@ public final class StateSpaceUtil {
*
* @param u The input vector.
* @param maxMagnitude The maximum magnitude any input can have.
* @param <I> The number of inputs.
* @param <I> Number of inputs.
* @return The normalizedInput
*/
public static <I extends Num> Matrix<I, N1> desaturateInputVector(

View File

@@ -8,6 +8,7 @@ import edu.wpi.first.util.RuntimeLoader;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
/** WPIMath JNI. */
public final class WPIMathJNI {
static boolean libraryLoaded = false;
static RuntimeLoader<WPIMathJNI> loader = null;
@@ -385,15 +386,32 @@ public final class WPIMathJNI {
*/
public static native String serializeTrajectory(double[] elements);
/** Sets whether JNI should be loaded in the static block. */
public static class Helper {
private static AtomicBoolean extractOnStaticLoad = new AtomicBoolean(true);
/**
* Returns true if the JNI should be loaded in the static block.
*
* @return True if the JNI should be loaded in the static block.
*/
public static boolean getExtractOnStaticLoad() {
return extractOnStaticLoad.get();
}
/**
* Sets whether the JNI should be loaded in the static block.
*
* @param load Whether the JNI should be loaded in the static block.
*/
public static void setExtractOnStaticLoad(boolean load) {
extractOnStaticLoad.set(load);
}
/** Utility class. */
private Helper() {}
}
/** Utility class. */
private WPIMathJNI() {}
}

View File

@@ -27,6 +27,9 @@ import java.util.function.Function;
*
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
*/
public class ControlAffinePlantInversionFeedforward<States extends Num, Inputs extends Num> {
/** The current reference state. */

View File

@@ -19,6 +19,10 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>For more on the underlying math, read appendix B.3 in <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class ImplicitModelFollower<States extends Num, Inputs extends Num, Outputs extends Num> {
// Computed controller output

View File

@@ -19,6 +19,10 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class LinearPlantInversionFeedforward<
States extends Num, Inputs extends Num, Outputs extends Num> {

View File

@@ -21,6 +21,10 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class LinearQuadraticRegulator<States extends Num, Inputs extends Num, Outputs extends Num> {
/** The current reference state. */

View File

@@ -11,10 +11,10 @@ import edu.wpi.first.math.numbers.N1;
import java.util.function.BiFunction;
import org.ejml.simple.SimpleMatrix;
/** Angle statistics functions. */
public final class AngleStatistics {
private AngleStatistics() {
// Utility class
}
/** Utility class. */
private AngleStatistics() {}
/**
* Subtracts a and b while normalizing the resulting value in the selected row as if it were an

View File

@@ -33,6 +33,10 @@ import java.util.function.BiFunction;
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>
* chapter 9 "Stochastic control theory".
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class ExtendedKalmanFilter<States extends Num, Inputs extends Num, Outputs extends Num>
implements KalmanTypeFilter<States, Inputs, Outputs> {

View File

@@ -28,6 +28,10 @@ import edu.wpi.first.math.system.LinearSystem;
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>
* chapter 9 "Stochastic control theory".
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class KalmanFilter<States extends Num, Inputs extends Num, Outputs extends Num>
implements KalmanTypeFilter<States, Inputs, Outputs> {

View File

@@ -21,6 +21,8 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>[1] R. Van der Merwe "Sigma-Point Kalman Filters for Probabilitic Inference in Dynamic
* State-Space Models" (Doctoral dissertation)
*
* @param <S> The dimensionality of the state. 2 * States + 1 weights will be generated.
*/
public class MerweScaledSigmaPoints<S extends Num> {
private final double m_alpha;

View File

@@ -34,6 +34,8 @@ import java.util.Objects;
*
* <p>{@link PoseEstimator#addVisionMeasurement} can be called as infrequently as you want; if you
* never call it then this class will behave exactly like regular encoder odometry.
*
* @param <T> Wheel positions type.
*/
public class PoseEstimator<T extends WheelPositions<T>> {
private final Kinematics<?, T> m_kinematics;

View File

@@ -31,6 +31,10 @@ import edu.wpi.first.math.system.LinearSystem;
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>
* chapter 9 "Stochastic control theory".
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class SteadyStateKalmanFilter<States extends Num, Inputs extends Num, Outputs extends Num> {
private final Nat<States> m_states;

View File

@@ -38,6 +38,10 @@ import org.ejml.simple.SimpleMatrix;
* <p>This class implements a square-root-form unscented Kalman filter (SR-UKF). For more
* information about the SR-UKF, see <a
* href="https://www.researchgate.net/publication/3908304">https://www.researchgate.net/publication/3908304</a>.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class UnscentedKalmanFilter<States extends Num, Inputs extends Num, Outputs extends Num>
implements KalmanTypeFilter<States, Inputs, Outputs> {

View File

@@ -15,6 +15,8 @@ import edu.wpi.first.math.geometry.Rotation2d;
*
* <p>Teams can use odometry during the autonomous period for complex tasks like path following.
* Furthermore, odometry can be used for latency compensation when using computer-vision systems.
*
* @param <T> Wheel positions type.
*/
public class Odometry<T extends WheelPositions<T>> {
private final Kinematics<?, T> m_kinematics;

View File

@@ -27,6 +27,10 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>For more on the underlying math, read <a
* href="https://file.tavsys.net/control/controls-engineering-in-frc.pdf">https://file.tavsys.net/control/controls-engineering-in-frc.pdf</a>.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
* @param <Outputs> Number of outputs.
*/
public class LinearSystemLoop<States extends Num, Inputs extends Num, Outputs extends Num> {
private final LinearQuadraticRegulator<States, Inputs, Outputs> m_controller;