summaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/HwRobot.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
index 7752bd8..f30d495 100644
--- a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
+++ b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
@@ -65,37 +65,39 @@ public class HwRobot {
// naming convention: {side_letter}{Thing}{E|M (encoder/motor)}
+ // Actuators should be private /////////////////////////////////////////
private final PIDOutput
rDriveM = new Talon(/*PWM*/0), /* PDP 2, 3 */
lDriveM = new Talon(/*PWM*/1), /* PDP 12, 13 */
climber = new Talon(/*PWM*/3); /* PDP 4 */
+ private final DoubleSolenoid
+ shifter = new DoubleSolenoid(/*PCM*/4, /*PCM*/5),
+ ged = new DoubleSolenoid(/*PCM*/6, /*PCM*/7);
+ // Sensors/info should be public ///////////////////////////////////////
public final Encoder lDriveE = new Encoder(/*DIO*/0,/*DIO*/1, /*reverse*/false);
public final Encoder rDriveE = new Encoder(/*DIO*/2,/*DIO*/3, /*reverse*/true);
public final PIDSource lRate, rRate;
public final PowerDistributionPanel PDP = new PowerDistributionPanel(); /* via CAN */
public final DriverStation ds = DriverStation.getInstance();
-
- public DoubleSolenoid
- shifter = new DoubleSolenoid(/*PCM*/4, /*PCM*/5),
- ged = new DoubleSolenoid(/*PCM*/6, /*PCM*/7);
-
public final double axleWidth = 2.0; // in feet
+ // Use the constructor to initialize anything you can't
+ // initialize above.
public HwRobot() {
lDriveE.setDistancePerPulse(10.0/*feet*/ / 1865.75/*pulses*/);
rDriveE.setDistancePerPulse(10.0/*feet*/ / 1865.75/*pulses*/);
lDriveE.setPIDSourceType(PIDSourceType.kRate);
rDriveE.setPIDSourceType(PIDSourceType.kRate);
- PDP.initTable(NetworkTable.getTable("PDP"));
lRate = new RollingAvg(5, lDriveE);
rRate = new RollingAvg(5, rDriveE);
+
+ PDP.initTable(NetworkTable.getTable("PDP"));
}
private double maxRate = 0;
private double minBatt = 20;
-
public void run(Control c) {
lDriveM.pidWrite(c.lDrive);
rDriveM.pidWrite(-c.rDrive);