mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[commands] Fix and deprecate TrapezoidProfileCommand (#6722)
This commit is contained in:
@@ -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.",
|
||||
|
||||
@@ -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};
|
||||
}) {}
|
||||
@@ -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();
|
||||
};
|
||||
Reference in New Issue
Block a user