Package edu.wpi.first.wpilibj2.command
Class TrapezoidProfileSubsystem
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
edu.wpi.first.wpilibj2.command.TrapezoidProfileSubsystem
@Deprecated(forRemoval=true,
since="2025")
public abstract class TrapezoidProfileSubsystem
extends SubsystemBase
Deprecated, for removal: This API element is subject to removal in a future version.
Use a TrapezoidProfile instead
A subsystem that generates and runs trapezoidal motion profiles automatically. The user specifies
how to use the current state of the motion profile by overriding the `useState` method.
This class is provided by the NewCommands VendorDep
-
Constructor Summary
ConstructorDescriptionTrapezoidProfileSubsystem
(TrapezoidProfile.Constraints constraints) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new TrapezoidProfileSubsystem.TrapezoidProfileSubsystem
(TrapezoidProfile.Constraints constraints, double initialPosition) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new TrapezoidProfileSubsystem.TrapezoidProfileSubsystem
(TrapezoidProfile.Constraints constraints, double initialPosition, double period) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new TrapezoidProfileSubsystem. -
Method Summary
Modifier and TypeMethodDescriptionvoid
disable()
Deprecated, for removal: This API element is subject to removal in a future version.Disable the TrapezoidProfileSubsystem's output.void
enable()
Deprecated, for removal: This API element is subject to removal in a future version.Enable the TrapezoidProfileSubsystem's output.void
periodic()
Deprecated, for removal: This API element is subject to removal in a future version.This method is called periodically by theCommandScheduler
.final void
setGoal
(double goal) Deprecated, for removal: This API element is subject to removal in a future version.Sets the goal state for the subsystem.final void
Deprecated, for removal: This API element is subject to removal in a future version.Sets the goal state for the subsystem.protected abstract void
useState
(TrapezoidProfile.State state) Deprecated, for removal: This API element is subject to removal in a future version.Users should override this to consume the current state of the motion profile.Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
TrapezoidProfileSubsystem
public TrapezoidProfileSubsystem(TrapezoidProfile.Constraints constraints, double initialPosition, double period) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new TrapezoidProfileSubsystem.- Parameters:
constraints
- The constraints (maximum velocity and acceleration) for the profiles.initialPosition
- The initial position of the controlled mechanism when the subsystem is constructed.period
- The period of the main robot loop, in seconds.
-
TrapezoidProfileSubsystem
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new TrapezoidProfileSubsystem.- Parameters:
constraints
- The constraints (maximum velocity and acceleration) for the profiles.initialPosition
- The initial position of the controlled mechanism when the subsystem is constructed.
-
TrapezoidProfileSubsystem
Deprecated, for removal: This API element is subject to removal in a future version.Creates a new TrapezoidProfileSubsystem.- Parameters:
constraints
- The constraints (maximum velocity and acceleration) for the profiles.
-
-
Method Details
-
periodic
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Subsystem
This method is called periodically by theCommandScheduler
. Useful for updating subsystem-specific state that you don't want to offload to aCommand
. Teams should try to be consistent within their own codebases about which responsibilities will be handled by Commands, and which will be handled here. -
setGoal
Deprecated, for removal: This API element is subject to removal in a future version.Sets the goal state for the subsystem.- Parameters:
goal
- The goal state for the subsystem's motion profile.
-
setGoal
Deprecated, for removal: This API element is subject to removal in a future version.Sets the goal state for the subsystem. Goal velocity assumed to be zero.- Parameters:
goal
- The goal position for the subsystem's motion profile.
-
enable
Deprecated, for removal: This API element is subject to removal in a future version.Enable the TrapezoidProfileSubsystem's output. -
disable
Deprecated, for removal: This API element is subject to removal in a future version.Disable the TrapezoidProfileSubsystem's output. -
useState
Deprecated, for removal: This API element is subject to removal in a future version.Users should override this to consume the current state of the motion profile.- Parameters:
state
- The current state of the motion profile.
-