Skip to content

Commit

Permalink
formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
narmstro2020 committed Mar 31, 2024
1 parent c374ee1 commit 1400f9a
Showing 1 changed file with 15 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,17 @@
import org.ejml.simple.SimpleMatrix;

/**
* This class helps simulate linear systems. To use this class, do the following
* in the {@link
* This class helps simulate linear systems. To use this class, do the following in the {@link
* edu.wpi.first.wpilibj.IterativeRobotBase#simulationPeriodic} method.
*
* <p>
* Call {@link #setInput(double...)} with the inputs to the system (usually
* voltage).
* <p>Call {@link #setInput(double...)} with the inputs to the system (usually voltage).
*
* <p>
* Call {@link #update} to update the simulation.
* <p>Call {@link #update} to update the simulation.
*
* <p>
* Set simulated sensor readings with the simulated positions in
* {@link #getOutput()}
* <p>Set simulated sensor readings with the simulated positions in {@link #getOutput()}
*
* @param <States> Number of states of the system.
* @param <Inputs> Number of inputs to the system.
* @param <States> Number of states of the system.
* @param <Inputs> Number of inputs to the system.
* @param <Outputs> Number of outputs of the system.
*/
public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs extends Num> {
Expand All @@ -46,10 +40,7 @@ public class LinearSystemSim<States extends Num, Inputs extends Num, Outputs ext
/** Output vector. */
protected Matrix<Outputs, N1> m_y;

/**
* The standard deviations of measurements, used for adding noise to the
* measurements.
*/
/** The standard deviations of measurements, used for adding noise to the measurements. */
protected final Matrix<Outputs, N1> m_measurementStdDevs;

/**
Expand All @@ -64,10 +55,9 @@ public LinearSystemSim(LinearSystem<States, Inputs, Outputs> system) {
/**
* Creates a simulated generic linear system with measurement noise.
*
* @param system The system being controlled.
* @param measurementStdDevs Standard deviations of measurements. Can be null if
* no noise is
* desired.
* @param system The system being controlled.
* @param measurementStdDevs Standard deviations of measurements. Can be null if no noise is
* desired.
*/
public LinearSystemSim(
LinearSystem<States, Inputs, Outputs> system, Matrix<Outputs, N1> measurementStdDevs) {
Expand Down Expand Up @@ -143,13 +133,12 @@ public double getInput(int row) {
public void setInput(Matrix<Inputs, N1> u) {
this.m_u = clampInput(u);
m_u = clampInput(m_u);

}

/**
* Sets the system inputs.
*
* @param row The row in the input matrix to set.
* @param row The row in the input matrix to set.
* @param value The value to set the row to.
*/
public void setInput(int row, double value) {
Expand Down Expand Up @@ -181,8 +170,7 @@ public void setState(Matrix<States, N1> state) {
}

/**
* Returns the current drawn by this simulated system. Override this method to
* add a custom
* Returns the current drawn by this simulated system. Override this method to add a custom
* current calculation.
*
* @return The current drawn by this simulated mechanism.
Expand All @@ -195,8 +183,8 @@ public double getCurrentDrawAmps() {
* Updates the state estimate of the system.
*
* @param currentXhat The current state estimate.
* @param u The system inputs (usually voltage).
* @param dtSeconds The time difference between controller updates.
* @param u The system inputs (usually voltage).
* @param dtSeconds The time difference between controller updates.
* @return The new state.
*/
protected Matrix<States, N1> updateX(
Expand All @@ -205,8 +193,7 @@ protected Matrix<States, N1> updateX(
}

/**
* Clamp the input vector such that no element exceeds the given voltage. If any
* does, the
* Clamp the input vector such that no element exceeds the given voltage. If any does, the
* relative magnitudes of the input will be maintained.
*
* @param u The input vector.
Expand Down

0 comments on commit 1400f9a

Please sign in to comment.