From: EvanYap Date: Sat, 4 Feb 2017 21:57:50 +0000 (-0800) Subject: Make SETPOINT variable get SmartDashboard's target dist option and pass that into... X-Git-Url: http://challenge-bot.com/repos/?p=3501%2F2017steamworks;a=commitdiff_plain;h=f213251be9191e13e031b754c311a6c9d935276f Make SETPOINT variable get SmartDashboard's target dist option and pass that into DriveDistance cmd --- diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index e0f075b..5e5ed04 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3501.robot; +import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.Intake; import org.usfirst.frc.team3501.robot.subsystems.Shooter; @@ -47,6 +48,7 @@ public class Robot extends IterativeRobot { SmartDashboard.putNumber(Constants.DriveTrain.P_Val, -1); SmartDashboard.putNumber(Constants.DriveTrain.I_Val, -1); SmartDashboard.putNumber(Constants.DriveTrain.D_Val, -1); + SmartDashboard.putNumber(Constants.DriveTrain.TARGET_DIST, 50); } @@ -57,7 +59,13 @@ public class Robot extends IterativeRobot { double P = SmartDashboard.getNumber(Constants.DriveTrain.P_Val, -1); double I = SmartDashboard.getNumber(Constants.DriveTrain.I_Val, -1); double D = SmartDashboard.getNumber(Constants.DriveTrain.D_Val, -1); + + double SETPOINT = SmartDashboard.getNumber(Constants.DriveTrain.TARGET_DIST, + -1); + DriveTrain.getDriveTrain().getDriveController().setConstants(P, I, D); + + new DriveDistance(SETPOINT, 0.5).start(); } @Override