From 6593c4cbafa60e2fd6cdf4d23a9d1a46cddece9f Mon Sep 17 00:00:00 2001 From: ryan123rudder <42309874+ryan123rudder@users.noreply.github.com> Date: Wed, 31 Mar 2021 18:53:42 -0600 Subject: [PATCH] Sequential Intake --- src/main/java/frc4388/robot/RobotContainer.java | 2 +- .../frc4388/robot/commands/auto/GalacticSearch.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc4388/robot/RobotContainer.java b/src/main/java/frc4388/robot/RobotContainer.java index f1da19b..68b4da7 100644 --- a/src/main/java/frc4388/robot/RobotContainer.java +++ b/src/main/java/frc4388/robot/RobotContainer.java @@ -380,7 +380,7 @@ public class RobotContainer { "bRed", "bBlue" }; - m_galacticSearch = new GalacticSearch(m_robotLime, buildPaths(galacticSearchPaths)); + m_galacticSearch = new GalacticSearch(m_robotLime, m_robotIntake, buildPaths(galacticSearchPaths)); } /** diff --git a/src/main/java/frc4388/robot/commands/auto/GalacticSearch.java b/src/main/java/frc4388/robot/commands/auto/GalacticSearch.java index 357fb20..9fc0b59 100644 --- a/src/main/java/frc4388/robot/commands/auto/GalacticSearch.java +++ b/src/main/java/frc4388/robot/commands/auto/GalacticSearch.java @@ -9,6 +9,8 @@ package frc4388.robot.commands.auto; import edu.wpi.first.wpilibj2.command.RamseteCommand; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; +import frc4388.robot.commands.intake.RunIntake; +import frc4388.robot.subsystems.Intake; import frc4388.robot.subsystems.LimeLight; // NOTE: Consider using this command inline, rather than writing a subclass. For more @@ -18,22 +20,22 @@ public class GalacticSearch extends SequentialCommandGroup { /** * Creates a new GalacticSearch. */ - public GalacticSearch(LimeLight m_limeLight, RamseteCommand[] paths) { + public GalacticSearch(LimeLight m_limeLight, Intake m_intake, RamseteCommand[] paths) { if (m_limeLight.galacticSearchPath == "A_RED") { - addCommands(paths[0]); + addCommands(new SequentialCommandGroup(paths[0], new RunIntake(m_intake))); } else if (m_limeLight.galacticSearchPath == "A_BLUE") { - addCommands(paths[1]); + addCommands(new SequentialCommandGroup(paths[1], new RunIntake(m_intake))); } else if (m_limeLight.galacticSearchPath == "B_RED") { - addCommands(paths[2]); + addCommands(new SequentialCommandGroup(paths[2], new RunIntake(m_intake))); } else if (m_limeLight.galacticSearchPath == "B_BLUE") { - addCommands(paths[3]); + addCommands(new SequentialCommandGroup(paths[3], new RunIntake(m_intake))); } } }