The autonomous package contains Commands and CommandGroups to make the robot run based off its own sensors. The structure for Commands in the autonomous package is the same as the structure described for Commands in the command package, except the isFinished() method should almost always return a boolean based of a comparison of sensor values. The package should also contain multiple CommandGroups which should make up paths or movements the robot should make during the autonomous period of gameplay.
A CommandGroup just calls the commands we have built in the order we want so that
we can create a sequence of movements. There are two ways to calls Commands in a CommandGroup
either using addSequential() or addParallel() which both have a Command as a parameter.
addSequential() runs the inputted command after the previous command has finished.
addParallel() runs the inputted command at the same time as the previous command.
For example, a simple movement CommandGroup for the robot:
public SampleCommandGroup extends CommandGroup
{
   public SampleCommandGroup()
   {
     /* Our drive commands input first the speed percentage then the feet or angle to move */
     addSequential(new Drive(0.8, 10));
     addSequential(new Turn(0.5, 75));
     /* The parameter for this command is how many seconds to run it */
     addParallel(new Intake(5));
   }
}
© All Rights Reserved.