[wpilib] LinearSystemSim: Add missing clamp function and getInput() (#6493)

This commit is contained in:
Nicholas Armstrong
2024-04-04 12:19:13 -04:00
committed by GitHub
parent c46847b32a
commit fbb3669546
2 changed files with 36 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ class LinearSystemSim {
*/
void SetInput(const Vectord<Inputs>& u) { m_u = ClampInput(u); }
/*
/**
* Sets the system inputs.
*
* @param row The row in the input matrix to set.
@@ -99,6 +99,21 @@ class LinearSystemSim {
ClampInput(m_u);
}
/**
* Returns the current input of the plant.
*
* @return The current input of the plant.
*/
const Vectord<Inputs>& GetInput() const { return m_u; }
/**
* Returns an element of the current input of the plant.
*
* @param row The row to return.
* @return An element of the current input of the plant.
*/
double GetInput(int row) const { return m_u(row); }
/**
* Sets the system state.
*