Skip to content

Commit b7e306b

Browse files
committed
formatting and documentation
1 parent 8745061 commit b7e306b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
package frc.robot.commands.swerve;
22

33
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
4-
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
54
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
65
import frc.robot.commands.intake.pivot.IntakePivotSetPositionCommand;
76
import frc.robot.commands.intake.roller.IntakeRollerIntakeCommand;
87
import frc.robot.controllers.BaseDriveController;
98
import frc.robot.subsystems.intake.IntakePivotSubsystem;
109
import frc.robot.subsystems.intake.IntakeRollerSubsystem;
11-
import frc.robot.subsystems.leds.LEDSubsystem;
1210
import frc.robot.subsystems.leds.LightBarSubsystem;
1311
import frc.robot.subsystems.swerve.SwerveSubsystem;
1412
import frc.robot.vision.NoteDetectionWrapper;
1513

14+
/**
15+
* Attempts to intake while moving towards the nearest detected note.
16+
* This command deploys the intake when run, but does not stow it when complete.
17+
*/
1618
public class AutoIntakeSequence extends SequentialCommandGroup {
1719

20+
/** Constructs an {@link AutoIntakeSequence} using the specified subsystems. */
1821
public AutoIntakeSequence(IntakeRollerSubsystem intakeRollerSubsystem,
1922
IntakePivotSubsystem intakePivotSubsystem,
2023
SwerveSubsystem swerveSubsystem,
2124
NoteDetectionWrapper noteDetector,
2225
BaseDriveController driveController,
2326
LightBarSubsystem lightBarSubsystem) {
2427

25-
addCommands(new IntakePivotSetPositionCommand(intakePivotSubsystem, 1),
26-
new ParallelCommandGroup(
27-
new NoteAlignCommand(swerveSubsystem, noteDetector, driveController).until(intakeRollerSubsystem::getFrontSensorValue),
28-
new IntakeRollerIntakeCommand(intakeRollerSubsystem, lightBarSubsystem)
29-
)
28+
addCommands(
29+
new IntakePivotSetPositionCommand(intakePivotSubsystem, 1),
30+
new ParallelCommandGroup(
31+
new NoteAlignCommand(swerveSubsystem, noteDetector, driveController)
32+
.until(intakeRollerSubsystem::getFrontSensorValue),
33+
new IntakeRollerIntakeCommand(intakeRollerSubsystem, lightBarSubsystem)
34+
)
3035
);
3136
}
3237
}

src/main/java/frc/robot/commands/swerve/NoteAlignCommand.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package frc.robot.commands.swerve;
22

33
import edu.wpi.first.math.controller.PIDController;
4-
import edu.wpi.first.math.geometry.Rotation2d;
54
import edu.wpi.first.math.util.Units;
65
import edu.wpi.first.wpilibj2.command.Command;
76
import frc.robot.controllers.BaseDriveController;

0 commit comments

Comments
 (0)