Package org.team1126.lib.swerve.config
Class SwerveModuleConfig
java.lang.Object
org.team1126.lib.swerve.config.SwerveModuleConfig
Config builder for
SwerveAPI modules.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe encoder to use, generated by theSwerveEncodersclass.edu.wpi.first.math.geometry.Translation2dThe module's location relative to the center of the robot.The move motor to use, generated by theSwerveMotorsclass.The name of the module.The turn motor to use, generated by theSwerveMotorsclass. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the encoder to use.setLocation(double x, double y) Sets the module's location relative to the center of the robot (in meters).Sets the move motor to use.Sets the module's name.Sets the turn motor to use.voidverify()Verifies the config.
-
Field Details
-
name
The name of the module. -
location
public edu.wpi.first.math.geometry.Translation2d locationThe module's location relative to the center of the robot. -
moveMotor
The move motor to use, generated by theSwerveMotorsclass. -
turnMotor
The turn motor to use, generated by theSwerveMotorsclass. -
encoder
The encoder to use, generated by theSwerveEncodersclass.
-
-
Constructor Details
-
SwerveModuleConfig
public SwerveModuleConfig()
-
-
Method Details
-
setName
Sets the module's name. Utilized by telemetry.- Parameters:
name- The name of the module.
-
setLocation
Sets the module's location relative to the center of the robot (in meters).- Parameters:
x- The module's X location in meters.y- The module's Y location in meters.
-
setMoveMotor
Sets the move motor to use.- Parameters:
motor- The move motor to use, generated by theSwerveMotorsclass.
-
setTurnMotor
Sets the turn motor to use.- Parameters:
motor- The turn motor to use, generated by theSwerveMotorsclass.
-
setEncoder
Sets the encoder to use.- Parameters:
encoder- The encoder to use, generated by theSwerveEncodersclass.
-
verify
public void verify()Verifies the config.
-