View Single Post
  #1   Spotlight this post!  
Unread 07-03-2014, 20:50
Tedi Tedi is offline
Registered User
FRC #4343
 
Join Date: Mar 2014
Location: Aurora
Posts: 3
Tedi is an unknown quantity at this point
Can isTimedOut() be used in a command group?

Hey guys,
So I was wondering if in the constructor of a command group (where addParallel and addSequential are added), can I also add setTimeout(x); and then check within the same command group if it has timed out? I am asking because I am unsure if setting a timeout inside a command group actually works or if it's only for commands.

Example:

Code:
public class cmdg extends CommandGroup {
    boolean A = false;
    public cmdg() {
        setTimeout(x);
        addSequential(command_here, x);
        if (isTimedOut()) {
            A = false;
        } else {
            A = true;
        }
        if (A) {
            //stuff here
        } else {
            //stuff here
        }
        
        
        
    }
}
Thanks,
Tedi

Last edited by Tedi : 07-03-2014 at 20:52.
Reply With Quote