Go to Post I have a pocket full of Gracious Professionalism! How about you? - Schnabel [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #31   Spotlight this post!  
Unread 23-02-2015, 17:17
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: functions for auto

Quote:
Originally Posted by curtis0gj View Post
Alright that makes sense should I also use arcadeDrive in the move function? Other than this I believe I am done if you don't mind giving it a final look over it would be greatly appreciated I am hoping this will all work for Wednesday we are having a little show casing with other schools.
https://github.com/curtis0gj/5033-20...ster/Auto.java
Code:
			chassis.arcadeDrive(-0.25, angle * Kp);
you never defined a "Kp" variable as far as I can see (which by the way is bad formatting, kP). First of all, you probably want to define a "Kp" variable.
Also, I assume you want this code to use the gyro to keep straight. In this case, you might want to add a reset() before the while(true) loop to ensure the gyro is 0.

Code:
				turn(90); //COULD 90 OR 180!
If you don't want to deal with the ambiguous, do the same as above and throw a reset() before the while(true) loop in your turn() function. This way, turn(90) will always turn right 90 degrees, it won't depend on the previous angle.

in Robot.java
Code:
		Auto.run(this, autoMethod);
this is still static. Since you now have a constructor and stuff, this should be "autonManager.run...".

also in Robot.java
Code:
	public AutonManager autonManager; //PUBLIC OR DOES IT MATTER?

		autonManager = new AutonManager(this);
your class is named "Auto", not "AutonManager"

Code:
 it would be greatly appreciated I am hoping this will all work for Wednesday we are having a little show casing with other schools.
#1 rule of code - it won't. I may have quite finely-tuned intuitions, but I'm not perfect.

Your "kP" value(s?) need to be tuned, the 0.01 I gave you was just a rough estimate. For example, if it doesn't turn fast enough, than this should be increased to 0.015 or something. If it turns too fast, than it should be 0.005. If it's turning the wrong way, than it should be -0.01. (honestly, I'd probably start off with 0.035, seems like a decent starting number)
Reply With Quote
 


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 11:19.

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