Package frc.robot.swerve
Class SwerveConfig
java.lang.Object
frc.robot.swerve.SwerveConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigEncoderOffsets(double frontLeft, double frontRight, double backLeft, double backRight) com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> intintedu.wpi.first.units.measure.Angleintedu.wpi.first.units.measure.Distanceedu.wpi.first.units.measure.Distancecom.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> intintedu.wpi.first.units.measure.Angleintedu.wpi.first.units.measure.Distanceedu.wpi.first.units.measure.Distanceedu.wpi.first.math.geometry.Rotation2dcom.ctre.phoenix6.CANBuscom.ctre.phoenix6.configs.CANcoderConfigurationcom.ctre.phoenix6.swerve.SwerveModuleConstantsFactory<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> doubledoublecom.ctre.phoenix6.swerve.SwerveModuleConstants.ClosedLoopOutputTypeedu.wpi.first.units.measure.Voltagecom.ctre.phoenix6.configs.Slot0Configsdoubledoublecom.ctre.phoenix6.configs.TalonFXConfigurationcom.ctre.phoenix6.swerve.SwerveDrivetrainConstantscom.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> intintedu.wpi.first.units.measure.Angleintedu.wpi.first.units.measure.Distanceedu.wpi.first.units.measure.Distancecom.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration> intintedu.wpi.first.units.measure.Angleintedu.wpi.first.units.measure.Distanceedu.wpi.first.units.measure.Distancedoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoublecom.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, com.ctre.phoenix6.configs.CANcoderConfiguration>[] com.ctre.phoenix6.configs.Pigeon2Configurationintedu.wpi.first.math.geometry.Rotation2ddoubledoubledoubledoubledoubledoubleedu.wpi.first.units.measure.Currentedu.wpi.first.units.measure.LinearVelocitycom.ctre.phoenix6.swerve.SwerveModuleConstants.ClosedLoopOutputTypeedu.wpi.first.units.measure.Voltagecom.ctre.phoenix6.configs.Slot0Configsdoubledoublecom.ctre.phoenix6.configs.TalonFXConfigurationdoubledoubledoubleedu.wpi.first.math.trajectory.TrapezoidProfile.Constraintsdoubledoubleedu.wpi.first.units.measure.DistancebooleanbooleanbooleansetCanBus(com.ctre.phoenix6.CANBus canBus) setDeadband(double deadband) setDriveGearRatio(double driveGearRatio) setInvertLeftSide(boolean invertLeftSide) setInvertRightSide(boolean invertRightSide) setMaxAngularRate(double maxAngularRate) setRobotLength(double robotLength) setRobotWidth(double robotWidth) setSlipCurrent(edu.wpi.first.units.measure.Current slipCurrent) setSpeedAt12Volts(edu.wpi.first.units.measure.LinearVelocity speedAt12Volts) setSteerGearRatio(double steerGearRatio) setSteerMotorReversed(boolean steerMotorReversed) setTargetHeading(double targetHeading) setWheelRadius(edu.wpi.first.units.measure.Distance wheelRadius)
-
Constructor Details
-
SwerveConfig
public SwerveConfig()
-
-
Method Details
-
getModules
public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, getModules()com.ctre.phoenix6.configs.CANcoderConfiguration>[] -
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
- Returns:
this.
-
getRobotLength
public double getRobotLength() -
setRobotLength
- Returns:
this.
-
getMaxAngularRate
public double getMaxAngularRate() -
setMaxAngularRate
- Returns:
this.
-
getDeadband
public double getDeadband() -
setDeadband
- Returns:
this.
-
getDriveGearRatio
public double getDriveGearRatio() -
setDriveGearRatio
- Returns:
this.
-
getSteerGearRatio
public double getSteerGearRatio() -
setSteerGearRatio
- Returns:
this.
-
getWheelRadius
public edu.wpi.first.units.measure.Distance getWheelRadius() -
setWheelRadius
- Returns:
this.
-
getSpeedAt12Volts
public edu.wpi.first.units.measure.LinearVelocity getSpeedAt12Volts() -
setSpeedAt12Volts
- 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() -
getRotationVelocityTolerance
public double getRotationVelocityTolerance() -
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() -
getTranslationVelocityTolerance
public double getTranslationVelocityTolerance() -
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
- 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
- Returns:
this.
-
isInvertLeftSide
public boolean isInvertLeftSide() -
setInvertLeftSide
- Returns:
this.
-
isInvertRightSide
public boolean isInvertRightSide() -
setInvertRightSide
- Returns:
this.
-
getCanBus
public com.ctre.phoenix6.CANBus getCanBus() -
setCanBus
- 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, getConstantCreator()com.ctre.phoenix6.configs.CANcoderConfiguration> -
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, getFrontLeft()com.ctre.phoenix6.configs.CANcoderConfiguration> -
getFrontRight
public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, getFrontRight()com.ctre.phoenix6.configs.CANcoderConfiguration> -
getBackLeft
public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, getBackLeft()com.ctre.phoenix6.configs.CANcoderConfiguration> -
getBackRight
public com.ctre.phoenix6.swerve.SwerveModuleConstants<com.ctre.phoenix6.configs.TalonFXConfiguration,com.ctre.phoenix6.configs.TalonFXConfiguration, getBackRight()com.ctre.phoenix6.configs.CANcoderConfiguration> -
getTargetHeading
public double getTargetHeading() -
setTargetHeading
- Returns:
this.
-