10
10
import edu .wpi .first .wpilibj2 .command .ParallelDeadlineGroup ;
11
11
import edu .wpi .first .wpilibj2 .command .SequentialCommandGroup ;
12
12
import edu .wpi .first .wpilibj2 .command .WaitCommand ;
13
+ import frc .lib .HelixJoysticks ;
13
14
import frc .paths .NewAutoPartFour ;
14
15
import frc .paths .NewAutoPartOne ;
15
16
import frc .paths .NewAutoPartThree ;
18
19
import frc .robot .drive .Drivetrain ;
19
20
import frc .robot .drive .commands .ResetOdometry ;
20
21
import frc .robot .drive .commands .TrajectoryFollower ;
22
+ import frc .robot .drive .commands .TurnToAngle ;
21
23
import frc .robot .intake .Intake ;
22
24
import frc .robot .intake .commands .FastIntake ;
23
25
import frc .robot .intake .commands .RetractIntake ;
29
31
import frc .robot .shooter .commands .StopTrigger ;
30
32
import frc .robot .status .actions .ImageAction ;
31
33
import frc .robot .status .commands .ActionCommand ;
34
+ import frc .robot .vision .Limelight ;
32
35
33
36
// NOTE: Consider using this command inline, rather than writing a subclass. For more
34
37
// information, see:
35
38
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
36
39
public class NewAuto extends SequentialCommandGroup {
37
40
/** Creates a new NewAuto. */
38
- public NewAuto (Drivetrain drive , Shooter shooter , Intake intake ) {
41
+ public NewAuto (Drivetrain drive , Shooter shooter , Intake intake , Limelight limelight , HelixJoysticks joysticks ) {
39
42
addCommands (
40
43
new ResetOdometry (drive , new Pose2d (new Translation2d (0 ,0 ), new Rotation2d (-2.35 ))),
41
44
new ResetEncoder (shooter ),
42
45
new ParallelDeadlineGroup (
43
46
new WaitCommand (2.9 ),
44
- new ActionCommand (new ImageAction (Robot .fiveBallAutoImage , 0.02 , ImageAction .FOREVER ).brightness (0.7 ).oscillate ()),
47
+ // new ActionCommand(new ImageAction(Robot.fiveBallAutoImage, 0.02, ImageAction.FOREVER).brightness(0.7).oscillate()),
45
48
new TrajectoryFollower (drive , new NewAutoPartOne ()),
46
49
new FastIntake (intake ),
47
50
new SequentialCommandGroup (
@@ -56,17 +59,24 @@ public NewAuto(Drivetrain drive, Shooter shooter, Intake intake) {
56
59
),
57
60
new WaitCommand (0.35 ),
58
61
new ParallelDeadlineGroup (
59
- new WaitCommand (3.9 ),
60
- new TrajectoryFollower (drive , new NewAutoPartThree ()),
62
+ new WaitCommand (4.5 ),
61
63
new SequentialCommandGroup (
62
- new WaitCommand (1.25 ),
64
+ new WaitCommand (1.75 ),
63
65
new FlywheelController (shooter , 1795 , 76.0 )
64
66
),
65
67
new SequentialCommandGroup (
66
- new WaitCommand (2.9 ),
68
+ new TrajectoryFollower (drive , new NewAutoPartThree ()),
69
+ new TurnToAngle (drive , limelight , joysticks )
70
+ ),
71
+ new SequentialCommandGroup (
72
+ new WaitCommand (3.4 ),
67
73
new PullTrigger (shooter )
68
74
),
69
- new RetractIntake (intake )),
75
+ new SequentialCommandGroup (
76
+ new WaitCommand (0.25 ),
77
+ new RetractIntake (intake )
78
+ )
79
+ ),
70
80
new ParallelDeadlineGroup (
71
81
new WaitCommand (3.0 ),
72
82
new TrajectoryFollower (drive , new NewAutoPartFour ()),
0 commit comments