Go to Post First, corndogs and now cowbells... when will you make the pain stop, Frank?!?!?! - barn34 [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
  #1   Spotlight this post!  
Unread 12-02-2014, 11:28
aziobro aziobro is offline
Registered User
FRC #4475 (Terrier Byte Bots)
Team Role: Leadership
 
Join Date: Nov 2008
Rookie Year: 2009
Location: Newark,NJ
Posts: 7
aziobro will become famous soon enough
Using Coniditionals to Build Custom Command Groups

What is the proper way to build a custom command group based on a runtime change?

Example:
Program will look at smartdashboard and get the number of blobs seen.
Based on the number it will either drive straight and shot or
turn, drive straight and shoot.

I tied the following code in the command group constructor.

Code:
if (blobs < 2.0) {
            addSequential(new DriveToLeftAndPrepareShot());
            addSequential(new ShortDelay());
            addSequential(new TossBall3QPower());
            addSequential(new TossBallResetPosition());
            
        }
        else
        {
            addSequential(new DriveToRightAndPrepareShot());
            addSequential(new ShortDelay());
            addSequential(new TossBall3QPower());
            addSequential(new TossBallResetPosition());
        }
But it gets run during program load when the command group is constructed.
I want it to run After autonomous is started.
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 08:45.

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