-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathOneBallAutoCommand.java
32 lines (26 loc) · 1.4 KB
/
OneBallAutoCommand.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package frc.team2412.robot.commands.autonomous;
import frc.team2412.robot.subsystem.*;
import org.frcteam2910.common.control.SimplePathBuilder;
import org.frcteam2910.common.control.Trajectory;
import org.frcteam2910.common.math.Rotation2;
import org.frcteam2910.common.math.Vector2;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.team2412.robot.commands.index.IndexShootCommand;
import frc.team2412.robot.commands.shooter.ShooterTargetCommand;
public class OneBallAutoCommand extends SequentialCommandGroup {
public OneBallAutoCommand(IndexSubsystem indexSubsystem, ShooterSubsystem shooterSubsystem,
TargetLocalizer localizer, DrivebaseSubsystem drivebaseSubsystem, IntakeSubsystem intakeSubsystem) {
Trajectory robotPath = new Trajectory(
new SimplePathBuilder(Vector2.ZERO, Rotation2.ZERO)
.lineTo(new Vector2(0, 70))
.build(),
Constants.DriveConstants.TRAJECTORY_CONSTRAINTS, 0.1);
ShooterTargetCommand.TurretManager manager = new ShooterTargetCommand.TurretManager(shooterSubsystem,
localizer);
addCommands(
manager.scheduleCommand(),
manager.disableAt(0),
new IndexShootCommand(indexSubsystem, localizer).withTimeout(4),
new Follow2910TrajectoryCommand(drivebaseSubsystem, robotPath));
}
}