diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-03-12 12:22:48 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-03-12 12:22:48 -0400 |
commit | 42ae8a7af341fab193e386438d23724fde95f03b (patch) | |
tree | 41386c36c2d8351feeb347ce24fbc9fdb33dbb92 /src/org | |
parent | 900d6d69c090492d0fb35410c36dcb9a24c74eea (diff) |
Tidy HwRobot.
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/usfirst/frc/team4272/robot2017/HwRobot.java | 16 |
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); |