[wpilib] Use inclusive language where practical (#2533)

Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
sciencewhiz
2020-06-19 23:06:34 -07:00
committed by GitHub
parent 1ba616f843
commit dfb130270a
12 changed files with 65 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -48,9 +48,9 @@ class ExampleSmartMotorController : public frc::SpeedController {
/**
* Places this motor controller in follower mode.
*
* @param master The master to follow.
* @param leader The leader to follow.
*/
void Follow(ExampleSmartMotorController master) {}
void Follow(ExampleSmartMotorController leader) {}
/**
* Returns the encoder distance.

View File

@@ -60,13 +60,13 @@ class Drivetrain {
static constexpr double kWheelRadius = 0.0508; // meters
static constexpr int kEncoderResolution = 4096;
frc::PWMVictorSPX m_leftMaster{1};
frc::PWMVictorSPX m_leftLeader{1};
frc::PWMVictorSPX m_leftFollower{2};
frc::PWMVictorSPX m_rightMaster{3};
frc::PWMVictorSPX m_rightLeader{3};
frc::PWMVictorSPX m_rightFollower{4};
frc::SpeedControllerGroup m_leftGroup{m_leftMaster, m_leftFollower};
frc::SpeedControllerGroup m_rightGroup{m_rightMaster, m_rightFollower};
frc::SpeedControllerGroup m_leftGroup{m_leftLeader, m_leftFollower};
frc::SpeedControllerGroup m_rightGroup{m_rightLeader, m_rightFollower};
frc::Encoder m_leftEncoder{0, 1};
frc::Encoder m_rightEncoder{2, 3};

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -10,16 +10,16 @@
using namespace DriveConstants;
DriveSubsystem::DriveSubsystem()
: m_leftMaster{kLeftMotor1Port},
m_leftSlave{kLeftMotor2Port},
m_rightMaster{kRightMotor1Port},
m_rightSlave{kRightMotor2Port},
: m_leftLeader{kLeftMotor1Port},
m_leftFollower{kLeftMotor2Port},
m_rightLeader{kRightMotor1Port},
m_rightFollower{kRightMotor2Port},
m_feedforward{ks, kv, ka} {
m_leftSlave.Follow(m_leftMaster);
m_rightSlave.Follow(m_rightMaster);
m_leftFollower.Follow(m_leftLeader);
m_rightFollower.Follow(m_rightLeader);
m_leftMaster.SetPID(kp, 0, 0);
m_rightMaster.SetPID(kp, 0, 0);
m_leftLeader.SetPID(kp, 0, 0);
m_rightLeader.SetPID(kp, 0, 0);
}
void DriveSubsystem::Periodic() {
@@ -29,10 +29,10 @@ void DriveSubsystem::Periodic() {
void DriveSubsystem::SetDriveStates(
frc::TrapezoidProfile<units::meters>::State left,
frc::TrapezoidProfile<units::meters>::State right) {
m_leftMaster.SetSetpoint(ExampleSmartMotorController::PIDMode::kPosition,
m_leftLeader.SetSetpoint(ExampleSmartMotorController::PIDMode::kPosition,
left.position.to<double>(),
m_feedforward.Calculate(left.velocity) / 12_V);
m_rightMaster.SetSetpoint(ExampleSmartMotorController::PIDMode::kPosition,
m_rightLeader.SetSetpoint(ExampleSmartMotorController::PIDMode::kPosition,
right.position.to<double>(),
m_feedforward.Calculate(right.velocity) / 12_V);
}
@@ -42,16 +42,16 @@ void DriveSubsystem::ArcadeDrive(double fwd, double rot) {
}
void DriveSubsystem::ResetEncoders() {
m_leftMaster.ResetEncoder();
m_rightMaster.ResetEncoder();
m_leftLeader.ResetEncoder();
m_rightLeader.ResetEncoder();
}
units::meter_t DriveSubsystem::GetLeftEncoderDistance() {
return units::meter_t(m_leftMaster.GetEncoderDistance());
return units::meter_t(m_leftLeader.GetEncoderDistance());
}
units::meter_t DriveSubsystem::GetRightEncoderDistance() {
return units::meter_t(m_rightMaster.GetEncoderDistance());
return units::meter_t(m_rightLeader.GetEncoderDistance());
}
void DriveSubsystem::SetMaxOutput(double maxOutput) {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -48,9 +48,9 @@ class ExampleSmartMotorController : public frc::SpeedController {
/**
* Places this motor controller in follower mode.
*
* @param master The master to follow.
* @param leader The leader to follow.
*/
void Follow(ExampleSmartMotorController master) {}
void Follow(ExampleSmartMotorController leader) {}
/**
* Returns the encoder distance.

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -77,14 +77,14 @@ class DriveSubsystem : public frc2::SubsystemBase {
// declared private and exposed only through public methods.
// The motor controllers
ExampleSmartMotorController m_leftMaster;
ExampleSmartMotorController m_leftSlave;
ExampleSmartMotorController m_rightMaster;
ExampleSmartMotorController m_rightSlave;
ExampleSmartMotorController m_leftLeader;
ExampleSmartMotorController m_leftFollower;
ExampleSmartMotorController m_rightLeader;
ExampleSmartMotorController m_rightFollower;
// A feedforward component for the drive
frc::SimpleMotorFeedforward<units::meters> m_feedforward;
// The robot's drive
frc::DifferentialDrive m_drive{m_leftMaster, m_rightMaster};
frc::DifferentialDrive m_drive{m_leftLeader, m_rightLeader};
};

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -48,9 +48,9 @@ class ExampleSmartMotorController : public frc::SpeedController {
/**
* Places this motor controller in follower mode.
*
* @param master The master to follow.
* @param leader The leader to follow.
*/
void Follow(ExampleSmartMotorController master) {}
void Follow(ExampleSmartMotorController leader) {}
/**
* Returns the encoder distance.