2020-02-29 14:55:17 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2020-03-02 21:45:38 -07:00
|
|
|
package frc4388.robot.commands.auto;
|
2020-02-29 14:55:17 -07:00
|
|
|
|
|
|
|
|
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
2020-03-06 20:57:54 -07:00
|
|
|
import frc4388.robot.commands.drive.GotoCoordinatesRobotRelative;
|
2020-02-29 14:55:17 -07:00
|
|
|
import frc4388.robot.subsystems.Drive;
|
2020-03-01 13:48:18 -07:00
|
|
|
import frc4388.robot.subsystems.Pneumatics;
|
2020-02-29 14:55:17 -07:00
|
|
|
|
|
|
|
|
// NOTE: Consider using this command inline, rather than writing a subclass. For more
|
|
|
|
|
// information, see:
|
|
|
|
|
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html
|
|
|
|
|
public class AutoPath2FromRight extends SequentialCommandGroup {
|
|
|
|
|
Drive m_drive;
|
2020-03-01 13:48:18 -07:00
|
|
|
Pneumatics m_pneumatics;
|
2020-02-29 14:55:17 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new AutoPath2FromRight.
|
|
|
|
|
*/
|
2020-03-01 13:48:18 -07:00
|
|
|
public AutoPath2FromRight(Drive subsystem, Pneumatics subsystem2) {
|
2020-02-29 14:55:17 -07:00
|
|
|
// Add your commands in the super() call, e.g.
|
|
|
|
|
// super(new FooCommand(), new BarCommand());
|
|
|
|
|
m_drive = subsystem;
|
2020-03-01 13:48:18 -07:00
|
|
|
m_pneumatics = subsystem2;
|
2020-02-29 14:55:17 -07:00
|
|
|
|
|
|
|
|
addCommands( new Wait(m_drive, 0, 1),
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 0, 77),
|
2020-02-29 14:55:17 -07:00
|
|
|
//Start Intake Ball 1
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 0, 8),
|
|
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 0, 28),
|
2020-02-29 14:55:17 -07:00
|
|
|
//Start Intake Ball 2
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 0, 8),
|
2020-02-29 14:55:17 -07:00
|
|
|
//Shoot 5 Balls
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 0, 28),
|
2020-03-06 17:28:22 -07:00
|
|
|
//Start Intake Ball 6 (Ball 1 second round)
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 0, 8),
|
2020-03-06 17:28:22 -07:00
|
|
|
//Move to 7th Ball
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 86.7, -64.11, -180),
|
2020-03-06 17:28:22 -07:00
|
|
|
//Move to 8th Ball
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, -6.34, 15.31, 90),
|
2020-03-06 17:28:22 -07:00
|
|
|
//Move to 9th Ball
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, 7.11, 24.41, 0),
|
2020-03-06 17:28:22 -07:00
|
|
|
//Move to 10th Ball
|
2020-03-06 18:46:45 -07:00
|
|
|
new GotoCoordinatesRobotRelative(m_drive, m_pneumatics, -6.34, 13.30),
|
2020-03-06 17:28:22 -07:00
|
|
|
//Shoot 5 more Balls (Total 10 Ball Autonomous Path)
|
2020-02-29 14:55:17 -07:00
|
|
|
new Wait(m_drive, 0, 2)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|