ProfiledPIDSubsystem

class commands2.ProfiledPIDSubsystem(*arg, **kwargs)[source]

Bases: Subsystem

A subsystem that uses a wpimath.controller.ProfiledPIDController or wpimath.controller.ProfiledPIDControllerRadians to control an output. The controller is run synchronously from the subsystem’s periodic() method.

Creates a new PIDSubsystem.

disable()[source]

Disables the PID control. Sets output to zero.

enable()[source]

Enables the PID control. Resets the controller.

getController()[source]

Returns the controller

getMeasurement() float[source]

Returns the measurement of the process variable used by the controller object.

isEnabled() bool[source]

Returns whether the controller is enabled.

periodic()[source]

Updates the output of the controller.

setGoal(goal)[source]

Sets the goal state for the subsystem.

useOutput(output: float, setpoint: State)[source]

Uses the output from the controller object.