Class SwerveConfig

java.lang.Object
frc.robot.swerve.SwerveConfig

public class SwerveConfig extends Object
  • Constructor Details

    • SwerveConfig

      public SwerveConfig()
  • Method Details

    • getModules

      public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration>[] getModules()
    • updateConfig

      public SwerveConfig updateConfig()
    • configEncoderOffsets

      public SwerveConfig configEncoderOffsets(double frontLeft, double frontRight, double backLeft, double backRight)
    • getScoreOffsetFromReef

      public double getScoreOffsetFromReef()
    • getSimLoopPeriod

      public double getSimLoopPeriod()
    • getRobotWidth

      public double getRobotWidth()
    • setRobotWidth

      public SwerveConfig setRobotWidth(double robotWidth)
      Returns:
      this.
    • getRobotLength

      public double getRobotLength()
    • setRobotLength

      public SwerveConfig setRobotLength(double robotLength)
      Returns:
      this.
    • getMaxAngularRate

      public double getMaxAngularRate()
    • setMaxAngularRate

      public SwerveConfig setMaxAngularRate(double maxAngularRate)
      Returns:
      this.
    • getDeadband

      public double getDeadband()
    • setDeadband

      public SwerveConfig setDeadband(double deadband)
      Returns:
      this.
    • getDriveGearRatio

      public double getDriveGearRatio()
    • setDriveGearRatio

      public SwerveConfig setDriveGearRatio(double driveGearRatio)
      Returns:
      this.
    • getSteerGearRatio

      public double getSteerGearRatio()
    • setSteerGearRatio

      public SwerveConfig setSteerGearRatio(double steerGearRatio)
      Returns:
      this.
    • getWheelRadius

      public edu.wpi.first.units.measure.Distance getWheelRadius()
    • setWheelRadius

      public SwerveConfig setWheelRadius(edu.wpi.first.units.measure.Distance wheelRadius)
      Returns:
      this.
    • getSpeedAt12Volts

      public edu.wpi.first.units.measure.LinearVelocity getSpeedAt12Volts()
    • setSpeedAt12Volts

      public SwerveConfig setSpeedAt12Volts(edu.wpi.first.units.measure.LinearVelocity speedAt12Volts)
      Returns:
      this.
    • getKSdrive

      public double getKSdrive()
    • getKSsteer

      public double getKSsteer()
    • getMaxAngularVelocity

      public double getMaxAngularVelocity()
    • getMaxAngularAcceleration

      public double getMaxAngularAcceleration()
    • getKPRotationController

      public double getKPRotationController()
    • getKIRotationController

      public double getKIRotationController()
    • getKDRotationController

      public double getKDRotationController()
    • getRotationTolerance

      public double getRotationTolerance()
    • getKPHoldController

      public double getKPHoldController()
    • getKIHoldController

      public double getKIHoldController()
    • getKDHoldController

      public double getKDHoldController()
    • getKPTranslationController

      public double getKPTranslationController()
    • getKITranslationController

      public double getKITranslationController()
    • getKDTranslationController

      public double getKDTranslationController()
    • getTranslationTolerance

      public double getTranslationTolerance()
    • getTranslationConstraints

      public edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints getTranslationConstraints()
    • getKPTagCenterController

      public double getKPTagCenterController()
    • getKITagCenterController

      public double getKITagCenterController()
    • getKDTagCenterController

      public double getKDTagCenterController()
    • getTagCenterTolerance

      public double getTagCenterTolerance()
    • getKPTagDistanceController

      public double getKPTagDistanceController()
    • getKITagDistanceController

      public double getKITagDistanceController()
    • getKDTagDistanceController

      public double getKDTagDistanceController()
    • getTagDistanceTolerance

      public double getTagDistanceTolerance()
    • getBlueAlliancePerspectiveRotation

      public edu.wpi.first.math.geometry.Rotation2d getBlueAlliancePerspectiveRotation()
    • getRedAlliancePerspectiveRotation

      public edu.wpi.first.math.geometry.Rotation2d getRedAlliancePerspectiveRotation()
    • getSteerGains

      public com.ctre.phoenix6.configs.Slot0Configs getSteerGains()
    • getDriveGains

      public com.ctre.phoenix6.configs.Slot0Configs getDriveGains()
    • getSteerClosedLoopOutput

      public com.ctre.phoenix6.swerve.SwerveModuleConstants.ClosedLoopOutputType getSteerClosedLoopOutput()
    • getDriveClosedLoopOutput

      public com.ctre.phoenix6.swerve.SwerveModuleConstants.ClosedLoopOutputType getDriveClosedLoopOutput()
    • getSlipCurrent

      public edu.wpi.first.units.measure.Current getSlipCurrent()
    • setSlipCurrent

      public SwerveConfig setSlipCurrent(edu.wpi.first.units.measure.Current slipCurrent)
      Returns:
      this.
    • getDriveInitialConfigs

      public com.ctre.phoenix6.configs.TalonFXConfiguration getDriveInitialConfigs()
    • getSteerInitialConfigs

      public com.ctre.phoenix6.configs.TalonFXConfiguration getSteerInitialConfigs()
    • getCanCoderInitialConfigs

      public com.ctre.phoenix6.configs.CANcoderConfiguration getCanCoderInitialConfigs()
    • getPigeonConfigs

      public com.ctre.phoenix6.configs.Pigeon2Configuration getPigeonConfigs()
    • getCoupleRatio

      public double getCoupleRatio()
    • isSteerMotorReversed

      public boolean isSteerMotorReversed()
    • setSteerMotorReversed

      public SwerveConfig setSteerMotorReversed(boolean steerMotorReversed)
      Returns:
      this.
    • isInvertLeftSide

      public boolean isInvertLeftSide()
    • setInvertLeftSide

      public SwerveConfig setInvertLeftSide(boolean invertLeftSide)
      Returns:
      this.
    • isInvertRightSide

      public boolean isInvertRightSide()
    • setInvertRightSide

      public SwerveConfig setInvertRightSide(boolean invertRightSide)
      Returns:
      this.
    • getCanBus

      public com.ctre.phoenix6.CANBus getCanBus()
    • setCanBus

      public SwerveConfig setCanBus(com.ctre.phoenix6.CANBus canBus)
      Returns:
      this.
    • getPigeonId

      public int getPigeonId()
    • getSteerInertia

      public double getSteerInertia()
    • getDriveInertia

      public double getDriveInertia()
    • getSteerFrictionVoltage

      public edu.wpi.first.units.measure.Voltage getSteerFrictionVoltage()
    • getDriveFrictionVoltage

      public edu.wpi.first.units.measure.Voltage getDriveFrictionVoltage()
    • getDrivetrainConstants

      public com.ctre.phoenix6.swerve.SwerveDrivetrainConstants getDrivetrainConstants()
    • getConstantCreator

      public com.ctre.phoenix6.swerve.SwerveModuleConstantsFactory<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> getConstantCreator()
    • getFrontLeftDriveMotorId

      public int getFrontLeftDriveMotorId()
    • getFrontLeftSteerMotorId

      public int getFrontLeftSteerMotorId()
    • getFrontLeftEncoderId

      public int getFrontLeftEncoderId()
    • getFrontLeftEncoderOffset

      public edu.wpi.first.units.measure.Angle getFrontLeftEncoderOffset()
    • getFrontLeftXPos

      public edu.wpi.first.units.measure.Distance getFrontLeftXPos()
    • getFrontLeftYPos

      public edu.wpi.first.units.measure.Distance getFrontLeftYPos()
    • getFrontRightDriveMotorId

      public int getFrontRightDriveMotorId()
    • getFrontRightSteerMotorId

      public int getFrontRightSteerMotorId()
    • getFrontRightEncoderId

      public int getFrontRightEncoderId()
    • getFrontRightEncoderOffset

      public edu.wpi.first.units.measure.Angle getFrontRightEncoderOffset()
    • getFrontRightXPos

      public edu.wpi.first.units.measure.Distance getFrontRightXPos()
    • getFrontRightYPos

      public edu.wpi.first.units.measure.Distance getFrontRightYPos()
    • getBackLeftDriveMotorId

      public int getBackLeftDriveMotorId()
    • getBackLeftSteerMotorId

      public int getBackLeftSteerMotorId()
    • getBackLeftEncoderId

      public int getBackLeftEncoderId()
    • getBackLeftEncoderOffset

      public edu.wpi.first.units.measure.Angle getBackLeftEncoderOffset()
    • getBackLeftXPos

      public edu.wpi.first.units.measure.Distance getBackLeftXPos()
    • getBackLeftYPos

      public edu.wpi.first.units.measure.Distance getBackLeftYPos()
    • getBackRightDriveMotorId

      public int getBackRightDriveMotorId()
    • getBackRightSteerMotorId

      public int getBackRightSteerMotorId()
    • getBackRightEncoderId

      public int getBackRightEncoderId()
    • getBackRightEncoderOffset

      public edu.wpi.first.units.measure.Angle getBackRightEncoderOffset()
    • getBackRightXPos

      public edu.wpi.first.units.measure.Distance getBackRightXPos()
    • getBackRightYPos

      public edu.wpi.first.units.measure.Distance getBackRightYPos()
    • getFrontLeft

      public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> getFrontLeft()
    • getFrontRight

      public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> getFrontRight()
    • getBackLeft

      public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> getBackLeft()
    • getBackRight

      public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.CANcoderConfiguration> getBackRight()
    • getTargetHeading

      public double getTargetHeading()
    • setTargetHeading

      public SwerveConfig setTargetHeading(double targetHeading)
      Returns:
      this.