Quasics2021Code/MaeTester/src/main/cpp/RobotContainer.cpp
// This builds a Galactic Search Path from 4 json files
This builds a Galactic Search Path from 4 json files
This builds a Galactic Search Path from 4 json files
frc2::ParallelCommandGroup* RobotContainer::BuildGalacticSearchPath(
    std::string jsonFile1, std::string jsonFile2, std::string jsonFile3,
    std::string jsonFile4, bool includeIntakeOperation) {
  std::vector<std::unique_ptr<frc2::Command>> GalacticPieces;
  GalacticPieces.push_back(std::move(std::unique_ptr<frc2::Command>(
      GenerateRamseteCommandFromPathFile(jsonFile1, true))));
  GalacticPieces.push_back(std::move(std::unique_ptr<frc2::Command>(
      GenerateRamseteCommandFromPathFile(jsonFile2, false))));
  GalacticPieces.push_back(std::move(std::unique_ptr<frc2::Command>(
      GenerateRamseteCommandFromPathFile(jsonFile3, false))));
  GalacticPieces.push_back(std::move(std::unique_ptr<frc2::Command>(
      GenerateRamseteCommandFromPathFile(jsonFile4, false))));
  std::unique_ptr<frc2::Command> galacticPath(
      new frc2::SequentialCommandGroup(std::move(GalacticPieces)));
  std::vector<std::unique_ptr<frc2::Command>> commands;
  commands.push_back(std::move(galacticPath));
  if (includeIntakeOperation) {
    std::unique_ptr<frc2::Command> intakeAuto(new AutoIntakeCells(&intake));
    commands.push_back(std::move(intakeAuto));
  } else {
    std::unique_ptr<frc2::Command> noIntakeAuto(
        new frc2::PrintCommand("Not running the intake!"));
    commands.push_back(std::move(noIntakeAuto));
  }
  return new frc2::ParallelCommandGroup(std::move(commands));
}
frc2 :: ParallelCommandGroup * RobotContainer :: BuildGalacticSearchPath ( std :: string jsonFile1 , std :: string jsonFile2 , std :: string jsonFile3 , std :: string jsonFile4 , bool includeIntakeOperation ) { std :: vector < std :: unique_ptr < frc2 :: Command > > GalacticPieces ; GalacticPieces . push_back ( std :: move ( std :: unique_ptr < frc2 :: Command > ( GenerateRamseteCommandFromPathFile ( jsonFile1 , true ) ) ) ) ; GalacticPieces . push_back ( std :: move ( std :: unique_ptr < frc2 :: Command > ( GenerateRamseteCommandFromPathFile ( jsonFile2 , false ) ) ) ) ; GalacticPieces . push_back ( std :: move ( std :: unique_ptr < frc2 :: Command > ( GenerateRamseteCommandFromPathFile ( jsonFile3 , false ) ) ) ) ; GalacticPieces . push_back ( std :: move ( std :: unique_ptr < frc2 :: Command > ( GenerateRamseteCommandFromPathFile ( jsonFile4 , false ) ) ) ) ; std :: unique_ptr < frc2 :: Command > galacticPath ( new frc2 :: SequentialCommandGroup ( std :: move ( GalacticPieces ) ) ) ; std :: vector < std :: unique_ptr < frc2 :: Command > > commands ; commands . push_back ( std :: move ( galacticPath ) ) ; if ( includeIntakeOperation ) { std :: unique_ptr < frc2 :: Command > intakeAuto ( new AutoIntakeCells ( & intake ) ) ; commands . push_back ( std :: move ( intakeAuto ) ) ; } else { std :: unique_ptr < frc2 :: Command > noIntakeAuto ( new frc2 :: PrintCommand ( " " ) ) ; commands . push_back ( std :: move ( noIntakeAuto ) ) ; } return new frc2 :: ParallelCommandGroup ( std :: move ( commands ) ) ; }
This builds a Galactic Search Path from 4 json files
This builds a Galactic Search Path from 4 json files