[examples] Update SwerveModule constructor doc (NFC) (#4042)

Renamed "port" to "channel" for consistency.
This commit is contained in:
Leonard Abbas
2022-02-22 09:26:16 -08:00
committed by GitHub
parent a260bfd83b
commit e4b91005cf

View File

@@ -36,22 +36,26 @@ public class SwerveModule {
/**
* Constructs a SwerveModule.
*
* @param driveMotorChannel ID for the drive motor.
* @param turningMotorChannel ID for the turning motor.
* @param driveMotorChannel The channel of the drive motor.
* @param turningMotorChannel The channel of the turning motor.
* @param driveEncoderChannels The channels of the drive encoder.
* @param turningEncoderChannels The channels of the turning encoder.
* @param driveEncoderReversed Whether the drive encoder is reversed.
* @param turningEncoderReversed Whether the turning encoder is reversed.
*/
public SwerveModule(
int driveMotorChannel,
int turningMotorChannel,
int[] driveEncoderPorts,
int[] turningEncoderPorts,
int[] driveEncoderChannels,
int[] turningEncoderChannels,
boolean driveEncoderReversed,
boolean turningEncoderReversed) {
m_driveMotor = new Spark(driveMotorChannel);
m_turningMotor = new Spark(turningMotorChannel);
m_driveEncoder = new Encoder(driveEncoderPorts[0], driveEncoderPorts[1]);
m_driveEncoder = new Encoder(driveEncoderChannels[0], driveEncoderChannels[1]);
m_turningEncoder = new Encoder(turningEncoderPorts[0], turningEncoderPorts[1]);
m_turningEncoder = new Encoder(turningEncoderChannels[0], turningEncoderChannels[1]);
// Set the distance per pulse for the drive encoder. We can simply use the
// distance traveled for one rotation of the wheel divided by the encoder