summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-03-12 12:08:01 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-03-12 12:08:01 -0400
commit680a2292554f18f287859a5045e2921cb354ec44 (patch)
tree73d5a0c923f0fa9e3367d0a7aa2918226598d378
parent0018460337ece50b16263bdd62311e8cda11dbd2 (diff)
move the axleWidth constant from Autonomous to HwRobot.
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/Autonomous.java5
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/HwRobot.java8
2 files changed, 7 insertions, 6 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2017/Autonomous.java b/src/org/usfirst/frc/team4272/robot2017/Autonomous.java
index 2669205..3f6b7b4 100644
--- a/src/org/usfirst/frc/team4272/robot2017/Autonomous.java
+++ b/src/org/usfirst/frc/team4272/robot2017/Autonomous.java
@@ -145,7 +145,6 @@ public class Autonomous {
}
}
- private static final double axleWidth = 2; // in feet
private static Command driveDistance(HwRobot robot, double speed, double dist) {
return new DriveDistance(robot, 0.2,
speed, dist,
@@ -153,8 +152,8 @@ public class Autonomous {
}
private static Command turnRadians(HwRobot robot, double speed, double rad) {
return new DriveDistance(robot, 0.6,
- speed, Math.copySign(rad*axleWidth/2, rad),
- speed, Math.copySign(rad*axleWidth/2, -rad));
+ speed, Math.copySign(rad*robot.axleWidth/2, rad),
+ speed, Math.copySign(rad*robot.axleWidth/2, -rad));
}
private static Command turnDegrees(HwRobot robot, double speed, double deg) {
return turnRadians(robot, speed, deg * Math.PI/180);
diff --git a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
index a72ae44..23d98b3 100644
--- a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
+++ b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
@@ -80,9 +80,8 @@ public class HwRobot {
public DoubleSolenoid
shifter = new DoubleSolenoid(/*PCM*/4, /*PCM*/5),
ged = new DoubleSolenoid(/*PCM*/6, /*PCM*/7);
-
- private double maxRate = 0;
- private double minBatt = 20;
+
+ public final double axleWidth = 2.0; // in feet
public HwRobot() {
lDriveE.setDistancePerPulse(10.0/*feet*/ / 1865.75/*pulses*/);
@@ -96,6 +95,9 @@ public class HwRobot {
rRate = new RollingAvg(5, rDriveE);
}
+ private double maxRate = 0;
+ private double minBatt = 20;
+
public void run(Control c) {
lDriveM.pidWrite(c.lDrive);
rDriveM.pidWrite(-c.rDrive);