mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[examples] Update SwerveModule constructor doc (NFC) (#4042)
Renamed "port" to "channel" for consistency.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user