|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Encoder as PIDSource
So I added this in my constructor:
elevatorEncoder->SetPIDSourceParameter(Encoder::kDistance); Is that correct? We want to test our robot today and see how it performs and I can't afford to introduce code problems outside of my experience level and lose a day of tweaking on our new hardware. (Today is hopefully first test day of our finalish robot) I am not going to update the robot's image until I know this will work. We have a working set of code with the previous posts and I'll be using an un-updated computer to tweak our code while testing our robot today. I am somewhat worried because when I was calling Encoder->, the SetPIDSourceParameter did not show up under the little menu of methods I could select. Also none of the colors changed when I entered the above line. Do I have to do a fresh build or something for the built in Windriver "IntelliSense" to catch up? |
|
#17
|
|||
|
|||
|
Re: Encoder as PIDSource
Quote:
-Joe |
|
#18
|
||||
|
||||
|
Re: Encoder as PIDSource
All right, just to post our results, we got the new update on our robot, and the new Encoder class works a champ now. The code I posted earlier does work as posted if anyone else is looking for examples.
The "Intellisense" will update if you close and re-open Windriver. Good day today. |
|
#19
|
|||
|
|||
|
Re: Encoder as PIDSource
It is nice that the Encoder class can be used as a PIDSource now but it ends up that it still doesn't help me. I am using one encoder for both position AND speed feedback. Not a problem tho i just create two classes, RatePIDSource and PositionPIDSource. I pass a reference to a single Encoder into the constructor of these two objects and in their PIDGet() return distance or rate accordingly.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|