mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
PIDSubsystem.cpp: Use make_shared instead of make_unique.
m_controller is a std::shared_ptr, so make_shared should be used. Change-Id: I77c855a3055a372ab3feba1a1d8e5c4bac42157f
This commit is contained in:
committed by
Brad Miller (WPI)
parent
f89c5e150f
commit
6db58a2cc0
@@ -34,7 +34,7 @@ PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d
|
|||||||
PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d,
|
PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d,
|
||||||
double f)
|
double f)
|
||||||
: Subsystem(name) {
|
: Subsystem(name) {
|
||||||
m_controller = std::make_unique<PIDController>(p, i, d, f, this, this);
|
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +51,7 @@ PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d
|
|||||||
PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d,
|
PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d,
|
||||||
double f, double period)
|
double f, double period)
|
||||||
: Subsystem(name) {
|
: Subsystem(name) {
|
||||||
m_controller = std::make_unique<PIDController>(p, i, d, f, this, this, period);
|
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this, period);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,7 +64,7 @@ PIDSubsystem::PIDSubsystem(const std::string &name, double p, double i, double d
|
|||||||
*/
|
*/
|
||||||
PIDSubsystem::PIDSubsystem(double p, double i, double d)
|
PIDSubsystem::PIDSubsystem(double p, double i, double d)
|
||||||
: Subsystem("PIDSubsystem") {
|
: Subsystem("PIDSubsystem") {
|
||||||
m_controller = std::make_unique<PIDController>(p, i, d, this, this);
|
m_controller = std::make_shared<PIDController>(p, i, d, this, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +78,7 @@ PIDSubsystem::PIDSubsystem(double p, double i, double d)
|
|||||||
*/
|
*/
|
||||||
PIDSubsystem::PIDSubsystem(double p, double i, double d, double f)
|
PIDSubsystem::PIDSubsystem(double p, double i, double d, double f)
|
||||||
: Subsystem("PIDSubsystem") {
|
: Subsystem("PIDSubsystem") {
|
||||||
m_controller = std::make_unique<PIDController>(p, i, d, f, this, this);
|
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,7 +96,7 @@ PIDSubsystem::PIDSubsystem(double p, double i, double d, double f)
|
|||||||
PIDSubsystem::PIDSubsystem(double p, double i, double d, double f,
|
PIDSubsystem::PIDSubsystem(double p, double i, double d, double f,
|
||||||
double period)
|
double period)
|
||||||
: Subsystem("PIDSubsystem") {
|
: Subsystem("PIDSubsystem") {
|
||||||
m_controller = std::make_unique<PIDController>(p, i, d, f, this, this, period);
|
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this, period);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user