Skip to content

Commit

Permalink
if shooter doesnt see apriltag and wants to shoot
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiggy committed Jul 20, 2024
1 parent e6a15e1 commit 0c349bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/main/java/org/carlmontrobotics/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.carlmontrobotics.Constants.Armc.*;
import static org.carlmontrobotics.Constants.OI.Manipulator.*;
import static org.carlmontrobotics.Constants.Effectorc.*;
import static org.carlmontrobotics.Constants.Limelightc.*;

// non static constants
import org.carlmontrobotics.Constants.OI;
Expand Down Expand Up @@ -52,6 +53,7 @@

// commands
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.ConditionalCommand;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
import edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup;
Expand Down Expand Up @@ -202,9 +204,14 @@ private void setBindingsManipulator() {

// new JoystickButton(manipulatorController, A_BUTTON)
// .onTrue(new RampMaxRPMDriving(intakeShooter));
// axisTrigger(manipulatorController, Manipulator.SHOOTER_BUTTON).whileTrue(
// new SequentialCommandGroup(new AimArmSpeaker(arm, limelight),
// new PassToOuttake(intakeShooter)));

axisTrigger(manipulatorController, Manipulator.SHOOTER_BUTTON).whileTrue(
new SequentialCommandGroup(new AimArmSpeaker(arm, limelight),
new PassToOuttake(intakeShooter)));
new ConditionalCommand(new SequentialCommandGroup(new AimArmSpeaker(arm, limelight),
new PassToOuttake(intakeShooter)), new InstantCommand(() -> {
}), () -> LimelightHelpers.getTV(SHOOTER_LL_NAME)));

// axisTrigger(manipulatorController, Manipulator.SHOOTER_BUTTON)
// .whileTrue(new PassToOuttake(intakeShooter));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

package org.carlmontrobotics.commands;

import static org.carlmontrobotics.Constants.Limelightc.SHOOTER_LL_NAME;
import static org.carlmontrobotics.Constants.Armc.*;
import static org.carlmontrobotics.Constants.Limelightc.*;

import org.carlmontrobotics.Constants.Limelightc;
import org.carlmontrobotics.subsystems.Arm;
Expand All @@ -30,10 +31,10 @@ public void initialize() {
if (LimelightHelpers.getTV(Limelightc.SHOOTER_LL_NAME)) {
double goal = ll.getOptimizedArmAngleRadsMT2();
arm.setArmTarget(goal);
} else {
arm.setArmTarget(.23);
}

else {
arm.setArmTarget(SPEAKER_ANGLE_RAD);
}
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down

0 comments on commit 0c349bf

Please sign in to comment.