mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Deprecate getInstance() in favor of static functions (#3440)
Co-authored-by: Noam Zaks <imnoamzaks@gmail.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user