mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[wpilib] LinearSystemSim: Add missing clamp function and getInput() (#6493)
This commit is contained in:
committed by
GitHub
parent
c46847b32a
commit
fbb3669546
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user