summaryrefslogtreecommitdiff
path: root/src/org/usfirst/frc
diff options
context:
space:
mode:
authorThomas Griffith <tgrif81@tscstudents.net>2017-03-04 11:21:54 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-03-04 11:21:54 -0500
commit7ec2732ece0e94ab9fa5ae983adfcbaef24c336d (patch)
tree72d8a3fa9fd1d7c988007152b6e90882e3f381c0 /src/org/usfirst/frc
parentbc862334b13b88c9aa1462357c332a2cfaac30cb (diff)
add comments
Diffstat (limited to 'src/org/usfirst/frc')
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/Autonomous.java18
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;