[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

@@ -191,22 +191,6 @@
"replacename": "ReplaceMeSubsystem2",
"commandversion": 2
},
{
"name": "TrapezoidProfileCommand",
"description": "A command that executes a trapezoidal motion profile.",
"tags": [
"trapezoidprofilecommand"
],
"foldername": "trapezoidprofilecommand",
"headers": [
"ReplaceMeTrapezoidProfileCommand.h"
],
"source": [
"ReplaceMeTrapezoidProfileCommand.cpp"
],
"replacename": "ReplaceMeTrapezoidProfileCommand",
"commandversion": 2
},
{
"name": "TrapezoidProfileSubsystem",
"description": "A subsystem that executes a trapezoidal motion profile.",

View File

@@ -1,30 +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 "ReplaceMeTrapezoidProfileCommand.h"
#include <units/acceleration.h>
#include <units/velocity.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
ReplaceMeTrapezoidProfileCommand::ReplaceMeTrapezoidProfileCommand()
: CommandHelper
// The profile to execute
(
frc::TrapezoidProfile<units::meters>(
// The maximum velocity and acceleration of the profile
{5_mps, 5_mps_sq}),
[](frc::TrapezoidProfile<units::meters>::State state) {
// Use the computed intermediate trajectory state here
},
// The goal state of the profile
[] {
return frc::TrapezoidProfile<units::meters>::State{10_m, 0_mps};
},
// The initial state of the profile
[] {
return frc::TrapezoidProfile<units::meters>::State{0_m, 0_mps};
}) {}

View File

@@ -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 <frc2/command/CommandHelper.h>
#include <frc2/command/TrapezoidProfileCommand.h>
#include <units/length.h>
class ReplaceMeTrapezoidProfileCommand
: public frc2::CommandHelper<frc2::TrapezoidProfileCommand<units::meters>,
ReplaceMeTrapezoidProfileCommand> {
public:
ReplaceMeTrapezoidProfileCommand();
};