Go to Post To be blunt: how many motorized carts do you see parked on the side of Einstein? - Koko Ed [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 09-02-2014, 19:38
dystopic dystopic is offline
Registered User
FRC #1261
 
Join Date: Feb 2014
Location: Duluth
Posts: 5
dystopic is an unknown quantity at this point
Robots don't quit

Hi,

I have been getting the error "robots don't quit" in my code and am confused as to what it means? I have found other people here having the error but could not find a clear reason/solution. I also think that because of this my robot does not drive or allow controls. Help would be appreciated on how to reach a solution. Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2014, 19:59
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Robots don't quit

Most common reason I have seen causing this is code that takes a long time to execute. For example, loops or thread.sleep calls in an iterative robot project are a no go. All code in the periodic methods must be able to complete in 20ms or less (the period at which the periodic methods are called).

If you can share your code, we can probably help out a little better.
__________________
http://team2168.org
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2014, 20:05
dystopic dystopic is offline
Registered User
FRC #1261
 
Join Date: Feb 2014
Location: Duluth
Posts: 5
dystopic is an unknown quantity at this point
Re: Robots don't quit

Well our robot isn't iterative it's command based, so what would it mean then? I'll try to post the code as soon as possible.
Reply With Quote
  #4   Spotlight this post!  
Unread 09-02-2014, 20:17
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 332
fovea1959 will become famous soon enough
Re: Robots don't quit

frequently, it's because code threw an Exception. What are the lines on the console preceding the "Robots don't quit"?
Reply With Quote
  #5   Spotlight this post!  
Unread 09-02-2014, 20:36
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Robots don't quit

Quote:
Originally Posted by dystopic View Post
Well our robot isn't iterative it's command based, so what would it mean then? I'll try to post the code as soon as possible.
Command base is just the IterativeRobot class using the Command and Scheduler classes.

Look at your code, the main robot class probably has a line like this...
Code:
public class Robot extends IterativeRobot {
Note the "extends IterativeRobot" part.

Same goes for command base as I said before, no loops or thread.sleeps unless you understand the consequences and know it will not affect execution of the rest of the robot code. This is especially true for the code within a command - since the code in a command shares the 20ms execution period with all other active commands.
__________________
http://team2168.org
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2014, 20:37
dystopic dystopic is offline
Registered User
FRC #1261
 
Join Date: Feb 2014
Location: Duluth
Posts: 5
dystopic is an unknown quantity at this point
Re: Robots don't quit

Currently I don't have the robot to see and don't remember specifically. I'l try to post that as soon as I can, probably tomorrow night...
Reply With Quote
  #7   Spotlight this post!  
Unread 09-02-2014, 21:11
dystopic dystopic is offline
Registered User
FRC #1261
 
Join Date: Feb 2014
Location: Duluth
Posts: 5
dystopic is an unknown quantity at this point
Re: Robots don't quit

Quote:
Originally Posted by otherguy View Post
Command base is just the IterativeRobot class using the Command and Scheduler classes.

Look at your code, the main robot class probably has a line like this...
Code:
public class Robot extends IterativeRobot {
Note the "extends IterativeRobot" part.

Same goes for command base as I said before, no loops or thread.sleeps unless you understand the consequences and know it will not affect execution of the rest of the robot code. This is especially true for the code within a command - since the code in a command shares the 20ms execution period with all other active commands.
wait so would this be fine:
Quote:
timer = new Timer();
intake_b.set(true);
timer.start();
while(timer.get() < Constants.solenoid_timing.getDouble()){

}
if(timer.get() >= Constants.solenoid_timing.getDouble()){
intake_b.set(false);
}
the timing value is 2000ms
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2014, 22:40
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 431
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Robots don't quit

Quote:
wait so would this be fine
No.

If you're using commands, I would suggest the following implementation. Assuming the code you wrote is inside a command.
  • Create and start the timer in the initialize method of a command.
  • Inside the execute method run the intake
  • inside isFinished() have your check to see if you've waited long enough:
    Code:
    return timer.get() >= Constants.solenoid_timing.getDouble()
  • inside the end method, stop running the intake

Alternatively, you could create the following commands
  • RunIntake - a command which just runs the intake then immediately finishes (isFinished returns true) - leaving the intake running
  • Delay command. This is an empty command that does nothing and never finishes. See how it is useful below.
  • StopIntake - a command that just stops the intake and immediately finishes (isFinished returns true).

You could then make a command group that looked something like this:
Code:
public class RunIntakeThenStop extends CommandGroup {
  public RunIntakeThenStop() {
    addSequential(new RunIntake());
    addSequential(new Delay(), 2.0); //the 2nd parameter is a timeout period in seconds.
    addSequential(new StopIntake());
  }
}
See the javadoc for help using command groups and info on timeout periods for commands.
__________________
http://team2168.org

Last edited by otherguy : 09-02-2014 at 22:41. Reason: fixed error in code
Reply With Quote
  #9   Spotlight this post!  
Unread 10-02-2014, 08:04
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Robots don't quit

The "Robots don't quit" text means your code threw an uncaught exception and crashed.

Post the code and the full text from the output window (the stack trace should point to the issue) and we can be of more help.
Reply With Quote
  #10   Spotlight this post!  
Unread 10-02-2014, 21:02
dystopic dystopic is offline
Registered User
FRC #1261
 
Join Date: Feb 2014
Location: Duluth
Posts: 5
dystopic is an unknown quantity at this point
Re: Robots don't quit

I think I solved the error thanks for your help guys. I had an AnalogAccumulator being initialized on port 5 but it can only be initialized on channels 1 or 2 apparently...
Reply With Quote
  #11   Spotlight this post!  
Unread 10-02-2014, 21:14
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Robots don't quit

This is the code in the RobotBase base class for Iterative and SimpleRobot. When an exception happens that isn't caught, it goes up the stack frame (from one method to the one that called it) looking for a handler. In RobotBase there is a handler for any uncaught exceptions and it prints "Robots don't quit".
Code:
    protected final void startApp() throws MIDletStateChangeException {
        boolean errorOnExit = false;

        Watchdog.getInstance().setExpiration(0.1);
        Watchdog.getInstance().setEnabled(false);
        FRCControl.observeUserProgramStarting();
        UsageReporting.report(UsageReporting.kResourceType_Language, UsageReporting.kLanguage_Java);

        try {
            this.startCompetition();
        } catch (Throwable t) {
            t.printStackTrace();
            errorOnExit = true;
        } finally {
            // startCompetition never returns unless exception occurs....
            System.err.println("WARNING: Robots don't quit!");
            if (errorOnExit) {
                System.err.println("---> The startCompetition() method (or methods called by it) should have handled the exception above.");
            } else {
                System.err.println("---> Unexpected return from startCompetition() method.");
            }
        }
    }
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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 11:06.

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