Interface SystemSim<T>
public interface SystemSim<T>
System Simulation
This interface defines the contract for a system simulation, which can be used to abstract the behavior of all WPILib linear system sims in one interface.
-
Method Summary
Modifier and TypeMethodDescriptionGets the wrapped WPILib linear system simulation instance.org.wpilib.units.measure.AngleGets the current position of the mechanism in the simulation.org.wpilib.units.measure.AngularVelocityGets the current velocity of the mechanism in the simulation.static SystemSim<org.wpilib.simulation.DCMotorSim> of(org.wpilib.simulation.DCMotorSim dcMotorSim) static SystemSim<org.wpilib.simulation.ElevatorSim> of(org.wpilib.simulation.ElevatorSim elevatorSim, org.wpilib.units.measure.Distance drumRadius) static SystemSim<org.wpilib.simulation.FlywheelSim> of(org.wpilib.simulation.FlywheelSim flywheelSim) static SystemSim<org.wpilib.simulation.SingleJointedArmSim> of(org.wpilib.simulation.SingleJointedArmSim armSim) voidsetInputVoltage(org.wpilib.units.measure.Voltage voltage) Sets the input voltage for the simulation.voidupdate(org.wpilib.units.measure.Time dt) Updates the simulation
-
Method Details
-
setInputVoltage
Sets the input voltage for the simulation.- Parameters:
voltage- The input voltage to set for the simulation.
-
update
Updates the simulation- Parameters:
dt- The time step to advance the simulation
-
getMechanismPosition
org.wpilib.units.measure.Angle getMechanismPosition()Gets the current position of the mechanism in the simulation.- Returns:
- The current position of the mechanism.
-
getMechanismVelocity
org.wpilib.units.measure.AngularVelocity getMechanismVelocity()Gets the current velocity of the mechanism in the simulation.- Returns:
- The current velocity of the mechanism.
-
getLinearSystemSim
Gets the wrapped WPILib linear system simulation instance.- Returns:
- The wrapped WPILib linear system simulation instance.
-
of
-
of
-
of
-
of
-