mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[commands] Fix ProfiledPIDSubsystem setGoal behavior (#4414)
Remove m_goal from ProfiledPIDSubsystem Delegate setGoal to backing controller
This commit is contained in:
@@ -20,8 +20,6 @@ public abstract class ProfiledPIDSubsystem extends SubsystemBase {
|
||||
protected final ProfiledPIDController m_controller;
|
||||
protected boolean m_enabled;
|
||||
|
||||
private TrapezoidProfile.State m_goal;
|
||||
|
||||
/**
|
||||
* Creates a new ProfiledPIDSubsystem.
|
||||
*
|
||||
@@ -45,7 +43,7 @@ public abstract class ProfiledPIDSubsystem extends SubsystemBase {
|
||||
@Override
|
||||
public void periodic() {
|
||||
if (m_enabled) {
|
||||
useOutput(m_controller.calculate(getMeasurement(), m_goal), m_controller.getSetpoint());
|
||||
useOutput(m_controller.calculate(getMeasurement()), m_controller.getSetpoint());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +57,7 @@ public abstract class ProfiledPIDSubsystem extends SubsystemBase {
|
||||
* @param goal The goal state for the subsystem's motion profile.
|
||||
*/
|
||||
public void setGoal(TrapezoidProfile.State goal) {
|
||||
m_goal = goal;
|
||||
m_controller.setGoal(goal);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user