From c9cdc810505d568ca83e059236c3b66ba486d4c9 Mon Sep 17 00:00:00 2001 From: Eric Sandoval Date: Sun, 19 Feb 2017 14:21:26 -0800 Subject: [PATCH] update code --- src/org/usfirst/frc/team3501/robot/Robot.java | 2 +- .../frc/team3501/robot/commands/driving/DriveDistance.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 6388d0a..16b2884 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -58,7 +58,7 @@ public class Robot extends IterativeRobot { public void autonomousInit() { driveTrain.setHighGear(); - double driveP = SmartDashboard.getNumber(driveTrain.DRIVE_D_Val, + double driveP = SmartDashboard.getNumber(driveTrain.DRIVE_P_Val, driveTrain.PID_ERROR); double driveI = SmartDashboard.getNumber(driveTrain.DRIVE_I_Val, driveTrain.PID_ERROR); diff --git a/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java b/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java index cb8227f..ccefba0 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java +++ b/src/org/usfirst/frc/team3501/robot/commands/driving/DriveDistance.java @@ -17,7 +17,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; */ public class DriveDistance extends Command { private DriveTrain driveTrain = Robot.getDriveTrain(); - private double maxTimeOut = 10; + private double maxTimeOut; private double target; private double zeroAngle; private Preferences prefs; @@ -28,12 +28,13 @@ public class DriveDistance extends Command { public DriveDistance(double distance, double maxTimeOut) { requires(driveTrain); this.target = distance; + this.maxTimeOut = maxTimeOut; driveStraightGyroP = SmartDashboard.getNumber(driveTrain.DRIVE_GYRO_P_Val, driveTrain.PID_ERROR); this.driveController = driveTrain.getDriveController(); this.driveController.setDoneRange(0.5); - this.driveController.setMaxOutput(1.1); + this.driveController.setMaxOutput(1.0); this.driveController.setMinDoneCycles(5); } -- 2.30.2