Spelling and grammar cleanups (#4849)

This commit is contained in:
Sriman Achanta
2022-12-26 14:32:13 -05:00
committed by GitHub
parent 176fddeb4c
commit 92149efa11
110 changed files with 317 additions and 319 deletions

View File

@@ -10,7 +10,7 @@ public final class Drake {
private Drake() {}
/**
* Solves the discrete alegebraic Riccati equation.
* Solves the discrete algebraic Riccati equation.
*
* @param A System matrix.
* @param B Input matrix.
@@ -33,7 +33,7 @@ public final class Drake {
}
/**
* Solves the discrete alegebraic Riccati equation.
* Solves the discrete algebraic Riccati equation.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.
@@ -55,7 +55,7 @@ public final class Drake {
}
/**
* Solves the discrete alegebraic Riccati equation.
* Solves the discrete algebraic Riccati equation.
*
* @param A System matrix.
* @param B Input matrix.
@@ -85,7 +85,7 @@ public final class Drake {
}
/**
* Solves the discrete alegebraic Riccati equation.
* Solves the discrete algebraic Riccati equation.
*
* @param <States> Number of states.
* @param <Inputs> Number of inputs.

View File

@@ -573,10 +573,9 @@ public class Matrix<R extends Num, C extends Num> {
* Decompose "this" matrix using Cholesky Decomposition. If the "this" matrix is zeros, it will
* return the zero matrix.
*
* @param lowerTriangular Whether or not we want to decompose to the lower triangular Cholesky
* matrix.
* @param lowerTriangular Whether we want to decompose to the lower triangular Cholesky matrix.
* @return The decomposed matrix.
* @throws RuntimeException if the matrix could not be decomposed(ie. is not positive
* @throws RuntimeException if the matrix could not be decomposed(i.e. is not positive
* semidefinite).
*/
public Matrix<R, C> lltDecompose(boolean lowerTriangular) {
@@ -670,10 +669,10 @@ public class Matrix<R extends Num, C extends Num> {
* same symbolic meaning they both must be either Double.NaN, Double.POSITIVE_INFINITY, or
* Double.NEGATIVE_INFINITY.
*
* <p>NOTE:It is recommend to use {@link Matrix#isEqual(Matrix, double)} over this method when
* <p>NOTE:It is recommended to use {@link Matrix#isEqual(Matrix, double)} over this method when
* checking if two matrices are equal as {@link Matrix#isEqual(Matrix, double)} will return false
* if an element is uncountable. This method should only be used when uncountable elements need to
* compared.
* be compared.
*
* @param other The {@link Matrix} to check against this one.
* @param tolerance The tolerance to check equality with.
@@ -709,7 +708,7 @@ public class Matrix<R extends Num, C extends Num> {
*
* @param v Vector to use for the update.
* @param sigma Sigma to use for the update.
* @param lowerTriangular Whether or not this matrix is lower triangular.
* @param lowerTriangular Whether this matrix is lower triangular.
*/
public void rankUpdate(Matrix<R, N1> v, double sigma, boolean lowerTriangular) {
WPIMathJNI.rankUpdate(this.getData(), this.getNumRows(), v.getData(), sigma, lowerTriangular);

View File

@@ -192,7 +192,7 @@ public final class SimpleMatrixUtils {
*
* @param src The matrix to decompose.
* @return The decomposed matrix.
* @throws RuntimeException if the matrix could not be decomposed (ie. is not positive
* @throws RuntimeException if the matrix could not be decomposed (i.e. is not positive
* semidefinite).
*/
public static SimpleMatrix lltDecompose(SimpleMatrix src) {
@@ -206,7 +206,7 @@ public final class SimpleMatrixUtils {
* @param src The matrix to decompose.
* @param lowerTriangular if we want to decompose to the lower triangular Cholesky matrix.
* @return The decomposed matrix.
* @throws RuntimeException if the matrix could not be decomposed (ie. is not positive
* @throws RuntimeException if the matrix could not be decomposed (i.e. is not positive
* semidefinite).
*/
public static SimpleMatrix lltDecompose(SimpleMatrix src, boolean lowerTriangular) {

View File

@@ -130,7 +130,7 @@ public final class WPIMathJNI {
* matrix.
*
* @param mat Array of elements of the matrix to be updated.
* @param lowerTriangular Whether or not mat is lower triangular.
* @param lowerTriangular Whether mat is lower triangular.
* @param rows How many rows there are.
* @param vec Vector to use for the rank update.
* @param sigma Sigma value to use for the rank update.

View File

@@ -35,7 +35,7 @@ public class PIDController implements Sendable, AutoCloseable {
private double m_minimumInput;
// Do the endpoints wrap around? eg. Absolute encoder
// Do the endpoints wrap around? e.g. Absolute encoder
private boolean m_continuous;
// The error at the time of the most recent call to calculate()

View File

@@ -297,7 +297,7 @@ public class ProfiledPIDController implements Sendable {
*/
public double calculate(double measurement) {
if (m_controller.isContinuousInputEnabled()) {
// Get error which is smallest distance between goal and measurement
// Get error which is the smallest distance between goal and measurement
double errorBound = (m_maximumInput - m_minimumInput) / 2.0;
double goalMinDistance =
MathUtil.inputModulus(m_goal.position - measurement, -errorBound, errorBound);

View File

@@ -244,7 +244,7 @@ public class DifferentialDrivePoseEstimator {
* don't use your own time source by calling {@link
* DifferentialDrivePoseEstimator#updateWithTime(double,Rotation2d,double,double)}, then you
* must use a timestamp with an epoch since FPGA startup (i.e., the epoch of this timestamp is
* the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}. This means that
* the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}). This means that
* you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as your time source
* in this case.
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement (x position

View File

@@ -200,7 +200,7 @@ public class ExtendedKalmanFilter<States extends Num, Inputs extends Num, Output
* Returns an element of the state estimate x-hat.
*
* @param row Row of x-hat.
* @return the value of the state estimate x-hat at i.
* @return the value of the state estimate x-hat at that row.
*/
@Override
public double getXhat(int row) {
@@ -249,7 +249,7 @@ public class ExtendedKalmanFilter<States extends Num, Inputs extends Num, Output
* Project the model into the future with a new control input u.
*
* @param u New control input from controller.
* @param f The function used to linearlize the model.
* @param f The function used to linearize the model.
* @param dtSeconds Timestep for prediction.
*/
public void predict(

View File

@@ -169,7 +169,7 @@ public class KalmanFilter<States extends Num, Inputs extends Num, Outputs extend
* Returns an element of the state estimate x-hat.
*
* @param row Row of x-hat.
* @return the state estimate x-hat at i.
* @return the state estimate x-hat at that row.
*/
public double getXhat(int row) {
return m_xHat.get(row, 0);

View File

@@ -33,7 +33,7 @@ public class KalmanFilterLatencyCompensator<S extends Num, I extends Num, O exte
* @param observer The observer.
* @param u The input at the timestamp.
* @param localY The local output at the timestamp
* @param timestampSeconds The timesnap of the state.
* @param timestampSeconds The timestamp of the state.
*/
public void addObserverState(
KalmanTypeFilter<S, I, O> observer,
@@ -117,7 +117,7 @@ public class KalmanFilterLatencyCompensator<S extends Num, I extends Num, O exte
// Index of snapshot taken before the global measurement. Since we already
// handled the case where the index points to the first snapshot, this
// computation is guaranteed to be nonnegative.
// computation is guaranteed to be non-negative.
int prevIdx = nextIdx - 1;
// Find the snapshot closest in time to global measurement

View File

@@ -227,9 +227,9 @@ public class MecanumDrivePoseEstimator {
* don't use your own time source by calling {@link
* MecanumDrivePoseEstimator#updateWithTime(double,Rotation2d,MecanumDriveWheelPositions)},
* then you must use a timestamp with an epoch since FPGA startup (i.e., the epoch of this
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}. This
* means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as your
* time source in this case.
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}).
* This means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as
* your time source in this case.
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement (x position
* in meters, y position in meters, and heading in radians). Increase these numbers to trust
* the vision pose measurement less.

View File

@@ -72,7 +72,7 @@ public class MerweScaledSigmaPoints<S extends Num> {
*
* @param x An array of the means.
* @param s Square-root covariance of the filter.
* @return Two dimensional array of sigma points. Each column contains all of the sigmas for one
* @return Two-dimensional array of sigma points. Each column contains all the sigmas for one
* dimension in the problem space. Ordered by Xi_0, Xi_{1..n}, Xi_{n+1..2n}.
*/
public Matrix<S, ?> squareRootSigmaPoints(Matrix<S, N1> x, Matrix<S, S> s) {

View File

@@ -228,9 +228,9 @@ public class SwerveDrivePoseEstimator {
* don't use your own time source by calling {@link
* SwerveDrivePoseEstimator#updateWithTime(double,Rotation2d,SwerveModulePosition[])}, then
* you must use a timestamp with an epoch since FPGA startup (i.e., the epoch of this
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}. This
* means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as your
* time source in this case.
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}).
* This means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as
* your time source in this case.
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement (x position
* in meters, y position in meters, and heading in radians). Increase these numbers to trust
* the vision pose measurement less.

View File

@@ -284,7 +284,7 @@ public class UnscentedKalmanFilter<States extends Num, Inputs extends Num, Outpu
* Returns an element of the state estimate x-hat.
*
* @param row Row of x-hat.
* @return the value of the state estimate x-hat at i.
* @return the value of the state estimate x-hat at 'i'.
*/
@Override
public double getXhat(int row) {

View File

@@ -167,7 +167,7 @@ public class LinearFilter {
// [s₁ⁿ⁻¹ ⋯ sₙⁿ⁻¹][aₙ] [δₙ₋₁,d]
//
// where δᵢ,ⱼ are the Kronecker delta. The FIR gains are the elements of the
// vector a in reverse order divided by hᵈ.
// vector 'a' in reverse order divided by hᵈ.
//
// The order of accuracy of the approximation is of the form O(hⁿ⁻ᵈ).

View File

@@ -209,8 +209,8 @@ public class Pose2d implements Interpolatable<Pose2d> {
}
/**
* Returns a Twist2d that maps this pose to the end pose. If c is the output of a.Log(b), then
* a.Exp(c) would yield b.
* Returns a Twist2d that maps this pose to the end pose. If c is the output of {@code a.Log(b)},
* then {@code a.Exp(c)} would yield b.
*
* @param end The end pose for the transformation.
* @return The twist that maps this to end.

View File

@@ -233,8 +233,8 @@ public class Pose3d implements Interpolatable<Pose3d> {
}
/**
* Returns a Twist3d that maps this pose to the end pose. If c is the output of a.Log(b), then
* a.Exp(c) would yield b.
* Returns a Twist3d that maps this pose to the end pose. If c is the output of {@code a.Log(b)},
* then {@code a.Exp(c)} would yield b.
*
* @param end The end pose for the transformation.
* @return The twist that maps this to end.

View File

@@ -8,7 +8,7 @@ import java.util.Objects;
/**
* A change in distance along a 2D arc since the last pose update. We can use ideas from
* differential calculus to create new Pose2ds from a Twist2d and vise versa.
* differential calculus to create new Pose2d objects from a Twist2d and vise versa.
*
* <p>A Twist can be used to represent a difference between two poses.
*/

View File

@@ -8,7 +8,7 @@ import java.util.Objects;
/**
* A change in distance along a 3D arc since the last pose update. We can use ideas from
* differential calculus to create new Pose3ds from a Twist3d and vise versa.
* differential calculus to create new Pose3d objects from a Twist3d and vise versa.
*
* <p>A Twist can be used to represent a difference between two poses.
*/

View File

@@ -16,8 +16,8 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>The inverse kinematics (converting from a desired chassis velocity to individual wheel speeds)
* uses the relative locations of the wheels with respect to the center of rotation. The center of
* rotation for inverse kinematics is also variable. This means that you can set your set your
* center of rotation in a corner of the robot to perform special evasion maneuvers.
* rotation for inverse kinematics is also variable. This means that you can set your center of
* rotation in a corner of the robot to perform special evasion maneuvers.
*
* <p>Forward kinematics (converting an array of wheel speeds into the overall chassis motion) is
* performs the exact opposite of what inverse kinematics does. Since this is an overdetermined

View File

@@ -19,8 +19,8 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>The inverse kinematics (converting from a desired chassis velocity to individual module
* states) uses the relative locations of the modules with respect to the center of rotation. The
* center of rotation for inverse kinematics is also variable. This means that you can set your set
* your center of rotation in a corner of the robot to perform special evasion maneuvers.
* center of rotation for inverse kinematics is also variable. This means that you can set your
* center of rotation in a corner of the robot to perform special evasion maneuvers.
*
* <p>Forward kinematics (converting an array of module states into the overall chassis motion) is
* performs the exact opposite of what inverse kinematics does. Since this is an overdetermined
@@ -44,9 +44,10 @@ public class SwerveDriveKinematics {
/**
* Constructs a swerve drive kinematics object. This takes in a variable number of wheel locations
* as Translation2ds. The order in which you pass in the wheel locations is the same order that
* you will receive the module states when performing inverse kinematics. It is also expected that
* you pass in the module states in the same order when calling the forward kinematics methods.
* as Translation2d objects. The order in which you pass in the wheel locations is the same order
* that you will receive the module states when performing inverse kinematics. It is also expected
* that you pass in the module states in the same order when calling the forward kinematics
* methods.
*
* @param wheelsMeters The locations of the wheels relative to the physical center of the robot.
*/

View File

@@ -45,7 +45,7 @@ public abstract class Spline {
}
// This simply multiplies by the coefficients. We need to divide out t some
// n number of times where n is the derivative we want to take.
// n number of times when n is the derivative we want to take.
SimpleMatrix combined = coefficients.mult(polynomialBases);
// Get x and y

View File

@@ -21,7 +21,7 @@ import org.ejml.simple.SimpleMatrix;
*
* <p>For everything in this file, "inputs" and "outputs" are defined from the perspective of the
* plant. This means U is an input and Y is an output (because you give the plant U (powers) and it
* gives you back a Y (sensor values). This is the opposite of what they mean from the perspective
* gives you back a Y (sensor values)). This is the opposite of what they mean from the perspective
* of the controller (U is an output because that's what goes to the motors and Y is an input
* because that's what comes back from the sensors).
*

View File

@@ -111,7 +111,7 @@ public class DifferentialDriveVoltageConstraint implements TrajectoryConstraint
/ 2);
}
// When turning about a point inside of the wheelbase (i.e. radius less than half
// When turning about a point inside the wheelbase (i.e. radius less than half
// the trackwidth), the inner wheel's direction changes, but the magnitude remains
// the same. The formula above changes sign for the inner wheel when this happens.
// We can accurately account for this by simply negating the inner wheel.