Interface XSwerveDriveElectricalContract
public interface XSwerveDriveElectricalContract
This interface defines the base electrical contract
for robots implementing swerve drive.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the steering encoders are ready to be used.double
Returns the gear ratio for the drive motors.getDriveMotor
(SwerveInstance swerveInstance) Returns theDeviceInfo
for the drive motor for the givenSwerveInstance
.default Distance
Returns the diameter of the drive wheels.getSteeringEncoder
(SwerveInstance swerveInstance) Returns theDeviceInfo
for the steering encoder for the givenSwerveInstance
.double
Returns the gear ratio for the steering motors.getSteeringMotor
(SwerveInstance swerveInstance) Returns theDeviceInfo
for the steering motor for the givenSwerveInstance
.getSwerveModuleOffsetsInInches
(SwerveInstance swerveInstance) Returns the offset from the center of the robot as anXYPair
for the givenSwerveInstance
.boolean
Returns 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 theDeviceInfo
for the drive motor for the givenSwerveInstance
.- Parameters:
swerveInstance
- The swerve instance.- Returns:
- The
DeviceInfo
for the drive motor for the givenSwerveInstance
.
-
getSteeringMotor
Returns theDeviceInfo
for the steering motor for the givenSwerveInstance
.- Parameters:
swerveInstance
- The swerve instance.- Returns:
- The
DeviceInfo
for the steering motor for the givenSwerveInstance
.
-
getSteeringEncoder
Returns theDeviceInfo
for the steering encoder for the givenSwerveInstance
.- Parameters:
swerveInstance
- The swerve instance.- Returns:
- The
DeviceInfo
for the steering encoder for the givenSwerveInstance
.
-
getSwerveModuleOffsetsInInches
Returns the offset from the center of the robot as anXYPair
for the givenSwerveInstance
.- Parameters:
swerveInstance
- The swerve instance.- Returns:
- The offset from the center of the robot as an
XYPair
for 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.
-