Package frc.spectrumLib.swerve
Class MapleSimSwerveDrivetrain.TalonFXMotorControllerSim
java.lang.Object
frc.spectrumLib.swerve.MapleSimSwerveDrivetrain.TalonFXMotorControllerSim
- All Implemented Interfaces:
SimulatedMotorController
- Direct Known Subclasses:
MapleSimSwerveDrivetrain.TalonFXMotorControllerWithRemoteCanCoderSim
- Enclosing class:
- MapleSimSwerveDrivetrain
public static class MapleSimSwerveDrivetrain.TalonFXMotorControllerSim
extends Object
implements SimulatedMotorController
Feeds Maple-Sim's rotor state into a TalonFX's sim state and returns the voltage the motor
asks for.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ironmaple.simulation.motorsims.SimulatedMotorController
SimulatedMotorController.GenericMotorController -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionupdateControlSignal(Angle mechanismAngle, AngularVelocity mechanismVelocity, Angle encoderAngle, AngularVelocity encoderVelocity) Writes the rotor-side angles and the battery voltage, then returns the motor voltage the controller is requesting.
-
Field Details
-
id
public final int id
-
-
Constructor Details
-
TalonFXMotorControllerSim
-
-
Method Details
-
updateControlSignal
public Voltage updateControlSignal(Angle mechanismAngle, AngularVelocity mechanismVelocity, Angle encoderAngle, AngularVelocity encoderVelocity) Writes the rotor-side angles and the battery voltage, then returns the motor voltage the controller is requesting. The mechanism-side arguments are ignored, since this path only ever writes the rotor side.- Specified by:
updateControlSignalin interfaceSimulatedMotorController
-