Skip to content

Basic Autonomous Paths #19

@joecaraccio

Description

@joecaraccio

We now know the game and can begin building Autonomous Modes!

In our codebase:

An autonomous mode is one or more autonomous actions

Our Modes are defined here:
https://github.com/Team138Entropy/Entropy2022/tree/main/src/main/java/frc/robot/auto/modes

So far we only have 3 Modes. The base class (which shouldn't be edited), the DoNothing Mode (which I hope we never use) and the TestDriveMode.

We need to make many more modes. For example:

  • Drive Out of Taxi Zone Mode
  • Get One Ball Mode
  • Get One Ball, Score it, and Go and get the Second Ball Mode
    etc. There are a lot of possibilities.

Each Drive Action should only drive one path. Together we will put together each path as we need and then run them all sequentially.

Here is an example of several drive segments together:

public class DriveToBall extends AutoModeBase {

    List<DriveTrajectoryAction > driveActionList = new ArrayList<DriveTrajectoryAction >();  

    public DriveToBall (){
      // add multiple actions to drive trajectorys, these will run one after another
      driveActionList.add(new DriveTrajectoryAction(TrajectoryLibrary.getInstance().getBasicTrajectory());
      driveActionList.add(new DriveTrajectoryAction(TrajectoryLibrary.getInstance().getBasicTrajectory());
      driveActionList.add(new DriveTrajectoryAction(TrajectoryLibrary.getInstance().getBasicTrajectory()); 
   }

    @Override
    protected void routine() throws AutoModeEndedException {
      // Traverse list and run each action
      for(DriveTrajectoryAction currentAction:  driveActionList )  {
        runAction(currentAction);
     }
    }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions