[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

@@ -26,12 +26,11 @@ using namespace frc;
DifferentialDrive::DifferentialDrive(SpeedController& leftMotor,
SpeedController& rightMotor)
: m_leftMotor(&leftMotor), m_rightMotor(&rightMotor) {
auto& registry = wpi::SendableRegistry::GetInstance();
registry.AddChild(this, m_leftMotor);
registry.AddChild(this, m_rightMotor);
wpi::SendableRegistry::AddChild(this, m_leftMotor);
wpi::SendableRegistry::AddChild(this, m_rightMotor);
static int instances = 0;
++instances;
registry.AddLW(this, "DifferentialDrive", instances);
wpi::SendableRegistry::AddLW(this, "DifferentialDrive", instances);
}
void DifferentialDrive::ArcadeDrive(double xSpeed, double zRotation,