mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpimath] Move PIDController from frc2 to frc namespace (#5640)
The old PIDController class in the frc namespace was removed for the 2023 season.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
using namespace frc;
|
||||
|
||||
HolonomicDriveController::HolonomicDriveController(
|
||||
frc2::PIDController xController, frc2::PIDController yController,
|
||||
PIDController xController, PIDController yController,
|
||||
ProfiledPIDController<units::radian> thetaController)
|
||||
: m_xController(std::move(xController)),
|
||||
m_yController(std::move(yController)),
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "frc/MathUtil.h"
|
||||
#include "wpimath/MathShared.h"
|
||||
|
||||
using namespace frc2;
|
||||
using namespace frc;
|
||||
|
||||
PIDController::PIDController(double Kp, double Ki, double Kd,
|
||||
units::second_t period)
|
||||
@@ -95,7 +95,7 @@ void PIDController::SetSetpoint(double setpoint) {
|
||||
if (m_continuous) {
|
||||
double errorBound = (m_maximumInput - m_minimumInput) / 2.0;
|
||||
m_positionError =
|
||||
frc::InputModulus(m_setpoint - m_measurement, -errorBound, errorBound);
|
||||
InputModulus(m_setpoint - m_measurement, -errorBound, errorBound);
|
||||
} else {
|
||||
m_positionError = m_setpoint - m_measurement;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ double PIDController::Calculate(double measurement) {
|
||||
if (m_continuous) {
|
||||
double errorBound = (m_maximumInput - m_minimumInput) / 2.0;
|
||||
m_positionError =
|
||||
frc::InputModulus(m_setpoint - m_measurement, -errorBound, errorBound);
|
||||
InputModulus(m_setpoint - m_measurement, -errorBound, errorBound);
|
||||
} else {
|
||||
m_positionError = m_setpoint - m_measurement;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user