Go to Post It makes you wonder what sort of sick, twisted mind would do such a thing to all those innocent teams out there... - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-02-2011, 12:23
Mark_K Mark_K is offline
Registered User
FRC #1721 (Charette)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Concord NH
Posts: 9
Mark_K will become famous soon enoughMark_K will become famous soon enough
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
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2011, 14:03
Mark_K Mark_K is offline
Registered User
FRC #1721 (Charette)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Concord NH
Posts: 9
Mark_K will become famous soon enoughMark_K will become famous soon enough
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()
Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2011, 14:08
ArchVince's Avatar
ArchVince ArchVince is offline
Registered User
FRC #1290 (Si Se Puede)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Chandler High School
Posts: 26
ArchVince will become famous soon enough
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)
__________________
PETA wants your help finding Schrödinger.

Last edited by ArchVince : 20-02-2011 at 14:11.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-02-2011, 14:18
Mark_K Mark_K is offline
Registered User
FRC #1721 (Charette)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Concord NH
Posts: 9
Mark_K will become famous soon enoughMark_K will become famous soon enough
Re: PID Example HELP

Yes, the code is PIDController(pVal , iVal , dVal, armposition, arm);
armposition is from the pot and arm is the jag
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2011, 14:24
ArchVince's Avatar
ArchVince ArchVince is offline
Registered User
FRC #1290 (Si Se Puede)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Chandler High School
Posts: 26
ArchVince will become famous soon enough
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.
__________________
PETA wants your help finding Schrödinger.

Last edited by ArchVince : 20-02-2011 at 14:26.
Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2011, 14:26
Mark_K Mark_K is offline
Registered User
FRC #1721 (Charette)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Concord NH
Posts: 9
Mark_K will become famous soon enoughMark_K will become famous soon enough
Re: PID Example HELP

double, double, double, edu.wpi.first.wpilibj.AnalogChannel, edu.wpi.first.wpilibj.Jaguar
Reply With Quote
  #7   Spotlight this post!  
Unread 20-02-2011, 14:34
ArchVince's Avatar
ArchVince ArchVince is offline
Registered User
FRC #1290 (Si Se Puede)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Chandler High School
Posts: 26
ArchVince will become famous soon enough
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?
__________________
PETA wants your help finding Schrödinger.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2011, 14:39
Mark_K Mark_K is offline
Registered User
FRC #1721 (Charette)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Concord NH
Posts: 9
Mark_K will become famous soon enoughMark_K will become famous soon enough
Re: PID Example HELP

symbol: method PIDController() is the error
Reply With Quote
  #9   Spotlight this post!  
Unread 20-02-2011, 21:08
Patrickwhite's Avatar
Patrickwhite Patrickwhite is offline
May the North be with you
FRC #0610 (The Coyotes)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Toronto
Posts: 88
Patrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of lightPatrickwhite is a glorious beacon of light
Re: PID Example HELP

I believe the problem is your source and output. You are sending edu.wpi.first.wpilibj.AnalogChannel, edu.wpi.first.wpilibj.Jaguar, while PIDController expects classes implementing the edu.wpi.first.wpilibj.PIDSource and edu.wpi.first.wpilibj.PIDOutput interfaces. The idea is that you create your own classes implementing these interfaces, and pass them to the constructor.

My bad, I must have checked the wrong class in the javadoc somehow.
__________________
while(!going.isTough());
tough.exit();

What will we do tonight, Warfa?
The same thing we do every night, Patrick. Sit and wait for Electrical.

Last edited by Patrickwhite : 21-02-2011 at 07:04. Reason: Was wrong
Reply With Quote
  #10   Spotlight this post!  
Unread 21-02-2011, 00:01
Geek 2.0 Geek 2.0 is offline
Registered User
FRC #0107
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2008
Location: Holland, MI
Posts: 120
Geek 2.0 will become famous soon enough
Re: PID Example HELP

Quote:
Originally Posted by Patrickwhite View Post
I believe the problem is your source and output. You are sending edu.wpi.first.wpilibj.AnalogChannel, edu.wpi.first.wpilibj.Jaguar, while PIDController expects classes implementing the edu.wpi.first.wpilibj.PIDSource and edu.wpi.first.wpilibj.PIDOutput interfaces. The idea is that you create your own classes implementing these interfaces, and pass them to the constructor.
AnalogChannel implements PIDSource and Jaguar implements PIDOutput, so that's probably not their problem.
Reply With Quote
  #11   Spotlight this post!  
Unread 21-02-2011, 00:40
ArchVince's Avatar
ArchVince ArchVince is offline
Registered User
FRC #1290 (Si Se Puede)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Chandler High School
Posts: 26
ArchVince will become famous soon enough
Re: PID Example HELP

Quote:
Originally Posted by Geek 2.0 View Post
AnalogChannel implements PIDSource and Jaguar implements PIDOutput, so that's probably not their problem.
Yeah, it should be able to work. I'm still curious about two things, though.

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?
__________________
PETA wants your help finding Schrödinger.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi