|
|
![]() |
![]() |
|
|||||||
|
![]() |
Thread Tools | Rate Thread | Display Modes |
#1
![]() |
|||||
|
|||||
PIDController class (PIDSource/PIDOutput interfaces?)
I was looking at the WPILib codebase and saw that their PIDController class uses the PIDSource and PITOutput interfaces for I/O to/from the control loop. However I was surprised to see that no WPILib classes actually inherit from these interfaces.
Is the intention that I should inherit from PIDSource and PIDOutput as necessary? Ex: Code:
class PIDEncoder : public Encoder, public PIDSource { ... (override PIDget() here) }; class PIDJaguar : public Jaguar, public PIDOutput { ... (override WritePID() here) }; Thanks |
#2
![]() |
||||
|
||||
Re: PIDController class (PIDSource/PIDOutput interfaces?)
Give it a try and see what happens. Tell me how its goes, I am starting to look at the same thing now.
also Quote:
Last edited by wt200999 : 01-10-2009 at 07:19 PM. |
#3
![]() |
|||||
|
|||||
Re: PIDController class (PIDSource/PIDOutput interfaces?)
Thanks for responding. Yeah, I guess that WPI didn't get to it yet. Extending sensors/outputs should be just fine.
|
#4
![]() |
|||
|
|||
Re: PIDController class (PIDSource/PIDOutput interfaces?)
The idea is that you create subclasses of whatever you want to read inheriting PIDSource and whatever you want to control inheriting PIDOutput. They provide the methods to get the values from the sensor and provide output values for the controlled thing.
It works that way because a single sensor might not be used, but maybe some group of sensors, or a camera X position, or something more complex. And the thing being controlled may be more complex then just a motor. We'll try to post an example later today. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
So class of 07... | santosh | College Teams | 31 | 04-21-2007 08:52 AM |
Cool Operator Interfaces | rsilverstein | Control System | 19 | 03-29-2007 11:14 PM |
Carrying Operator Interfaces On Airplanes? | Richard Neese | Technical Discussion | 8 | 04-01-2003 08:32 PM |
class of 03 | Andrew Rudolph | Chit-Chat | 6 | 03-04-2003 02:52 PM |
In class? | Quain | Chit-Chat | 19 | 05-15-2002 09:33 AM |