mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Adjustments for shooter
Co-Authored-By: Nirvan Bhalala <78400306+nbhalala27@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user