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.