Sequential Intake

This commit is contained in:
ryan123rudder
2021-03-31 18:53:42 -06:00
parent 813ab40e96
commit 6593c4cbaf
2 changed files with 8 additions and 6 deletions
@@ -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));
}
/**
@@ -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)));
}
}
}