From 96d59feb5d3491feb8fda9d2093e5be672e8de85 Mon Sep 17 00:00:00 2001 From: nathanrsxtn Date: Thu, 7 Mar 2019 15:31:07 -0800 Subject: [PATCH] Update Drive.java Added method turnToAngle --- .../main/java/org/usfirst/frc4388/robot/subsystems/Drive.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java index 5fdc9b4..da26c21 100644 --- a/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java +++ b/2019robot/src/main/java/org/usfirst/frc4388/robot/subsystems/Drive.java @@ -910,5 +910,8 @@ public class Drive extends Subsystem implements ControlLoopable } SmartDashboard.putNumber("Update Period (ms)", lastControlLoopUpdatePeriod * 1000.0); } + } + public void turnToAngle(double targetAngle, double maxError, double maxPrevError, MPSoftwareTurnType turnType) { + setRelativeTurnPID(targetAngle - getGyroAngleDeg(), maxError, maxPrevError, turnType); } } \ No newline at end of file