Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Autonomous Paths #19

Open
joecaraccio opened this issue Jan 9, 2022 · 0 comments
Open

Basic Autonomous Paths #19

joecaraccio opened this issue Jan 9, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@joecaraccio
Copy link
Collaborator

joecaraccio commented Jan 9, 2022

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);
     }
    }
}
@joecaraccio joecaraccio added the enhancement New feature or request label Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants