Go to Post H.A.T.E.R.S. = Having Anger Towards Everyone Reaching Success - pandamonium [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 24-03-2016, 21:50
Sasha_Nut's Avatar
Sasha_Nut Sasha_Nut is offline
Registered User
AKA: Emilija Kaupaite
FRC #4103 (Roborioles)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Avon, IN
Posts: 15
Sasha_Nut is an unknown quantity at this point
Re: Need Help With Encoders

I only work in C++, but I can attempt to help.
You say that the autonomouses are not working. Are they not activating, or are they doing something but not what you want them to do? (For any of them.)
Reply With Quote
  #2   Spotlight this post!  
Unread 24-03-2016, 22:12
JohnFogarty's Avatar
JohnFogarty JohnFogarty is offline
FTC, I have returned.
AKA: @doctorfogarty
FTC #11444 (Garnet Squadron) & FRC#1102 (M'Aiken Magic)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 2006
Location: SC
Posts: 1,564
JohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond repute
Re: Need Help With Encoders

First off you need to read the documentation on Switches in Java and then take a look at your code.

https://docs.oracle.com/javase/tutor...ts/switch.html

Now, on to the first code segment where I see issues.

Code:
public void autonomousPeriodic() {

switch (autoSelected) {

case "doNothing":
break;

default:

case defaultAuto:
LowBarAuton();
//encoderAuto();
break;

// case "spybot":
// SpyBotAuton();
// break;
// case "rampWithStuff":
// RampAuton();
// break;

}
}
Your default case needs to be at the end of the switch statement I believe, and you need a "break;" after the "default:".

You do that correctly in your LowBarAuton() method. Your programmer has assumed that the case "defaultAuto" was set to the default case and I do not believe it has been.
__________________
John Fogarty
2010 FTC World Championship Winner & 2013-2014 FRC Orlando Regional Winner
Mentor FRC Team 1102 M'Aiken Magic
"Head Bot Coach" FTC Team 11444 Garnet Squadron
Former Student & Mentor FLL 1102, FTC 1102 & FTC 3864, FRC 1772, FRC 5632
2013 FTC World Championship Guest Speaker
Reply With Quote
  #3   Spotlight this post!  
Unread 24-03-2016, 22:28
remulasce remulasce is offline
Registered User
no team
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Mtn View
Posts: 139
remulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to behold
Re: Need Help With Encoders

Please give us more information about what happens when you try to run your autonomous. Specifically:

Does the code compile?
Does the code deploy & appear to run on the robot?
Does the robot move at all when you try autonomous?
How much of what you expect to happen happens when you run auto?
Can you run other, simpler autonomous modes correctly? (eg. just move fwd 3 seconds)

This will greatly help us as we try to help you.
__________________
Student 294: 2007-2011
Mentor 597: 2013-2015
Google SWE: 2015-
Reply With Quote
  #4   Spotlight this post!  
Unread 24-03-2016, 22:28
Sasha_Nut's Avatar
Sasha_Nut Sasha_Nut is offline
Registered User
AKA: Emilija Kaupaite
FRC #4103 (Roborioles)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Avon, IN
Posts: 15
Sasha_Nut is an unknown quantity at this point
Re: Need Help With Encoders

Going along with what JohnFogarty was saying, in your LowBarAuton, the default has to be at the end of the switch.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-03-2016, 22:41
remulasce remulasce is offline
Registered User
no team
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Mtn View
Posts: 139
remulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to behold
Re: Need Help With Encoders

So after a brief review, I can tell you the code looks really messy.

But, nothing actually appears incorrect in the autonomous sequence. Which is why we need the reason why you think it's wrong.

It's perfectly valid in Java to put default: before the case:es. You're doing it really messily in LowBarAuton, but it does work.

Again. Please tell us exactly how you are trying to run autonomous and how it "fails". We can't help you solve something you haven't told us about.
__________________
Student 294: 2007-2011
Mentor 597: 2013-2015
Google SWE: 2015-
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 09:11.

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