|
| FlywheelSim (const LinearSystem< 1, 1, 1 > &plant, const DCMotor &gearbox, const std::array< double, 1 > &measurementStdDevs={0.0}) |
| Creates a simulated flywheel mechanism.
|
|
void | SetVelocity (units::radians_per_second_t velocity) |
| Sets the flywheel's angular velocity.
|
|
units::radians_per_second_t | GetAngularVelocity () const |
| Returns the flywheel's velocity.
|
|
units::radians_per_second_squared_t | GetAngularAcceleration () const |
| Returns the flywheel's acceleration.
|
|
units::newton_meter_t | GetTorque () const |
| Returns the flywheel's torque.
|
|
units::ampere_t | GetCurrentDraw () const |
| Returns the flywheel's current draw.
|
|
units::volt_t | GetInputVoltage () const |
| Gets the input voltage for the flywheel.
|
|
void | SetInputVoltage (units::volt_t voltage) |
| Sets the input voltage for the flywheel.
|
|
DCMotor | Gearbox () const |
| Returns the gearbox.
|
|
double | Gearing () const |
| Returns the gearing;.
|
|
units::kilogram_square_meter_t | J () const |
| Returns the moment of inertia.
|
|
void | SetState (const Vectord< States > &state) |
| Sets the system state.
|
|
| LinearSystemSim (const LinearSystem< States, Inputs, Outputs > &system, const std::array< double, Outputs > &measurementStdDevs={}) |
| Creates a simulated generic linear system.
|
|
virtual | ~LinearSystemSim ()=default |
|
void | Update (units::second_t dt) |
| Updates the simulation.
|
|
const Vectord< Outputs > & | GetOutput () const |
| Returns the current output of the plant.
|
|
double | GetOutput (int row) const |
| Returns an element of the current output of the plant.
|
|
void | SetInput (const Vectord< Inputs > &u) |
| Sets the system inputs (usually voltages).
|
|
void | SetInput (int row, double value) |
| Sets the system inputs.
|
|
const Vectord< Inputs > & | GetInput () const |
| Returns the current input of the plant.
|
|
double | GetInput (int row) const |
| Returns an element of the current input of the plant.
|
|
void | SetState (const Vectord< States > &state) |
| Sets the system state.
|
|
|
virtual Vectord< States > | UpdateX (const Vectord< States > ¤tXhat, const Vectord< Inputs > &u, units::second_t dt) |
| Updates the state estimate of the system.
|
|
void | ClampInput (double maxInput) |
| Clamp the input vector such that no element exceeds the given voltage.
|
|
LinearSystem< States, Inputs, Outputs > | m_plant |
| The plant that represents the linear system.
|
|
Vectord< States > | m_x |
| State vector.
|
|
Vectord< Inputs > | m_u |
| Input vector.
|
|
Vectord< Outputs > | m_y |
| Output vector.
|
|
std::array< double, Outputs > | m_measurementStdDevs |
| The standard deviations of measurements, used for adding noise to the measurements.
|
|
Represents a simulated flywheel mechanism.