Autos.java

mail@pastecode.io avatar
unknown
java
a month ago
1.4 kB
6
Indexable
Never
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands;

import static frc.robot.Constants.LauncherConstants.kLaunchFeederSpeed;
import static frc.robot.Constants.LauncherConstants.kLauncherSpeed;

import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.subsystems.PWMDrivetrain;
import frc.robot.subsystems.PWMLauncher;
import frc.robot.Constants.LauncherConstants;;

// import frc.robot.subsystems.CANDrivetrain;

public final class Autos {
  
  public static Command LaunchNodeDriveAuto(PWMLauncher m_launcher, PWMDrivetrain drivetrain){
    
    
    return Commands.sequence(
      Commands.race(
        Commands.run(() -> {new LaunchNote(m_launcher);})
          ,
          Commands.waitSeconds(2)
      ),
      Commands.race(
        Commands.run(
          () -> new RunCommand(() -> drivetrain.tankDrive(-1, -1), drivetrain)
        .withTimeout(0.8)
        .andThen(new RunCommand(() -> drivetrain.tankDrive(0, 0), drivetrain))
      ),
      Commands.waitSeconds(1)
      )
    )
    ;
  }
Leave a Comment