Skip to content

Commit

Permalink
[wpilib] deprecate PIDCommand and PIDSubsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Jan 5, 2024
1 parent 13f4460 commit 7bdb06b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class PIDCommand extends Command {
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
*/
@Deprecated
public PIDCommand(
PIDController controller,
DoubleSupplier measurementSource,
Expand Down Expand Up @@ -67,6 +68,7 @@ public PIDCommand(
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
*/
@Deprecated
public PIDCommand(
PIDController controller,
DoubleSupplier measurementSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public abstract class PIDSubsystem extends SubsystemBase {
* @param initialPosition the initial setpoint of the subsystem
*/
@SuppressWarnings("this-escape")
@Deprecated
public PIDSubsystem(PIDController controller, double initialPosition) {
m_controller = requireNonNullParam(controller, "controller", "PIDSubsystem");
setSetpoint(initialPosition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

using namespace frc2;

[[deprecated("This is now deprecated use PIDController instead")]]
PIDCommand::PIDCommand(frc::PIDController controller,
std::function<double()> measurementSource,
std::function<double()> setpointSource,
Expand All @@ -20,6 +21,7 @@ PIDCommand::PIDCommand(frc::PIDController controller,
AddRequirements(requirements);
}

[[deprecated("This is now deprecated use PIDController instead")]]
PIDCommand::PIDCommand(frc::PIDController controller,
std::function<double()> measurementSource,
double setpoint, std::function<void(double)> useOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

using namespace frc2;

[[deprecated("This is now deprecated use PIDController instead")]]
PIDSubsystem::PIDSubsystem(frc::PIDController controller,
double initialPosition)
: m_controller{std::move(controller)} {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <functional>

#include <frc/controller/PIDController.h>
#include <wpi/deprecated.h>

#include "frc2/command/Command.h"
#include "frc2/command/CommandHelper.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#pragma once

#include <frc/controller/PIDController.h>
#include <wpi/deprecated.h>

#include "frc2/command/SubsystemBase.h"

Expand Down

0 comments on commit 7bdb06b

Please sign in to comment.