mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilib] Use inclusive language where practical (#2533)
Co-authored-by: Austin Shalit <austinshalit@gmail.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user