Log in

View Full Version : PIDSubsystem onTarget setTolerance ?


SousVide
20-02-2014, 11:39
Hi,

I am using the commandbased programming library and have a PIDSubsystem. I am trying to read whether PID is onTarget(), but the code quits complaining that I need to use setTolerance.

I've called the PID Controller's setAbsoluteTolerance method, but it continues to quit and complain. How is it that I need to call setTolerance in order to satisfy the requirement for onTarget ?

Thanks,

notmattlythgoe
20-02-2014, 11:46
Have you tried using the subsystems setAbsoluteTolerance() method instead of the controller?

SousVide
20-02-2014, 16:22
I've tried the following in different instances:

setAbsoluteTolerance(targetTolerance);

// this doesn't work
setAbsoluteTolerance(new PIDController.AbsoluteTolerance(targetTolerance));

this.getPIDController().setTolerance(new PIDController.AbsoluteTolerance(targetTolerance));