Interface XSwerveDriveElectricalContract
public interface XSwerveDriveElectricalContract
This interface defines the base electrical contract
for robots implementing swerve drive.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the steering encoders are ready to be used.doubleReturns the gear ratio for the drive motors.getDriveMotor(SwerveInstance swerveInstance) Returns theDeviceInfofor the drive motor for the givenSwerveInstance.default DistanceReturns the diameter of the drive wheels.getSteeringEncoder(SwerveInstance swerveInstance) Returns theDeviceInfofor the steering encoder for the givenSwerveInstance.doubleReturns the gear ratio for the steering motors.getSteeringMotor(SwerveInstance swerveInstance) Returns theDeviceInfofor the steering motor for the givenSwerveInstance.getSwerveModuleOffsets(SwerveInstance swerveInstance) Returns the offset from the center of the robot as aTranslation2dfor the givenSwerveInstance.booleanReturns true if the drive is ready to be used.
-
Method Details
-
isDriveReady
boolean isDriveReady()Returns true if the drive is ready to be used.- Returns:
- True if the drive is ready to be used.
-
areCanCodersReady
boolean areCanCodersReady()Returns true if the steering encoders are ready to be used.- Returns:
- True if the steering encoders are ready to be used.
-
getDriveMotor
Returns theDeviceInfofor the drive motor for the givenSwerveInstance.- Parameters:
swerveInstance- The swerve instance.- Returns:
- The
DeviceInfofor the drive motor for the givenSwerveInstance.
-
getSteeringMotor
Returns theDeviceInfofor the steering motor for the givenSwerveInstance.- Parameters:
swerveInstance- The swerve instance.- Returns:
- The
DeviceInfofor the steering motor for the givenSwerveInstance.
-
getSteeringEncoder
Returns theDeviceInfofor the steering encoder for the givenSwerveInstance.- Parameters:
swerveInstance- The swerve instance.- Returns:
- The
DeviceInfofor the steering encoder for the givenSwerveInstance.
-
getSwerveModuleOffsets
Returns the offset from the center of the robot as aTranslation2dfor the givenSwerveInstance.- Parameters:
swerveInstance- The swerve instance.- Returns:
- The offset from the center of the robot as a
Translation2dfor the givenSwerveInstance, in inches.
-
getDriveWheelDiameter
Returns the diameter of the drive wheels.- Returns:
- The diameter of the drive wheels.
-
getDriveGearRatio
double getDriveGearRatio()Returns the gear ratio for the drive motors.- Returns:
- The gear ratio for the drive motors.
-
getSteeringGearRatio
double getSteeringGearRatio()Returns the gear ratio for the steering motors.- Returns:
- The gear ratio for the steering motors.
-