[commands] Fix and deprecate TrapezoidProfileCommand (#6722)

This commit is contained in:
Gold856
2024-08-14 00:01:17 -04:00
committed by GitHub
parent 55c1c5396d
commit a2060feadc
17 changed files with 240 additions and 272 deletions

View File

@@ -119,16 +119,6 @@
"replacename": "ReplaceMeSubsystem",
"commandversion": 2
},
{
"name": "TrapezoidProfileCommand",
"description": "A command that executes a trapezoidal motion profile.",
"tags": [
"trapezoidprofilecommand"
],
"foldername": "trapezoidprofilecommand",
"replacename": "ReplaceMeTrapezoidProfileCommand",
"commandversion": 2
},
{
"name": "TrapezoidProfileSubsystem",
"description": "A subsystem that executes a trapezoidal motion profile.",

View File

@@ -1,29 +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.trapezoidprofilecommand;
import edu.wpi.first.math.trajectory.TrapezoidProfile;
import edu.wpi.first.wpilibj2.command.TrapezoidProfileCommand;
// 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 ReplaceMeTrapezoidProfileCommand extends TrapezoidProfileCommand {
/** Creates a new ReplaceMeTrapezoidProfileCommand. */
public ReplaceMeTrapezoidProfileCommand() {
super(
// The motion profile to be executed
new TrapezoidProfile(
// The motion profile constraints
new TrapezoidProfile.Constraints(0, 0)),
state -> {
// Use current trajectory state here
},
// Goal state
TrapezoidProfile.State::new,
// Current state
TrapezoidProfile.State::new);
}
}