desmos shi

This commit is contained in:
66945
2022-03-15 14:23:37 -06:00
parent 565d5d1d62
commit b97f993e7d
5 changed files with 103 additions and 13 deletions
+2 -1
View File
@@ -243,7 +243,8 @@ public final class Constants {
public static final double RANGE = 10;
public static final double LIMELIGHT_RADIUS = 1.d;
public static final double EDGE_TO_CENTER = 20;
public static final double LIMELIGHT_RADIUS = 8;
public static final double SHOOTER_CORRECTION = 1.d;
}
}
@@ -19,11 +19,11 @@ public class ExtenderIntakeGroup extends ParallelRaceGroup {
public ExtenderIntakeGroup(Intake intake, Extender extender) {
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
ExtenderIntakeGroup.direction = 1;
ExtenderIntakeGroup.direction = 1; // Does this make sense? It kind of defeats the purpose of making it static, does it work without?
addCommands(new RunIntakeConditionally(intake), new RunExtender(extender));
}
public static void changeDirection() {
public static void changeDirection() { // Never implemented?
ExtenderIntakeGroup.direction *= -1;
}
}
@@ -86,28 +86,29 @@ public class TrackTarget extends CommandBase {
y_rot += Math.toRadians(VisionConstants.LIME_ANGLE);
double distance = (VisionConstants.TARGET_HEIGHT - VisionConstants.LIME_HEIGHT) / Math.tan(y_rot);
DesmosServer.putDouble("distance", distance);
updateRegressionDesmos();
double regressedDistance = distanceRegression(distance);
regressedDistance += VisionConstants.EDGE_TO_CENTER + VisionConstants.LIMELIGHT_RADIUS;
DesmosServer.putDouble("distanceReg", regressedDistance);
//Vision odemetry circle fit based pose estimate
Point targetOffset = m_visionOdometry.getTargetOffset();
DesmosServer.putPoint("targetOff", targetOffset);
vel = m_boomBoom.getVelocity(distance);
hood = m_boomBoom.getHood(distance);
// m_boomBoom.runDrumShooter(vel);
m_boomBoom.runDrumShooterVelocityPID(vel);
m_hood.runAngleAdjustPID(hood);
// isExecuted = true;
}
catch (Exception e){
e.printStackTrace();
// System.err.println("Exception: " + e.toString() + ", Line 78 at TrackTarget.java");
}
// vel = m_boomBoom.getVelocity(distance);
// hood = m_boomBoom.getHood(distance);
// m_boomBoom.runDrumShooter(vel);
// m_boomBoom.runDrumShooterVelocityPID(vel);
// m_hood.runAngleAdjustPID(hood);
// m_turret.runshooterRotatePID(m_targetAngle);
}