|
PIDSubsystem setSetpointRange Not Implemented
We just ran into this, and I wanted to put out a warning to everyone else.
The JavaDoc for the PIDSubsystem class says
Quote:
public void setSetpoint(double setpoint)
Sets the setpoint to the given value. If setRange(...) was called, then the given setpoint will be trimmed to fit within the range.
|
In testing, we almost destroyed some things on our shooter aiming mechanism when it ran past our range limits. After looking at the WPILibJ code, we found that the setSetpoint() method just passed the setpoint on to the PID Controller without checking the range limits. It's easy to override the method to saturate your setpoints yourself, but if you don't know you have to, you could get a nasty surprise.
__________________
MORT 11
-2005 New Jersey Regional Chairman's Award Winner
-2006 Palmetto Regional Winner
-2007 New York Regional Delphi Driving Tomorrow's Technology Award
-2008 New Jersey Regional Finalist, Chesapeake Regional Winner, Championship Event Overall Top Seed
HB 2399
-2009 Buckeye Regional Delphi Driving Tomorrow's Technology Award, Pittsburgh Regional GM Industrial Design Award
|