Class ProfiledPIDCommand

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.ProfiledPIDCommand
All Implemented Interfaces:
Sendable

@Deprecated(forRemoval=true, since="2025") public class ProfiledPIDCommand extends Command
Deprecated, for removal: This API element is subject to removal in a future version.
Use a ProfiledPIDController instead
A command that controls an output with a ProfiledPIDController. Runs forever by default - to add exit conditions and/or other behavior, subclass this class. The controller calculation and output are performed synchronously in the command's execute() method.

This class is provided by the NewCommands VendorDep

  • Field Details

  • Constructor Details

    • ProfiledPIDCommand

      public ProfiledPIDCommand(ProfiledPIDController controller, DoubleSupplier measurementSource, Supplier<TrapezoidProfile.State> goalSource, BiConsumer<Double,TrapezoidProfile.State> useOutput, Subsystem... requirements)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new PIDCommand, which controls the given output with a ProfiledPIDController. Goal velocity is specified.
      Parameters:
      controller - the controller that controls the output.
      measurementSource - the measurement of the process variable
      goalSource - the controller's goal
      useOutput - the controller's output
      requirements - the subsystems required by this command
    • ProfiledPIDCommand

      public ProfiledPIDCommand(ProfiledPIDController controller, DoubleSupplier measurementSource, DoubleSupplier goalSource, BiConsumer<Double,TrapezoidProfile.State> useOutput, Subsystem... requirements)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new PIDCommand, which controls the given output with a ProfiledPIDController. Goal velocity is implicitly zero.
      Parameters:
      controller - the controller that controls the output.
      measurementSource - the measurement of the process variable
      goalSource - the controller's goal
      useOutput - the controller's output
      requirements - the subsystems required by this command
    • ProfiledPIDCommand

      public ProfiledPIDCommand(ProfiledPIDController controller, DoubleSupplier measurementSource, TrapezoidProfile.State goal, BiConsumer<Double,TrapezoidProfile.State> useOutput, Subsystem... requirements)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new PIDCommand, which controls the given output with a ProfiledPIDController. Goal velocity is specified.
      Parameters:
      controller - the controller that controls the output.
      measurementSource - the measurement of the process variable
      goal - the controller's goal
      useOutput - the controller's output
      requirements - the subsystems required by this command
    • ProfiledPIDCommand

      public ProfiledPIDCommand(ProfiledPIDController controller, DoubleSupplier measurementSource, double goal, BiConsumer<Double,TrapezoidProfile.State> useOutput, Subsystem... requirements)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new PIDCommand, which controls the given output with a ProfiledPIDController. Goal velocity is implicitly zero.
      Parameters:
      controller - the controller that controls the output.
      measurementSource - the measurement of the process variable
      goal - the controller's goal
      useOutput - the controller's output
      requirements - the subsystems required by this command
  • Method Details

    • initialize

      public void initialize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Command
      The initial subroutine of a command. Called once when the command is initially scheduled.
      Overrides:
      initialize in class Command
    • execute

      public void execute()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Command
      The main body of a command. Called repeatedly while the command is scheduled.
      Overrides:
      execute in class Command
    • end

      public void end(boolean interrupted)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: Command
      The action to take when the command ends. Called when either the command finishes normally, or when it interrupted/canceled.

      Do not schedule commands here that share requirements with this command. Use Command.andThen(Command...) instead.

      Overrides:
      end in class Command
      Parameters:
      interrupted - whether the command was interrupted/canceled
    • getController

      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the ProfiledPIDController used by the command.
      Returns:
      The ProfiledPIDController