Class SwerveConfig
java.lang.Object
frc.robot.subsystems.swerve.SwerveConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigEncoderOffsets(double frontLeft, double frontRight, double backLeft, double backRight) doubleintintintintintintdoubledoubledoubledoubledoubledoubledouble[]The offsets last passed toconfigEncoderOffsets(double, double, double, double), in rotations (front left, front right, back left, back right), or null if it was never called.intintintintintintdoubledoubledoubleintdoubledoubledoubledoublebooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetAimDeadband(double aimDeadband) voidsetAngularSpeedAt12Volts(AngularVelocity angularSpeedAt12Volts) voidvoidsetDeadband(double deadband) voidsetDriveGearRatio(double driveGearRatio) voidsetInvertLeftSide(boolean invertLeftSide) voidsetInvertRightSide(boolean invertRightSide) voidsetLinearSpeedAt12Volts(LinearVelocity linearSpeedAt12Volts) voidsetOnboardImuMount(OnboardIMU.MountOrientation onboardImuMount) voidsetSlipCurrent(Current slipCurrent) voidsetSteerGearRatio(double steerGearRatio) voidsetSteerMotorReversed(boolean steerMotorReversed) voidsetTargetHeading(double targetHeading) voidsetWheelRadius(Distance wheelRadius)
-
Constructor Details
-
SwerveConfig
public SwerveConfig()
-
-
Method Details
-
getModules
public SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration>[] getModules() -
updateConfig
-
getEncoderOffsetRotations
public double[] getEncoderOffsetRotations()The offsets last passed toconfigEncoderOffsets(double, double, double, double), in rotations (front left, front right, back left, back right), or null if it was never called. Kept as given, so the params defaults (SwerveOffsetParams) are exactly the numbers in the robot's config. -
configEncoderOffsets
public SwerveConfig configEncoderOffsets(double frontLeft, double frontRight, double backLeft, double backRight) -
getSimLoopPeriod
public double getSimLoopPeriod() -
getDeadband
public double getDeadband() -
setDeadband
public void setDeadband(double deadband) -
getAimDeadband
public double getAimDeadband() -
setAimDeadband
public void setAimDeadband(double aimDeadband) -
getDriveGearRatio
public double getDriveGearRatio() -
setDriveGearRatio
public void setDriveGearRatio(double driveGearRatio) -
getSteerGearRatio
public double getSteerGearRatio() -
setSteerGearRatio
public void setSteerGearRatio(double steerGearRatio) -
getWheelRadius
-
setWheelRadius
-
getLinearSpeedAt12Volts
-
setLinearSpeedAt12Volts
-
getAngularSpeedAt12Volts
-
setAngularSpeedAt12Volts
-
getOnboardImuMount
-
setOnboardImuMount
-
getKPRotationController
public double getKPRotationController() -
getKIRotationController
public double getKIRotationController() -
getKDRotationController
public double getKDRotationController() -
getBlueAlliancePerspectiveRotation
-
getRedAlliancePerspectiveRotation
-
getSteerGains
-
getDriveGains
-
getSteerClosedLoopOutput
-
getDriveClosedLoopOutput
-
getSlipCurrent
-
setSlipCurrent
-
getDriveInitialConfigs
-
getSteerInitialConfigs
-
getCanCoderInitialConfigs
-
getPigeonConfigs
-
getCoupleRatio
public double getCoupleRatio() -
isSteerMotorReversed
public boolean isSteerMotorReversed() -
setSteerMotorReversed
public void setSteerMotorReversed(boolean steerMotorReversed) -
isInvertLeftSide
public boolean isInvertLeftSide() -
setInvertLeftSide
public void setInvertLeftSide(boolean invertLeftSide) -
isInvertRightSide
public boolean isInvertRightSide() -
setInvertRightSide
public void setInvertRightSide(boolean invertRightSide) -
getCanBus
-
setCanBus
-
getPigeonId
public int getPigeonId() -
getSteerInertia
public double getSteerInertia() -
getDriveInertia
public double getDriveInertia() -
getSteerFrictionVoltage
-
getDriveFrictionVoltage
-
getDrivetrainConstants
-
getConstantCreator
public SwerveModuleConstantsFactory<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> getConstantCreator() -
getDrivebaseRadiusInches
public double getDrivebaseRadiusInches() -
getDrivebaseRadiusMeters
public double getDrivebaseRadiusMeters() -
getFrontLeftDriveMotorId
public int getFrontLeftDriveMotorId() -
getFrontLeftSteerMotorId
public int getFrontLeftSteerMotorId() -
getFrontLeftEncoderId
public int getFrontLeftEncoderId() -
getFrontLeftEncoderOffset
-
isFrontLeftSteerInverted
public boolean isFrontLeftSteerInverted() -
getFrontLeftXPos
-
getFrontLeftYPos
-
getFrontRightDriveMotorId
public int getFrontRightDriveMotorId() -
getFrontRightSteerMotorId
public int getFrontRightSteerMotorId() -
getFrontRightEncoderId
public int getFrontRightEncoderId() -
getFrontRightEncoderOffset
-
isFrontRightSteerInverted
public boolean isFrontRightSteerInverted() -
getFrontRightXPos
-
getFrontRightYPos
-
getBackLeftDriveMotorId
public int getBackLeftDriveMotorId() -
getBackLeftSteerMotorId
public int getBackLeftSteerMotorId() -
getBackLeftEncoderId
public int getBackLeftEncoderId() -
getBackLeftEncoderOffset
-
isBackLeftSteerInverted
public boolean isBackLeftSteerInverted() -
getBackLeftXPos
-
getBackLeftYPos
-
getBackRightDriveMotorId
public int getBackRightDriveMotorId() -
getBackRightSteerMotorId
public int getBackRightSteerMotorId() -
getBackRightEncoderId
public int getBackRightEncoderId() -
getBackRightEncoderOffset
-
isBackRightSteerInverted
public boolean isBackRightSteerInverted() -
getBackRightXPos
-
getBackRightYPos
-
getTargetHeading
public double getTargetHeading() -
setTargetHeading
public void setTargetHeading(double targetHeading) -
getFrontLeft
public SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> getFrontLeft() -
getFrontRight
public SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> getFrontRight() -
getBackLeft
public SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> getBackLeft() -
getBackRight
public SwerveModuleConstants<TalonFXConfiguration, TalonFXConfiguration, CANcoderConfiguration> getBackRight()
-