Class SimulatedMotorController.GenericMotorController

java.lang.Object
org.ironmaple.simulation.motorsims.SimulatedMotorController.GenericMotorController
All Implemented Interfaces:
SimulatedMotorController
Enclosing interface:
SimulatedMotorController

public static final class SimulatedMotorController.GenericMotorController extends Object implements SimulatedMotorController
  • Constructor Details

    • GenericMotorController

      public GenericMotorController(DCMotor model)
  • Method Details

    • withCurrentLimit

      public SimulatedMotorController.GenericMotorController withCurrentLimit(edu.wpi.first.units.measure.Current currentLimit)
    • withSoftwareLimits

      public SimulatedMotorController.GenericMotorController withSoftwareLimits(edu.wpi.first.units.measure.Angle forwardSoftwareLimit, edu.wpi.first.units.measure.Angle reverseSoftwareLimit)
    • requestVoltage

      public void requestVoltage(edu.wpi.first.units.measure.Voltage voltage)
    • constrainOutputVoltage

      public edu.wpi.first.units.measure.Voltage constrainOutputVoltage(edu.wpi.first.units.measure.Angle encoderAngle, edu.wpi.first.units.measure.AngularVelocity encoderVelocity, edu.wpi.first.units.measure.Voltage requestedVoltage)

      (Utility Function) Constrains the Output Voltage of a Motor.

      Constrains the output voltage of a motor such that the stator current does not exceed the current limit

      Prevents motor from exceeding software limits

      Parameters:
      encoderAngle - the angle of the encoder
      encoderVelocity - the velocity of the encoder
      requestedVoltage - the requested voltage
      Returns:
      the constrained voltage that satisfied the limits
    • updateControlSignal

      public edu.wpi.first.units.measure.Voltage updateControlSignal(edu.wpi.first.units.measure.Angle mechanismAngle, edu.wpi.first.units.measure.AngularVelocity mechanismVelocity, edu.wpi.first.units.measure.Angle encoderAngle, edu.wpi.first.units.measure.AngularVelocity encoderVelocity)
      Specified by:
      updateControlSignal in interface SimulatedMotorController