Class MotorConfig

java.lang.Object
frc.robot.shared.config.AbstractConfig
frc.robot.shared.config.MotorConfig

public class MotorConfig extends AbstractConfig
Base configuration bundle for a single motor controller and its mechanism limits.

Values are deserialized from JSON and exposed through plain getters. Motor configuration is applied once during initialization; changes require a redeploy.

  • Field Details

    • motorCanId

      public int motorCanId
      CAN device ID of the motor controller.
    • motorInverted

      public boolean motorInverted
      True when the motor output should be inverted.
    • smartCurrentLimitAmps

      public int smartCurrentLimitAmps
      Smart current limit for the motor in amps.
    • motorRotationsPerMechanismRotation

      public double motorRotationsPerMechanismRotation
      Gear ratio expressed as motor rotations per one mechanism rotation.
    • useSetpointLimits

      public boolean useSetpointLimits
      True when the motor should enforce forward and reverse soft limits.
    • reverseSoftLimitDegrees

      public double reverseSoftLimitDegrees
      Reverse travel soft limit in degrees.
    • forwardSoftLimitDegrees

      public double forwardSoftLimitDegrees
      Forward travel soft limit in degrees.
  • Constructor Details

    • MotorConfig

      public MotorConfig()
  • Method Details

    • getMotorCanId

      public int getMotorCanId()
      Returns the CAN ID of the motor controller.
      Returns:
      motor controller CAN ID
    • getMotorInverted

      public boolean getMotorInverted()
      Returns whether the motor output is inverted.
      Returns:
      true when the motor output is inverted
    • getSmartCurrentLimitAmps

      public int getSmartCurrentLimitAmps()
      Returns the smart current limit in amps.
      Returns:
      current limit in amps
    • getMotorRotationsPerMechanismRotation

      public double getMotorRotationsPerMechanismRotation()
      Returns the gear ratio (motor rotations per mechanism rotation).
      Returns:
      motor rotations per one mechanism rotation
    • getUseSetpointLimits

      public boolean getUseSetpointLimits()
      Returns whether the motor should enforce minimum and maximum setpoint limits.
      Returns:
      true when setpoint limits are enforced
    • getReverseSoftLimitDegrees

      public double getReverseSoftLimitDegrees()
      Returns the reverse soft limit in degrees.
      Returns:
      reverse soft limit in degrees
    • getForwardSoftLimitDegrees

      public double getForwardSoftLimitDegrees()
      Returns the forward soft limit in degrees.
      Returns:
      forward soft limit in degrees
    • getReverseSoftLimitRadians

      public double getReverseSoftLimitRadians()
      Returns the reverse soft limit in radians.
      Returns:
      reverse soft limit in radians
    • getForwardSoftLimitRadians

      public double getForwardSoftLimitRadians()
      Returns the forward soft limit in radians.
      Returns:
      forward soft limit in radians