|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
PID Example HELP
We're new to Java this year and we were having some problem with PID.
PIDController doesn't seem to work, and we were wondering if we could possibly have some code to use as guidelines that has PID in it. Thanks |
|
#2
|
|||
|
|||
|
Re: PID Example HELP
We are unable to initialize it. We import the library and when tried to call the error says cannot find symbol. symbol: constructor PIDController()
|
|
#3
|
||||
|
||||
|
Re: PID Example HELP
Are you passing the required argument? Take a look at the documentation, and there are two constructors. Both require arguments.
PIDController(double Kp, double Ki, double Kd, PIDSource source, PIDOutput output, double period) and PIDController(double Kp, double Ki, double Kd, PIDSource source, PIDOutput output) Last edited by ArchVince : 20-02-2011 at 14:11. |
|
#4
|
|||
|
|||
|
Re: PID Example HELP
Yes, the code is PIDController(pVal , iVal , dVal, armposition, arm);
armposition is from the pot and arm is the jag |
|
#5
|
||||
|
||||
|
Re: PID Example HELP
What type of objects are each one? I'm unclear on what pot is, my apologies.
That sentence did not come out like I meant it to. Last edited by ArchVince : 20-02-2011 at 14:26. |
|
#6
|
|||
|
|||
|
Re: PID Example HELP
double, double, double, edu.wpi.first.wpilibj.AnalogChannel, edu.wpi.first.wpilibj.Jaguar
|
|
#7
|
||||
|
||||
|
Re: PID Example HELP
Is cannot find symbol. symbol: constructor PIDController() the exact error message? Because just as a test, I tried to initialize a Solenoid with a string as an argument and it said cannot find symbol. symbol: constructor Solenoid(java.lang.String). That would mean that it isn't being given any arguments whatsoever. Is there another place in your code where you accidentally initialized one, perhaps?
|
|
#8
|
|||
|
|||
|
Re: PID Example HELP
symbol: method PIDController() is the error
|
|
#9
|
||||
|
||||
|
Re: PID Example HELP
My bad, I must have checked the wrong class in the javadoc somehow. Last edited by Patrickwhite : 21-02-2011 at 07:04. Reason: Was wrong |
|
#10
|
|||
|
|||
|
Re: PID Example HELP
Quote:
|
|
#11
|
||||
|
||||
|
Re: PID Example HELP
Quote:
1. The error says it's a method, not a constructor. 2. The error doesn't list ANY arguments. Any chance we could see the part of your code that is erroring? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|