mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Reduced Error
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
Distance (in),Hood Ext. (u),Drum Velocity (u/ds),Center Displacment (deg)
|
||||
0,16,6000,1,
|
||||
65.9,16,6000,1,
|
||||
126.6,20.25,7000,0.95,
|
||||
180,24,8000,1,
|
||||
185.85,26.5, 9000,1.625,
|
||||
245,28.9,9500,.98,
|
||||
262,28.9,9500,.98,
|
||||
999,28.9,9500,.98,
|
||||
0,16,6000,0,
|
||||
65.9,16,6000,0,
|
||||
126.6,20.25,7000,0,
|
||||
180,24,8000,0,
|
||||
185.85,26.5, 9000,1.1,
|
||||
245,28.9,9500,0,
|
||||
262,28.9,9500,0,
|
||||
999,28.9,9500,0,
|
||||
|
@@ -26,4 +26,14 @@ IN BETWEEN
|
||||
185.85,26.5, 9000,1.625,
|
||||
245,27,11000,1,
|
||||
262,27,11000,1.25,
|
||||
999,27,11000,1.25,
|
||||
999,27,11000,1.25,
|
||||
|
||||
HOLD
|
||||
0,16,6000,1,
|
||||
65.9,16,6000,1,
|
||||
126.6,20.25,7000,0.95,
|
||||
180,24,8000,1,
|
||||
185.85,26.5, 9000,1.625,
|
||||
245,28.9,9500,.98,
|
||||
262,28.9,9500,.98,
|
||||
999,28.9,9500,.98,
|
||||
|
@@ -215,7 +215,7 @@ public final class Constants {
|
||||
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;
|
||||
public static final double X_ANGLE_ERROR = 0.5;
|
||||
public static final double MOTOR_DEAD_ZONE = 0.2;
|
||||
public static final double DISTANCE_ERROR_EQUATION_M = 1.1279;
|
||||
public static final double DISTANCE_ERROR_EQUATION_B = -15.0684;
|
||||
|
||||
@@ -254,9 +254,9 @@ public class RobotContainer {
|
||||
new JoystickButton(getOperatorJoystick(), XboxController.A_BUTTON)
|
||||
.whileHeld(new TrackTarget(m_robotShooterAim))
|
||||
.whileHeld(new RunCommand(() -> m_robotShooterHood.runAngleAdjustPID(m_robotShooterHood.addFireAngle())))
|
||||
//.whenPressed(new StoragePrep(m_robotStorage))
|
||||
//.whenReleased(new InterruptSubystem(m_robotStorage))
|
||||
.whenReleased(new InstantCommand(() -> m_robotLime.limeOff()));
|
||||
|
||||
//.whileHeld(new RunCommand(() -> m_robotShooterAim.runshooterRotatePID()));
|
||||
//.whileHeld(new RunCommand(() -> m_robotShooter.runDrumShooterVelocityPID(11000)));
|
||||
//.whileHeld(new HoldTarget(m_robotShooter, m_robotShooterAim))
|
||||
//.whileHeld(new RunCommand(() -> m_robotShooter.runAngleAdjustPID(30)));
|
||||
|
||||
@@ -76,17 +76,19 @@ public class TrackTarget extends CommandBase {
|
||||
if (target == 1.0) { // If target in view
|
||||
// Aiming Left/Right
|
||||
xAngle = xAngle + m_shooter.m_shooterTable.getCenterDisplacement(realDistance);
|
||||
turnAmount = (xAngle / VisionConstants.FOV) * VisionConstants.TURN_P_VALUE;
|
||||
turnAmount = ((xAngle / VisionConstants.FOV) * VisionConstants.TURN_P_VALUE);
|
||||
if (Math.abs(xAngle) < VisionConstants.X_ANGLE_ERROR) {
|
||||
turnAmount = 0;
|
||||
} // Angle Error Zone
|
||||
// Deadzones
|
||||
else if (turnAmount > 0 && turnAmount < VisionConstants.MOTOR_DEAD_ZONE) {
|
||||
turnAmount = VisionConstants.MOTOR_DEAD_ZONE;
|
||||
} else if (turnAmount < 0 && turnAmount > -VisionConstants.MOTOR_DEAD_ZONE) {
|
||||
turnAmount = -VisionConstants.MOTOR_DEAD_ZONE;
|
||||
else if (turnAmount > 0 && turnAmount < 0.1){// VisionConstants.MOTOR_DEAD_ZONE) {
|
||||
turnAmount = 0.1;//VisionConstants.MOTOR_DEAD_ZONE;
|
||||
} else if (turnAmount < 0 && turnAmount > -0.1){//-VisionConstants.MOTOR_DEAD_ZONE) {
|
||||
turnAmount = -0.1;//-VisionConstants.MOTOR_DEAD_ZONE;
|
||||
}
|
||||
|
||||
m_shooterAim.runShooterWithInput(-turnAmount);// - m_shooter.shooterTrims.m_turretTrim);
|
||||
//m_shooterAim.runshooterRotatePID(targetAngle);
|
||||
|
||||
SmartDashboard.putNumber("Distance to Target", realDistance);
|
||||
SmartDashboard.putNumber("Center Displacement", m_shooter.m_shooterTable.getCenterDisplacement(realDistance));
|
||||
|
||||
Reference in New Issue
Block a user