Class SwerveConfig.MotorConfig

  • Enclosing class:
    SwerveConfig

    public static final class SwerveConfig.MotorConfig
    extends java.lang.Object
    A configuration object for a single motor.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean encoderPhase
      Whether or not the encoder is out of phase with the motor.
      SwerveConfig.PID gains
      The PID gains for the motor.
      int id
      The CAN ID of the motor's TalonSRX motor controller.
      boolean inverted
      Whether or not the motor output should be inverted.
      com.ctre.phoenix.motorcontrol.NeutralMode neutralMode
      The mode for the motor when its input is zero.
    • Constructor Summary

      Constructors 
      Constructor Description
      MotorConfig​(int id, boolean inverted, com.ctre.phoenix.motorcontrol.NeutralMode neutralMode, boolean encoderPhase, SwerveConfig.PID gains)
      Constructs a new MotorConfig.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        public final int id
        The CAN ID of the motor's TalonSRX motor controller.
      • inverted

        public final boolean inverted
        Whether or not the motor output should be inverted.
      • neutralMode

        public final com.ctre.phoenix.motorcontrol.NeutralMode neutralMode
        The mode for the motor when its input is zero.
      • encoderPhase

        public final boolean encoderPhase
        Whether or not the encoder is out of phase with the motor.
    • Constructor Detail

      • MotorConfig

        public MotorConfig​(int id,
                           boolean inverted,
                           com.ctre.phoenix.motorcontrol.NeutralMode neutralMode,
                           boolean encoderPhase,
                           SwerveConfig.PID gains)
        Constructs a new MotorConfig.
        Parameters:
        id - the CAN ID of the motor's TalonSRX motor controller.
        inverted - whether to invert motor output values.
        neutralMode - the motor's passive neutral mode.
        encoderPhase - whether the encoder is out of phase with the motor.
        gains - the PID gains for the motor.