Package frc.robot.shared.config
Class MotorConfig
java.lang.Object
frc.robot.shared.config.AbstractConfig
frc.robot.shared.config.MotorConfig
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class frc.robot.shared.config.AbstractConfig
AbstractConfig.ComponentPoseConfig -
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleForward travel soft limit in degrees.intCAN device ID of the motor controller.booleanTrue when the motor output should be inverted.doubleGear ratio expressed as motor rotations per one mechanism rotation.doubleReverse travel soft limit in degrees.intSmart current limit for the motor in amps.booleanTrue when the motor should enforce forward and reverse soft limits. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the forward soft limit in degrees.doubleReturns the forward soft limit in radians.intReturns the CAN ID of the motor controller.booleanReturns whether the motor output is inverted.doubleReturns the gear ratio (motor rotations per mechanism rotation).doubleReturns the reverse soft limit in degrees.doubleReturns the reverse soft limit in radians.intReturns the smart current limit in amps.booleanReturns whether the motor should enforce minimum and maximum setpoint limits.Methods inherited from class frc.robot.shared.config.AbstractConfig
getDashboardPrefix, initializeNestedDashboardPrefixes, readTunableBoolean, readTunableDegrees, readTunableDegreesAsRadians, readTunableNumber, readTunableString, setDashboardPrefix
-
Field Details
-
motorCanId
public int motorCanIdCAN device ID of the motor controller. -
motorInverted
public boolean motorInvertedTrue when the motor output should be inverted. -
smartCurrentLimitAmps
public int smartCurrentLimitAmpsSmart current limit for the motor in amps. -
motorRotationsPerMechanismRotation
public double motorRotationsPerMechanismRotationGear ratio expressed as motor rotations per one mechanism rotation. -
useSetpointLimits
public boolean useSetpointLimitsTrue when the motor should enforce forward and reverse soft limits. -
reverseSoftLimitDegrees
public double reverseSoftLimitDegreesReverse travel soft limit in degrees. -
forwardSoftLimitDegrees
public double forwardSoftLimitDegreesForward 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
-