Skip to content

Commit

Permalink
chore: resolve requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGamer1002 authored and NyxAlexandra committed Mar 9, 2024
1 parent 7b6212a commit 06eb5fc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
7 changes: 0 additions & 7 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ public class RobotContainer {
private final Shooter shooter;
private final Command intakeCommand, shootCommand, aimAtLimelightCommand, rotateCommand, driveToPoseCommand, aimAndPickUpNoteCommand;

// CommandJoystick rotationController = new CommandJoystick(1);
// Replace with CommandPS4Controller or CommandJoystick if needed

// CommandJoystick driverController = new CommandJoystick(3);//(OperatorConstants.DRIVER_CONTROLLER_PORT);
XboxController driverXbox = new XboxController(0);
XboxController shooterXbox = new XboxController(1);

Expand Down Expand Up @@ -124,9 +120,6 @@ private void configureBindings() {
new JoystickButton(driverXbox, XboxController.Button.kX.value).whileTrue(aimAtLimelightCommand);
new JoystickButton(driverXbox, 2).whileTrue(driveToPoseCommand);
new JoystickButton(driverXbox, XboxController.Button.kY.value).whileTrue(rotateCommand);
// new JoystickButton(driverXbox, 3).whileTrue(new RepeatCommand(new InstantCommand(drivebase::lock, drivebase)));
//new JoystickButton(driverXbox, XboxController.Button.kStart.value).whileTrue(drivebase.sysIdAngleMotorCommand());
//new JoystickButton(driverXbox, XboxController.Button.kBack.value).whileTrue(drivebase.sysIdDriveMotorCommand());


new JoystickButton(shooterXbox, XboxController.Button.kLeftBumper.value).whileTrue(intakeCommand); // independent of speed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ public void initialize() {

}

/**
* The main body of a command. Called repeatedly while the command is scheduled.
* (That is, it is called repeatedly until {@link #isFinished()}) returns true.)
*/
@Override
public void execute() {

Expand All @@ -59,33 +55,11 @@ public void execute() {

}

/**
* <p>
* Returns whether this command has finished. Once a command finishes -- indicated by
* this method returning true -- the scheduler will call its {@link #end(boolean)} method.
* </p><p>
* Returning false will result in the command never ending automatically. It may still be
* cancelled manually or interrupted by another command. Hard coding this command to always
* return true will result in the command executing once and finishing immediately. It is
* recommended to use * {@link edu.wpi.first.wpilibj2.command.InstantCommand InstantCommand}
* for such an operation.
* </p>
*
* @return whether this command has finished.
*/
@Override
public boolean isFinished() {
return (Math.abs(LimelightHelpers.getTX("limelight-back")) < 1.0) && LimelightHelpers.getTV("limelight-back");
}

/**
* The action to take when the command ends. Called when either the command
* finishes normally -- that is it is called when {@link #isFinished()} returns
* true -- or when it is interrupted/canceled. This is where you may want to
* wrap up loose ends, like shutting off a motor that was being used in the command.
*
* @param interrupted whether the command was interrupted/canceled
*/
@Override
public void end(boolean interrupted) {
LimelightHelpers.setPipelineIndex("limelight-back", 0);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/VisionSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private VisionSubsystem() {
@Override
public void periodic() {
// This method will be called once per scheduler run
//SwerveSubsystem.addVisionMeasurement(LimelightHelpers.getBotPose2d("back-limelight"), Timer.getFPGATimestamp() - LimelightHelpers.getLatency_Capture("back-limelight") - LimelightHelpers.getLatency_Pipeline("back-limelight") );


Logger.recordOutput("Targets", LimelightHelpers.getTargetPose3d_RobotSpace("limelight-back"));

Expand Down

0 comments on commit 06eb5fc

Please sign in to comment.