diff --git a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h b/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h index d3071eb4b0c..ec8db10c6fa 100644 --- a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h +++ b/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.h @@ -17,6 +17,7 @@ class ReplaceMeCommand2 : public frc2::CommandHelper { public: + /* You should consider using the more terse Command factories API instead */ ReplaceMeCommand2(); void Initialize() override; diff --git a/wpilibcExamples/src/main/cpp/commands/commands.json b/wpilibcExamples/src/main/cpp/commands/commands.json index 4fd9706f26f..235d5710098 100644 --- a/wpilibcExamples/src/main/cpp/commands/commands.json +++ b/wpilibcExamples/src/main/cpp/commands/commands.json @@ -95,70 +95,6 @@ "replacename": "ReplaceMeParallelRaceGroup", "commandversion": 2 }, - { - "name": "PIDCommand", - "description": "A command that runs a PIDController.", - "tags": [ - "pidcommand" - ], - "foldername": "pidcommand", - "headers": [ - "ReplaceMePIDCommand.h" - ], - "source": [ - "ReplaceMePIDCommand.cpp" - ], - "replacename": "ReplaceMePIDCommand", - "commandversion": 2 - }, - { - "name": "PIDSubsystem", - "description": "A subsystem that runs a PIDController.", - "tags": [ - "pidsubsystem" - ], - "foldername": "pidsubsystem2", - "headers": [ - "ReplaceMePIDSubsystem2.h" - ], - "source": [ - "ReplaceMePIDSubsystem2.cpp" - ], - "replacename": "ReplaceMePIDSubsystem2", - "commandversion": 2 - }, - { - "name": "ProfiledPIDCommand", - "description": "A command that runs a ProfiledPIDController.", - "tags": [ - "profiledpidcommand" - ], - "foldername": "profiledpidcommand", - "headers": [ - "ReplaceMeProfiledPIDCommand.h" - ], - "source": [ - "ReplaceMeProfiledPIDCommand.cpp" - ], - "replacename": "ReplaceMeProfiledPIDCommand", - "commandversion": 2 - }, - { - "name": "ProfiledPIDSubsystem", - "description": "A subsystem that runs a ProfiledPIDController.", - "tags": [ - "profiledpidsubsystem" - ], - "foldername": "profiledpidsubsystem", - "headers": [ - "ReplaceMeProfiledPIDSubsystem.h" - ], - "source": [ - "ReplaceMeProfiledPIDSubsystem.cpp" - ], - "replacename": "ReplaceMeProfiledPIDSubsystem", - "commandversion": 2 - }, { "name": "SequentialCommandGroup", "description": "A command group that runs commands in sequence.", @@ -190,21 +126,5 @@ ], "replacename": "ReplaceMeSubsystem2", "commandversion": 2 - }, - { - "name": "TrapezoidProfileSubsystem", - "description": "A subsystem that executes a trapezoidal motion profile.", - "tags": [ - "trapezoidprofilesubsystem" - ], - "foldername": "trapezoidprofilesubsystem", - "headers": [ - "ReplaceMeTrapezoidProfileSubsystem.h" - ], - "source": [ - "ReplaceMeTrapezoidProfileSubsystem.cpp" - ], - "replacename": "ReplaceMeTrapezoidProfileSubsystem", - "commandversion": 2 } ] diff --git a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h index cd8de5f73f4..b828d368cde 100644 --- a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h +++ b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.h @@ -7,6 +7,9 @@ #include #include +// NOTE: Consider using this command inline, rather than writing a subclass. For more +// information, see: +// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html class ReplaceMeInstantCommand2 : public frc2::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h index 1cbabdd53f5..f970db42fdb 100644 --- a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h +++ b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.h @@ -7,6 +7,9 @@ #include #include +// NOTE: Consider using this command inline, rather than writing a subclass. For more +// information, see: +// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html class ReplaceMeParallelCommandGroup : public frc2::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h index 91be75f88b7..82270e140a6 100644 --- a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h +++ b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.h @@ -7,6 +7,9 @@ #include #include +// NOTE: Consider using this command inline, rather than writing a subclass. For more +// information, see: +// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html class ReplaceMeParallelDeadlineGroup : public frc2::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h index a3f4227d517..99765c1fd70 100644 --- a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h +++ b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.h @@ -7,6 +7,9 @@ #include #include +// NOTE: Consider using this command inline, rather than writing a subclass. For more +// information, see: +// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html class ReplaceMeParallelRaceGroup : public frc2::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp b/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp deleted file mode 100644 index 0bc1d7480b1..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "ReplaceMePIDCommand.h" - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMePIDCommand::ReplaceMePIDCommand() - : CommandHelper{frc::PIDController{0, 0, 0}, - // This should return the measurement - [] { return 0; }, - // This should return the setpoint (can also be a constant) - [] { return 0; }, - // This uses the output - [](double output) { - // Use the output here - }} {} - -// Returns true when the command should end. -bool ReplaceMePIDCommand::IsFinished() { - return false; -} diff --git a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h b/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h deleted file mode 100644 index a78d2160d50..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidcommand/ReplaceMePIDCommand.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include -#include - -class ReplaceMePIDCommand - : public frc2::CommandHelper { - public: - ReplaceMePIDCommand(); - - bool IsFinished() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp b/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp deleted file mode 100644 index fe289f62a45..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "ReplaceMePIDSubsystem2.h" - -ReplaceMePIDSubsystem2::ReplaceMePIDSubsystem2() - // The PIDController used by the subsystem - : PIDSubsystem{frc::PIDController{0, 0, 0}} {} - -void ReplaceMePIDSubsystem2::UseOutput(double output, double setpoint) { - // Use the output here -} - -double ReplaceMePIDSubsystem2::GetMeasurement() { - // Return the process variable measurement here - return 0; -} diff --git a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h b/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h deleted file mode 100644 index 0b450f4a834..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/pidsubsystem2/ReplaceMePIDSubsystem2.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include - -class ReplaceMePIDSubsystem2 : public frc2::PIDSubsystem { - public: - ReplaceMePIDSubsystem2(); - - protected: - void UseOutput(double output, double setpoint) override; - - double GetMeasurement() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp b/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp deleted file mode 100644 index f3fd26af8b2..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "ReplaceMeProfiledPIDCommand.h" - -#include -#include - -// NOTE: Consider using this command inline, rather than writing a subclass. -// For more information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -ReplaceMeProfiledPIDCommand::ReplaceMeProfiledPIDCommand() - : CommandHelper{ - // The ProfiledPIDController that the command will use - frc::ProfiledPIDController{ - // The PID gains - 0, - 0, - 0, - // The motion profile constraints - {0_mps, 0_mps_sq}}, - // This should return the measurement - [] { return 0_m; }, - // This should return the goal state (can also be a constant) - [] { - return frc::TrapezoidProfile::State{0_m, 0_mps}; - }, - // This uses the output and current trajectory setpoint - [](double output, - frc::TrapezoidProfile::State setpoint) { - // Use the output and setpoint here - }} {} - -// Returns true when the command should end. -bool ReplaceMeProfiledPIDCommand::IsFinished() { - return false; -} diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h b/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h deleted file mode 100644 index 0bd45ac57ea..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include -#include -#include - -class ReplaceMeProfiledPIDCommand - : public frc2::CommandHelper, - ReplaceMeProfiledPIDCommand> { - public: - ReplaceMeProfiledPIDCommand(); - - bool IsFinished() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp b/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp deleted file mode 100644 index 2ee899c03c5..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "ReplaceMeProfiledPIDSubsystem.h" - -#include -#include - -ReplaceMeProfiledPIDSubsystem::ReplaceMeProfiledPIDSubsystem() - // The ProfiledPIDController used by the subsystem - : ProfiledPIDSubsystem{frc::ProfiledPIDController{ - // The PID gains - 0, - 0, - 0, - // The constraints for the motion profiles - {0_mps, 0_mps_sq}}} {} - -void ReplaceMeProfiledPIDSubsystem::UseOutput( - double output, frc::TrapezoidProfile::State setpoint) { - // Use the output and current trajectory setpoint here -} - -units::meter_t ReplaceMeProfiledPIDSubsystem::GetMeasurement() { - // Return the process variable measurement here - return 0_m; -} diff --git a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h b/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h deleted file mode 100644 index 8e86f3fff40..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include -#include - -class ReplaceMeProfiledPIDSubsystem - : public frc2::ProfiledPIDSubsystem { - public: - ReplaceMeProfiledPIDSubsystem(); - - protected: - void UseOutput(double output, - frc::TrapezoidProfile::State setpoint) override; - - units::meter_t GetMeasurement() override; -}; diff --git a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h index f9fe09e3a9a..6dcbc53ab46 100644 --- a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h +++ b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.h @@ -7,6 +7,9 @@ #include #include +// NOTE: Consider using this command inline, rather than writing a subclass. For more +// information, see: +// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html class ReplaceMeSequentialCommandGroup : public frc2::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp b/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp deleted file mode 100644 index a3f458c04f0..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "ReplaceMeTrapezoidProfileSubsystem.h" - -#include -#include - -ReplaceMeTrapezoidProfileSubsystem::ReplaceMeTrapezoidProfileSubsystem() - : TrapezoidProfileSubsystem( - // The motion profile constraints - {5_mps, 5_mps_sq}, - // The initial position of the mechanism - 0_m) {} - -void ReplaceMeTrapezoidProfileSubsystem::UseState( - frc::TrapezoidProfile::State state) { - // Use the current profile state here -} diff --git a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h b/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h deleted file mode 100644 index 99b9410a86d..00000000000 --- a/wpilibcExamples/src/main/cpp/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include -#include - -class ReplaceMeTrapezoidProfileSubsystem - : frc2::TrapezoidProfileSubsystem { - public: - ReplaceMeTrapezoidProfileSubsystem(); - - protected: - void UseState(frc::TrapezoidProfile::State state) override; -}; diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java index 2d90dc27faf..5286ee571cf 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/command2/ReplaceMeCommand.java @@ -6,6 +6,7 @@ import edu.wpi.first.wpilibj2.command.Command; +/* You should consider using the more terse Command factories API instead */ public class ReplaceMeCommand extends Command { /** Creates a new ReplaceMeCommand. */ public ReplaceMeCommand() { diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json index 5631c5bf3eb..ad9d3baee55 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/commands.json @@ -59,46 +59,6 @@ "replacename": "ReplaceMeParallelRaceGroup", "commandversion": 2 }, - { - "name": "PIDCommand", - "description": "A command that runs a PIDController.", - "tags": [ - "pidcommand" - ], - "foldername": "pidcommand", - "replacename": "ReplaceMePIDCommand", - "commandversion": 2 - }, - { - "name": "PIDSubsystem", - "description": "A subsystem that runs a PIDController.", - "tags": [ - "pidsubsystem" - ], - "foldername": "pidsubsystem2", - "replacename": "ReplaceMePIDSubsystem", - "commandversion": 2 - }, - { - "name": "ProfiledPIDCommand", - "description": "A command that runs a ProfiledPIDController.", - "tags": [ - "profiledpidcommand" - ], - "foldername": "profiledpidcommand", - "replacename": "ReplaceMeProfiledPIDCommand", - "commandversion": 2 - }, - { - "name": "ProfiledPIDSubsystem", - "description": "A subsystem that runs a ProfiledPIDController.", - "tags": [ - "profiledpidsubsystem" - ], - "foldername": "profiledpidsubsystem", - "replacename": "ReplaceMeProfiledPIDSubsystem", - "commandversion": 2 - }, { "name": "SequentialCommandGroup", "description": "A command group that runs commands in sequence.", @@ -118,15 +78,5 @@ "foldername": "subsystem2", "replacename": "ReplaceMeSubsystem", "commandversion": 2 - }, - { - "name": "TrapezoidProfileSubsystem", - "description": "A subsystem that executes a trapezoidal motion profile.", - "tags": [ - "trapezoidprofilesubsystem" - ], - "foldername": "trapezoidprofilesubsystem", - "replacename": "ReplaceMeTrapezoidProfileSubsystem", - "commandversion": 2 } ] diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java deleted file mode 100644 index ff39b12674a..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidcommand/ReplaceMePIDCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package edu.wpi.first.wpilibj.commands.pidcommand; - -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.wpilibj2.command.PIDCommand; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMePIDCommand extends PIDCommand { - /** Creates a new ReplaceMePIDCommand. */ - public ReplaceMePIDCommand() { - super( - // The controller that the command will use - new PIDController(0, 0, 0), - // This should return the measurement - () -> 0, - // This should return the setpoint (can also be a constant) - () -> 0, - // This uses the output - output -> { - // Use the output here - }); - // Use addRequirements() here to declare subsystem dependencies. - // Configure additional PID options by calling `getController` here. - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java deleted file mode 100644 index 0876d94a11a..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/pidsubsystem2/ReplaceMePIDSubsystem.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package edu.wpi.first.wpilibj.commands.pidsubsystem2; - -import edu.wpi.first.math.controller.PIDController; -import edu.wpi.first.wpilibj2.command.PIDSubsystem; - -public class ReplaceMePIDSubsystem extends PIDSubsystem { - /** Creates a new ReplaceMePIDSubsystem. */ - public ReplaceMePIDSubsystem() { - super( - // The PIDController used by the subsystem - new PIDController(0, 0, 0)); - } - - @Override - public void useOutput(double output, double setpoint) { - // Use the output here - } - - @Override - public double getMeasurement() { - // Return the process variable measurement here - return 0; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java deleted file mode 100644 index f3d44102db5..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidcommand/ReplaceMeProfiledPIDCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package edu.wpi.first.wpilibj.commands.profiledpidcommand; - -import edu.wpi.first.math.controller.ProfiledPIDController; -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.wpilibj2.command.ProfiledPIDCommand; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html -public class ReplaceMeProfiledPIDCommand extends ProfiledPIDCommand { - /** Creates a new ReplaceMeProfiledPIDCommand. */ - public ReplaceMeProfiledPIDCommand() { - super( - // The ProfiledPIDController used by the command - new ProfiledPIDController( - // The PID gains - 0, - 0, - 0, - // The motion profile constraints - new TrapezoidProfile.Constraints(0, 0)), - // This should return the measurement - () -> 0, - // This should return the goal (can also be a constant) - () -> new TrapezoidProfile.State(), - // This uses the output - (output, setpoint) -> { - // Use the output (and setpoint, if desired) here - }); - // Use addRequirements() here to declare subsystem dependencies. - // Configure additional PID options by calling `getController` here. - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java deleted file mode 100644 index 60eda3508cd..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/profiledpidsubsystem/ReplaceMeProfiledPIDSubsystem.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package edu.wpi.first.wpilibj.commands.profiledpidsubsystem; - -import edu.wpi.first.math.controller.ProfiledPIDController; -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.wpilibj2.command.ProfiledPIDSubsystem; - -public class ReplaceMeProfiledPIDSubsystem extends ProfiledPIDSubsystem { - /** Creates a new ReplaceMeProfiledPIDSubsystem. */ - public ReplaceMeProfiledPIDSubsystem() { - super( - // The ProfiledPIDController used by the subsystem - new ProfiledPIDController( - 0, - 0, - 0, - // The motion profile constraints - new TrapezoidProfile.Constraints(0, 0))); - } - - @Override - public void useOutput(double output, TrapezoidProfile.State setpoint) { - // Use the output (and optionally the setpoint) here - } - - @Override - public double getMeasurement() { - // Return the process variable measurement here - return 0; - } -} diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java deleted file mode 100644 index e95f95792fc..00000000000 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/commands/trapezoidprofilesubsystem/ReplaceMeTrapezoidProfileSubsystem.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package edu.wpi.first.wpilibj.commands.trapezoidprofilesubsystem; - -import edu.wpi.first.math.trajectory.TrapezoidProfile; -import edu.wpi.first.wpilibj2.command.TrapezoidProfileSubsystem; - -public class ReplaceMeTrapezoidProfileSubsystem extends TrapezoidProfileSubsystem { - /** Creates a new ReplaceMeTrapezoidProfileSubsystem. */ - public ReplaceMeTrapezoidProfileSubsystem() { - super( - // The constraints for the generated profiles - new TrapezoidProfile.Constraints(0, 0), - // The initial position of the mechanism - 0); - } - - @Override - protected void useState(TrapezoidProfile.State state) { - // Use the computed profile state here. - } -}