Package frc.robot.subsystems.drive
Record Class DriveConstants.SwerveModuleConfig
java.lang.Object
java.lang.Record
frc.robot.subsystems.drive.DriveConstants.SwerveModuleConfig
- Record Components:
name- A descriptive name for the module.driveCanId- The CAN ID of the drive motor controller.turnCanId- The CAN ID of the turn motor controller.encoderCanId- The CAN ID of the absolute CANcoder.zeroOffset- The absolute encoder offset to read zero when the wheel is facing forward.translation- The physical location of the module relative to the center of the robot.
- Enclosing class:
- DriveConstants
public static record DriveConstants.SwerveModuleConfig(String name, int driveCanId, int turnCanId, int encoderCanId, Angle zeroOffset, Translation2d translation)
extends Record
Represents the hardware configuration for a single swerve module.
-
Constructor Summary
ConstructorsConstructorDescriptionSwerveModuleConfig(String name, int driveCanId, int turnCanId, int encoderCanId, Angle zeroOffset, Translation2d translation) Creates an instance of aSwerveModuleConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thedriveCanIdrecord component.intReturns the value of theencoderCanIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationrecord component.intReturns the value of theturnCanIdrecord component.Returns the value of thezeroOffsetrecord component.
-
Constructor Details
-
SwerveModuleConfig
public SwerveModuleConfig(String name, int driveCanId, int turnCanId, int encoderCanId, Angle zeroOffset, Translation2d translation) Creates an instance of aSwerveModuleConfigrecord class.- Parameters:
name- the value for thenamerecord componentdriveCanId- the value for thedriveCanIdrecord componentturnCanId- the value for theturnCanIdrecord componentencoderCanId- the value for theencoderCanIdrecord componentzeroOffset- the value for thezeroOffsetrecord componenttranslation- the value for thetranslationrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
driveCanId
public int driveCanId()Returns the value of thedriveCanIdrecord component.- Returns:
- the value of the
driveCanIdrecord component
-
turnCanId
public int turnCanId()Returns the value of theturnCanIdrecord component.- Returns:
- the value of the
turnCanIdrecord component
-
encoderCanId
public int encoderCanId()Returns the value of theencoderCanIdrecord component.- Returns:
- the value of the
encoderCanIdrecord component
-
zeroOffset
Returns the value of thezeroOffsetrecord component.- Returns:
- the value of the
zeroOffsetrecord component
-
translation
Returns the value of thetranslationrecord component.- Returns:
- the value of the
translationrecord component
-