Package swervelib.parser
Record Class SwerveParser.SwerveDriveDevices
java.lang.Object
java.lang.Record
swervelib.parser.SwerveParser.SwerveDriveDevices
- Record Components:
swerveDrive-SwerveDrivebuilt from these devices.gyro- Raw gyro device (e.g. aPigeon2instance), ornullif the configured gyro type is"custom"(the caller is expected to supply/own their own gyro in that case).modules- Raw devices for each module, in the same order asSwerveDriveJson.modules.
- Enclosing class:
- SwerveParser
public static record SwerveParser.SwerveDriveDevices(yams.mechanisms.swerve.SwerveDrive swerveDrive, Object gyro, SwerveParser.SwerveModuleDevices[] modules)
extends Record
Raw hardware devices created by
SwerveParser.createSwerveDriveDevices(SwerveDriveConfig), alongside the
SwerveDrive it built.-
Constructor Summary
ConstructorsConstructorDescriptionSwerveDriveDevices(yams.mechanisms.swerve.SwerveDrive swerveDrive, Object gyro, SwerveParser.SwerveModuleDevices[] modules) Creates an instance of aSwerveDriveDevicesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.gyro()Returns the value of thegyrorecord component.final inthashCode()Returns a hash code value for this object.modules()Returns the value of themodulesrecord component.yams.mechanisms.swerve.SwerveDriveReturns the value of theswerveDriverecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SwerveDriveDevices
public SwerveDriveDevices(yams.mechanisms.swerve.SwerveDrive swerveDrive, Object gyro, SwerveParser.SwerveModuleDevices[] modules) Creates an instance of aSwerveDriveDevicesrecord class.- Parameters:
swerveDrive- the value for theswerveDriverecord componentgyro- the value for thegyrorecord componentmodules- the value for themodulesrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
swerveDrive
public yams.mechanisms.swerve.SwerveDrive swerveDrive()Returns the value of theswerveDriverecord component.- Returns:
- the value of the
swerveDriverecord component
-
gyro
Returns the value of thegyrorecord component.- Returns:
- the value of the
gyrorecord component
-
modules
Returns the value of themodulesrecord component.- Returns:
- the value of the
modulesrecord component
-