stash
This commit is contained in:
@@ -150,14 +150,14 @@ public class TeleopV3 extends LinearOpMode {
|
|||||||
PIDFController tController = new PIDFController(tp, ti, td, tf);
|
PIDFController tController = new PIDFController(tp, ti, td, tf);
|
||||||
|
|
||||||
tController.setTolerance(0.001);
|
tController.setTolerance(0.001);
|
||||||
|
//
|
||||||
|
// if (redAlliance) {
|
||||||
|
// robot.limelight.pipelineSwitch(3);
|
||||||
|
// } else {
|
||||||
|
// robot.limelight.pipelineSwitch(2);
|
||||||
|
// }
|
||||||
|
|
||||||
if (redAlliance) {
|
// robot.limelight.start();
|
||||||
robot.limelight.pipelineSwitch(3);
|
|
||||||
} else {
|
|
||||||
robot.limelight.pipelineSwitch(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
robot.limelight.start();
|
|
||||||
|
|
||||||
waitForStart();
|
waitForStart();
|
||||||
if (isStopRequested()) return;
|
if (isStopRequested()) return;
|
||||||
@@ -434,28 +434,28 @@ public class TeleopV3 extends LinearOpMode {
|
|||||||
|
|
||||||
TELE.addData("posS2", pos);
|
TELE.addData("posS2", pos);
|
||||||
|
|
||||||
if (y < 0.3 && y > -0.3 && x < 0.3 && x > -0.3 && rx < 0.3 && rx > -0.3) { //not moving
|
// if (y < 0.3 && y > -0.3 && x < 0.3 && x > -0.3 && rx < 0.3 && rx > -0.3) { //not moving
|
||||||
double bearing;
|
// double bearing;
|
||||||
|
//
|
||||||
LLResult result = robot.limelight.getLatestResult();
|
// LLResult result = robot.light.getLatestResult();
|
||||||
if (result != null) {
|
// if (result != null) {
|
||||||
if (result.isValid()) {
|
// if (result.isValid()) {
|
||||||
bearing = result.getTx() * bMult;
|
// bearing = result.getTx() * bMult;
|
||||||
|
//
|
||||||
double bearingCorrection = bearing / bDiv;
|
// double bearingCorrection = bearing / bDiv;
|
||||||
|
//
|
||||||
error += bearingCorrection;
|
// error += bearingCorrection;
|
||||||
|
//
|
||||||
camTicker++;
|
// camTicker++;
|
||||||
TELE.addData("tx", bearingCorrection);
|
// TELE.addData("tx", bearingCorrection);
|
||||||
TELE.addData("ty", result.getTy());
|
// TELE.addData("ty", result.getTy());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
} else {
|
// } else {
|
||||||
camTicker = 0;
|
// camTicker = 0;
|
||||||
overrideTurr = false;
|
// overrideTurr = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!overrideTurr) {
|
if (!overrideTurr) {
|
||||||
turretPos = pos;
|
turretPos = pos;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class Robot {
|
|||||||
|
|
||||||
//Initialize Public Components
|
//Initialize Public Components
|
||||||
|
|
||||||
public static boolean usingLimelight = true;
|
public static boolean usingLimelight = false;
|
||||||
public static boolean usingCamera = true;
|
public static boolean usingCamera = true;
|
||||||
public DcMotorEx frontLeft;
|
public DcMotorEx frontLeft;
|
||||||
public DcMotorEx frontRight;
|
public DcMotorEx frontRight;
|
||||||
|
|||||||
Reference in New Issue
Block a user