diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/TrapezoidProfileCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/TrapezoidProfileCommand.java index 3bfdbaebf5..8e49706958 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/TrapezoidProfileCommand.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/TrapezoidProfileCommand.java @@ -22,7 +22,6 @@ public class TrapezoidProfileCommand extends Command { private final Consumer m_output; private final Supplier m_goal; private final Supplier m_currentState; - private final boolean m_newAPI; // TODO: Remove private final Timer m_timer = new Timer(); /** @@ -46,29 +45,6 @@ public class TrapezoidProfileCommand extends Command { m_output = requireNonNullParam(output, "output", "TrapezoidProfileCommand"); m_goal = goal; m_currentState = currentState; - m_newAPI = true; - addRequirements(requirements); - } - - /** - * Creates a new TrapezoidProfileCommand that will execute the given {@link TrapezoidProfile}. - * Output will be piped to the provided consumer function. - * - * @param profile The motion profile to execute. - * @param output The consumer for the profile output. - * @param requirements The subsystems required by this command. - * @deprecated The new constructor allows you to pass in a supplier for desired and current state. - * This allows you to change goals at runtime. - */ - @Deprecated(since = "2024", forRemoval = true) - @SuppressWarnings("this-escape") - public TrapezoidProfileCommand( - TrapezoidProfile profile, Consumer output, Subsystem... requirements) { - m_profile = requireNonNullParam(profile, "profile", "TrapezoidProfileCommand"); - m_output = requireNonNullParam(output, "output", "TrapezoidProfileCommand"); - m_newAPI = false; - m_goal = null; - m_currentState = null; addRequirements(requirements); } @@ -80,11 +56,7 @@ public class TrapezoidProfileCommand extends Command { @Override @SuppressWarnings("removal") public void execute() { - if (m_newAPI) { - m_output.accept(m_profile.calculate(m_timer.get(), m_currentState.get(), m_goal.get())); - } else { - m_output.accept(m_profile.calculate(m_timer.get())); - } + m_output.accept(m_profile.calculate(m_timer.get(), m_currentState.get(), m_goal.get())); } @Override diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h index 837dda3e09..30ad9b7087 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h @@ -52,28 +52,6 @@ class TrapezoidProfileCommand m_goal(goal), m_currentState(currentState) { this->AddRequirements(requirements); - m_newAPI = true; - } - - /** - * Creates a new TrapezoidProfileCommand that will execute the given - * TrapezoidalProfile. Output will be piped to the provided consumer function. - * - * @param profile The motion profile to execute. - * @param output The consumer for the profile output. - * @param requirements The list of requirements. - * @deprecated The new constructor allows you to pass in a supplier for - * desired and current state. This allows you to change goals at runtime. - */ - [[deprecated( - "The new constructor allows you to pass in a supplier for desired and " - "current state. This allows you to change goals at runtime.")]] - TrapezoidProfileCommand(frc::TrapezoidProfile profile, - std::function output, - Requirements requirements = {}) - : m_profile(profile), m_output(output) { - this->AddRequirements(requirements); - m_newAPI = false; } void Initialize() override { m_timer.Restart(); } @@ -93,7 +71,6 @@ class TrapezoidProfileCommand std::function m_output; std::function m_goal; std::function m_currentState; - bool m_newAPI; // TODO: Remove frc::Timer m_timer; };