Represents a simulated flywheel mechanism.
More...
#include <frc/simulation/FlywheelSim.h>
|
| FlywheelSim (const LinearSystem< 1, 1, 1 > &plant, const DCMotor &gearbox, double gearing, const std::array< double, 1 > &measurementStdDevs={0.0}) |
| Creates a simulated flywheel mechanism. More...
|
|
| FlywheelSim (const DCMotor &gearbox, double gearing, units::kilogram_square_meter_t moi, const std::array< double, 1 > &measurementStdDevs={0.0}) |
| Creates a simulated flywheel mechanism. More...
|
|
units::radians_per_second_t | GetAngularVelocity () const |
| Returns the flywheel velocity. More...
|
|
units::ampere_t | GetCurrentDraw () const override |
| Returns the flywheel current draw. More...
|
|
void | SetInputVoltage (units::volt_t voltage) |
| Sets the input voltage for the flywheel. More...
|
|
| LinearSystemSim (const LinearSystem< States, Inputs, Outputs > &system, const std::array< double, Outputs > &measurementStdDevs={}) |
| Creates a simulated generic linear system. More...
|
|
virtual | ~LinearSystemSim ()=default |
|
void | Update (units::second_t dt) |
| Updates the simulation. More...
|
|
const Vectord< Outputs > & | GetOutput () const |
| Returns the current output of the plant. More...
|
|
double | GetOutput (int row) const |
| Returns an element of the current output of the plant. More...
|
|
void | SetInput (const Vectord< Inputs > &u) |
| Sets the system inputs (usually voltages). More...
|
|
void | SetInput (int row, double value) |
|
void | SetState (const Vectord< States > &state) |
| Sets the system state. More...
|
|
virtual units::ampere_t | GetCurrentDraw () const |
| Returns the current drawn by this simulated system. More...
|
|
Represents a simulated flywheel mechanism.
◆ FlywheelSim() [1/2]
frc::sim::FlywheelSim::FlywheelSim |
( |
const LinearSystem< 1, 1, 1 > & |
plant, |
|
|
const DCMotor & |
gearbox, |
|
|
double |
gearing, |
|
|
const std::array< double, 1 > & |
measurementStdDevs = {0.0} |
|
) |
| |
Creates a simulated flywheel mechanism.
- Parameters
-
plant | The linear system representing the flywheel. |
gearbox | The type of and number of motors in the flywheel gearbox. |
gearing | The gearing of the flywheel (numbers greater than 1 represent reductions). |
measurementStdDevs | The standard deviation of the measurement noise. |
◆ FlywheelSim() [2/2]
frc::sim::FlywheelSim::FlywheelSim |
( |
const DCMotor & |
gearbox, |
|
|
double |
gearing, |
|
|
units::kilogram_square_meter_t |
moi, |
|
|
const std::array< double, 1 > & |
measurementStdDevs = {0.0} |
|
) |
| |
Creates a simulated flywheel mechanism.
- Parameters
-
gearbox | The type of and number of motors in the flywheel gearbox. |
gearing | The gearing of the flywheel (numbers greater than 1 represent reductions). |
moi | The moment of inertia of the flywheel. |
measurementStdDevs | The standard deviation of the measurement noise. |
◆ GetAngularVelocity()
units::radians_per_second_t frc::sim::FlywheelSim::GetAngularVelocity |
( |
| ) |
const |
Returns the flywheel velocity.
- Returns
- The flywheel velocity.
◆ GetCurrentDraw()
units::ampere_t frc::sim::FlywheelSim::GetCurrentDraw |
( |
| ) |
const |
|
overridevirtual |
◆ SetInputVoltage()
void frc::sim::FlywheelSim::SetInputVoltage |
( |
units::volt_t |
voltage | ) |
|
Sets the input voltage for the flywheel.
- Parameters
-
voltage | The input voltage. |
The documentation for this class was generated from the following file: