Issaquah Robotics Society

Programming resources for FIRST Robotics team 1318

Adding Autonomous Routines

Like Macros, Autonomous Routines involve a series of control tasks working together to accomplish game objectives.

To add a new autonomous routine, add a new function to the AutonomousRoutineSelector class that returns an IControlTask performing the set of tasks that make up the routine.

private static IControlTask GetMyFavoriteRoutine()
{
    return
        SequentialTask.Sequence(
            new WaitTask(3.0),
            new DriveForwardTask(3.5),
            new NavxTurnTask(-90),
            new WaitTask(3.0),
            new DriveForwardTask(3.5));
}

Click here to learn more about composing tasks together.

if (routine == AutoRoutine.MySpecialRoutine)
{
    return AutonomousRoutineSelector.GetMyFavoriteRoutine();
}

Additionally, you will want to change the decision logic in the selectRoutine() function and possibly add new entries to the StartPosition and/or AutoRoutine enumerations. When the criteria are met for running your routine, the function should return the task you decided upon above.