[commands] Deprecate control commands and subsystems (#7143)

This commit is contained in:
Gold856
2024-10-11 22:48:47 -04:00
committed by GitHub
parent 77ee9bdd30
commit 22a04bf470
13 changed files with 47 additions and 4 deletions

View File

@@ -34,7 +34,9 @@ class PIDCommand : public CommandHelper<Command, PIDCommand> {
* @param setpointSource the controller's reference (aka setpoint)
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
* @deprecated Use a PIDController instead
*/
[[deprecated("Use a PIDController instead")]]
PIDCommand(frc::PIDController controller,
std::function<double()> measurementSource,
std::function<double()> setpointSource,
@@ -50,7 +52,9 @@ class PIDCommand : public CommandHelper<Command, PIDCommand> {
* @param setpoint the controller's setpoint (aka setpoint)
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
* @deprecated Use a PIDController instead
*/
[[deprecated("Use a PIDController instead")]]
PIDCommand(frc::PIDController controller,
std::function<double()> measurementSource, double setpoint,
std::function<void(double)> useOutput,

View File

@@ -16,8 +16,10 @@ namespace frc2 {
* This class is provided by the NewCommands VendorDep
*
* @see PIDController
* @deprecated Use a PIDController instead
*/
class PIDSubsystem : public SubsystemBase {
class [[deprecated("Use a PIDController instead")]] PIDSubsystem
: public SubsystemBase {
public:
/**
* Creates a new PIDSubsystem.

View File

@@ -44,7 +44,9 @@ class ProfiledPIDCommand
* @param goalSource the controller's goal
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
* @deprecated Use a ProfiledPIDController instead
*/
[[deprecated("Use a ProfiledPIDController instead")]]
ProfiledPIDCommand(frc::ProfiledPIDController<Distance> controller,
std::function<Distance_t()> measurementSource,
std::function<State()> goalSource,
@@ -66,7 +68,9 @@ class ProfiledPIDCommand
* @param goalSource the controller's goal
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
* @deprecated Use a ProfiledPIDController instead
*/
[[deprecated("Use a ProfiledPIDController instead")]]
ProfiledPIDCommand(frc::ProfiledPIDController<Distance> controller,
std::function<Distance_t()> measurementSource,
std::function<Distance_t()> goalSource,
@@ -88,7 +92,10 @@ class ProfiledPIDCommand
* @param goal the controller's goal
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
* @deprecated Use a ProfiledPIDController instead
*/
[[deprecated("Use a ProfiledPIDController instead")]]
ProfiledPIDCommand(frc::ProfiledPIDController<Distance> controller,
std::function<Distance_t()> measurementSource, State goal,
std::function<void(double, State)> useOutput,
@@ -106,7 +113,9 @@ class ProfiledPIDCommand
* @param goal the controller's goal
* @param useOutput the controller's output
* @param requirements the subsystems required by this command
* @deprecated Use a ProfiledPIDController instead
*/
[[deprecated("Use a ProfiledPIDController instead")]]
ProfiledPIDCommand(frc::ProfiledPIDController<Distance> controller,
std::function<Distance_t()> measurementSource,
Distance_t goal,

View File

@@ -17,9 +17,11 @@ namespace frc2 {
* This class is provided by the NewCommands VendorDep
*
* @see ProfiledPIDController
* @deprecated Use a ProfiledPIDController instead
*/
template <class Distance>
class ProfiledPIDSubsystem : public SubsystemBase {
class [[deprecated("Use a ProfiledPIDController instead")]] ProfiledPIDSubsystem
: public SubsystemBase {
using Distance_t = units::unit_t<Distance>;
using Velocity =
units::compound_unit<Distance, units::inverse<units::seconds>>;

View File

@@ -40,7 +40,9 @@ class TrapezoidProfileCommand
* @param goal The supplier for the desired state
* @param currentState The current state
* @param requirements The list of requirements.
* @deprecated Use a TrapezoidProfile instead
*/
[[deprecated("Use a TrapezoidProfile instead")]]
TrapezoidProfileCommand(frc::TrapezoidProfile<Distance> profile,
std::function<void(State)> output,
std::function<State()> goal,

View File

@@ -16,9 +16,11 @@ namespace frc2 {
* profile by overriding the `UseState` method.
*
* This class is provided by the NewCommands VendorDep
* @deprecated Use a TrapezoidProfile instead
*/
template <class Distance>
class TrapezoidProfileSubsystem : public SubsystemBase {
class [[deprecated("Use a TrapezoidProfile instead")]] TrapezoidProfileSubsystem
: public SubsystemBase {
using Distance_t = units::unit_t<Distance>;
using Velocity =
units::compound_unit<Distance, units::inverse<units::seconds>>;