[wpilib] Deprecate getInstance() in favor of static functions (#3440)

Co-authored-by: Noam Zaks <imnoamzaks@gmail.com>
This commit is contained in:
Peter Johnson
2021-06-15 23:06:03 -07:00
committed by GitHub
parent 26ff9371d9
commit 362066a9b7
105 changed files with 1500 additions and 1539 deletions

View File

@@ -33,14 +33,13 @@ MecanumDrive::MecanumDrive(SpeedController& frontLeftMotor,
m_rearLeftMotor(&rearLeftMotor),
m_frontRightMotor(&frontRightMotor),
m_rearRightMotor(&rearRightMotor) {
auto& registry = wpi::SendableRegistry::GetInstance();
registry.AddChild(this, m_frontLeftMotor);
registry.AddChild(this, m_rearLeftMotor);
registry.AddChild(this, m_frontRightMotor);
registry.AddChild(this, m_rearRightMotor);
wpi::SendableRegistry::AddChild(this, m_frontLeftMotor);
wpi::SendableRegistry::AddChild(this, m_rearLeftMotor);
wpi::SendableRegistry::AddChild(this, m_frontRightMotor);
wpi::SendableRegistry::AddChild(this, m_rearRightMotor);
static int instances = 0;
++instances;
registry.AddLW(this, "MecanumDrive", instances);
wpi::SendableRegistry::AddLW(this, "MecanumDrive", instances);
}
void MecanumDrive::DriveCartesian(double ySpeed, double xSpeed,