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.
  • Field Details

    • id

      public final int id
  • Constructor Details

    • TalonFXMotorControllerSim

      public TalonFXMotorControllerSim(TalonFX talonFX)
  • 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:
      updateControlSignal in interface SimulatedMotorController