diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/usfirst/frc/team4272/robot2017/Autonomous.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2017/Autonomous.java b/src/org/usfirst/frc/team4272/robot2017/Autonomous.java index 5a62be4..8398688 100644 --- a/src/org/usfirst/frc/team4272/robot2017/Autonomous.java +++ b/src/org/usfirst/frc/team4272/robot2017/Autonomous.java @@ -71,31 +71,31 @@ public class Autonomous { double rDistCurr = robot.rDriveE.getDistance(); double lPct = lDistCurr/lDistTarget; double rPct = rDistCurr/rDistTarget; - + /* Left Drive train */ c.lDrive = lSpeed; if (Math.abs(1-lPct) < pctTaper) { - c.lDrive *= Math.abs((1-lPct)/pctTaper); + c.lDrive *= Math.abs((1-lPct)/pctTaper); /* Tapering off to slow down to the designed target*/ if (Math.abs(robot.lRate.pidGet()) < 0.5) { - lMin = c.lDrive = Math.max(c.lDrive, lMin) * 1.05; + lMin = c.lDrive = Math.max(c.lDrive, lMin) * 1.05; /* Multiplier*/ } - if (c.lDrive > lSpeed) { + if (c.lDrive > lSpeed) { /* Speed to high*/ c.lDrive = lSpeed; } } c.lDrive *= Math.signum(lDistTarget) * Math.signum(1-lPct); - + /* Right Drive Train*/ c.rDrive = rSpeed; if (Math.abs(1-rPct) < pctTaper) { - c.rDrive *= Math.abs((1-rPct)/pctTaper); + c.rDrive *= Math.abs((1-rPct)/pctTaper); /* Tapering off to slow down to the deigned target*/ if (Math.abs(robot.rRate.pidGet()) < 0.5) { - rMin = c.rDrive = Math.max(c.rDrive, rMin) * 1.05; + rMin = c.rDrive = Math.max(c.rDrive, rMin) * 1.05; /* Multiplier*/ } - if (c.rDrive > rSpeed) { + if (c.rDrive > rSpeed) { /* Speed to high*/ c.rDrive = rSpeed; } } c.rDrive *= Math.signum(rDistTarget) * Math.signum(1-rPct); - + /* If lDrive or rDrive is not even */ if (Math.abs(lPct - rPct) > pctTolerance) { if (lPct > rPct) { c.lDrive *= pctThrottle; |