Skip to content

Commit

Permalink
formatting and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticalApple committed Apr 15, 2024
1 parent 8745061 commit b7e306b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 12 additions & 7 deletions src/main/java/frc/robot/commands/swerve/AutoIntakeSequence.java
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
package frc.robot.commands.swerve;

import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.intake.pivot.IntakePivotSetPositionCommand;
import frc.robot.commands.intake.roller.IntakeRollerIntakeCommand;
import frc.robot.controllers.BaseDriveController;
import frc.robot.subsystems.intake.IntakePivotSubsystem;
import frc.robot.subsystems.intake.IntakeRollerSubsystem;
import frc.robot.subsystems.leds.LEDSubsystem;
import frc.robot.subsystems.leds.LightBarSubsystem;
import frc.robot.subsystems.swerve.SwerveSubsystem;
import frc.robot.vision.NoteDetectionWrapper;

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

/** Constructs an {@link AutoIntakeSequence} using the specified subsystems. */
public AutoIntakeSequence(IntakeRollerSubsystem intakeRollerSubsystem,
IntakePivotSubsystem intakePivotSubsystem,
SwerveSubsystem swerveSubsystem,
NoteDetectionWrapper noteDetector,
BaseDriveController driveController,
LightBarSubsystem lightBarSubsystem) {

addCommands(new IntakePivotSetPositionCommand(intakePivotSubsystem, 1),
new ParallelCommandGroup(
new NoteAlignCommand(swerveSubsystem, noteDetector, driveController).until(intakeRollerSubsystem::getFrontSensorValue),
new IntakeRollerIntakeCommand(intakeRollerSubsystem, lightBarSubsystem)
)
addCommands(
new IntakePivotSetPositionCommand(intakePivotSubsystem, 1),
new ParallelCommandGroup(
new NoteAlignCommand(swerveSubsystem, noteDetector, driveController)
.until(intakeRollerSubsystem::getFrontSensorValue),
new IntakeRollerIntakeCommand(intakeRollerSubsystem, lightBarSubsystem)
)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package frc.robot.commands.swerve;

import edu.wpi.first.math.controller.PIDController;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.util.Units;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.controllers.BaseDriveController;
Expand Down

0 comments on commit b7e306b

Please sign in to comment.