Adjustments for shooter

Co-Authored-By: Nirvan Bhalala <78400306+nbhalala27@users.noreply.github.com>
This commit is contained in:
Aarav Shah
2021-03-04 17:26:04 -07:00
parent a7c41ebe2d
commit c274989aac
3 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ public final class Constants {
public static final class VisionConstants {
public static final double FOV = 29.8; //Field of view of limelight
public static final double TARGET_HEIGHT = 71.5;
public static final double TARGET_HEIGHT = 67.5;
public static final double LIME_ANGLE = 24.7;
public static final double TURN_P_VALUE = 0.8;
public static final double X_ANGLE_ERROR = 1.3;
@@ -236,12 +236,14 @@ public class RobotContainer {
// extends or retracts the extender
new JoystickButton(getOperatorJoystick(), XboxController.X_BUTTON)
.whileHeld(new RunCommand(() -> m_robotIntake.runExtender(0.5)))
.whenReleased(new InstantCommand(() -> m_robotIntake.runExtender(0)));
//.whileHeld(new RunCommand(() -> m_robotIntake.runExtender(0.5)))
//.whenReleased(new InstantCommand(() -> m_robotIntake.runExtender(0)));
.whileHeld(new RunCommand(() -> m_robotShooterHood.runHood(0.5), m_robotShooterHood));
new JoystickButton(getOperatorJoystick(), XboxController.Y_BUTTON)
.whileHeld(new RunCommand(() -> m_robotIntake.runExtender(-0.5)))
.whenReleased(new InstantCommand(() -> m_robotIntake.runExtender(0)));
//.whileHeld(new RunCommand(() -> m_robotIntake.runExtender(-0.5)))
//.whenReleased(new InstantCommand(() -> m_robotIntake.runExtender(0)));
.whileHeld(new RunCommand(() -> m_robotShooterHood.runHood(-0.5), m_robotShooterHood));
// safety for climber and leveler
new JoystickButton(getOperatorJoystick(), XboxController.BACK_BUTTON)
@@ -69,7 +69,7 @@ public class TrackTarget extends CommandBase {
yAngle = NetworkTableInstance.getDefault().getTable("limelight").getEntry("ty").getDouble(0);
// Finding Distance
distance = VisionConstants.TARGET_HEIGHT / Math.tan((VisionConstants.LIME_ANGLE + yAngle) * (Math.PI / 180));
distance = (VisionConstants.TARGET_HEIGHT) / Math.tan((VisionConstants.LIME_ANGLE + yAngle) * (Math.PI / 180));
realDistance = (1.09 * distance) - 12.8;