summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/Autonomous.java5
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/HwRobot.java12
2 files changed, 8 insertions, 9 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2017/Autonomous.java b/src/org/usfirst/frc/team4272/robot2017/Autonomous.java
index 901e22a..021a00a 100644
--- a/src/org/usfirst/frc/team4272/robot2017/Autonomous.java
+++ b/src/org/usfirst/frc/team4272/robot2017/Autonomous.java
@@ -74,6 +74,11 @@ public class Autonomous {
Command stop = c->{c.lDrive = c.rDrive = 0; return true;};
+ modeChooser.addObject("Drive 10 feet", robot->new Command[]{
+ init,
+ driveDistance(robot, 0.4, 10),
+ stop,
+ });
modeChooser.addObject("Center Peg", robot->new Command[]{
init,
timeout(6.0, driveDistance(robot, 0.4, 8.75)),
diff --git a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
index cea46af..533cf9d 100644
--- a/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
+++ b/src/org/usfirst/frc/team4272/robot2017/HwRobot.java
@@ -74,7 +74,6 @@ public class HwRobot {
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 final double axleWidth = 2.0; // in feet
@@ -89,18 +88,16 @@ public class HwRobot {
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);
+ lDriveM.pidWrite(-c.lDrive);
+ rDriveM.pidWrite(c.rDrive);
climber.pidWrite(c.climber);
- shifter.set(c.highGear ? DoubleSolenoid.Value.kReverse : DoubleSolenoid.Value.kForward);
+ shifter.set(c.highGear ? DoubleSolenoid.Value.kForward : DoubleSolenoid.Value.kReverse);
ged.set(c.gedOut ? DoubleSolenoid.Value.kReverse : DoubleSolenoid.Value.kForward);
double rate = Math.abs((lDriveE.getRate()+rDriveE.getRate())/2);
@@ -121,8 +118,5 @@ public class HwRobot {
SmartDashboard.putBoolean("highGear", c.highGear);
SmartDashboard.putBoolean("gedOut", c.gedOut);
-
- PDP.updateTable();
- SmartDashboard.putData("PDP", PDP);
}
}