From def061a6605bbdbdd17b7fccd76de5d2e25bd020 Mon Sep 17 00:00:00 2001 From: MegaChocoManiac Date: Sun, 10 Sep 2017 19:22:20 -0700 Subject: [PATCH] Robot base code #4.5 isGyroCalibrated - now fixed? init - fixed? --- TeamCode/src/main/java/suitbots/GyroTest.java | 4 ++-- TeamCode/src/main/java/suitbots/Robot.java | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/TeamCode/src/main/java/suitbots/GyroTest.java b/TeamCode/src/main/java/suitbots/GyroTest.java index 22abef92127..497cc3e930a 100644 --- a/TeamCode/src/main/java/suitbots/GyroTest.java +++ b/TeamCode/src/main/java/suitbots/GyroTest.java @@ -9,10 +9,10 @@ @TeleOp (name = "Gyro Test") -public class GyroTest extends OpMode { +public abstract class GyroTest extends OpMode { private Robot robot; @Override - public void init() { + public void init_loop() { robot = new Robot(hardwareMap); while (!robot.isGyroCalibrated()) { telemetry.addLine("Gyro is not calibrated"); diff --git a/TeamCode/src/main/java/suitbots/Robot.java b/TeamCode/src/main/java/suitbots/Robot.java index 45fbbaa89e4..4920977ea78 100644 --- a/TeamCode/src/main/java/suitbots/Robot.java +++ b/TeamCode/src/main/java/suitbots/Robot.java @@ -11,6 +11,8 @@ import org.firstinspires.ftc.robotcore.external.navigation.AxesReference; import org.firstinspires.ftc.robotcore.external.navigation.Orientation; +import java.util.Locale; + /** * Created by Samantha on 9/2/2017. */ @@ -64,11 +66,12 @@ public boolean isAboveWhiteLine() { } public boolean isGyroCalibrated() { - if(imu.isSystemCalibrated()) { - return true; - } - else { - return false; - } + return imu.isSystemCalibrated(); } +// public double getHeadingRadians() { +// degrees -> radians +// 1 = MATH.PI/180 +// double angles = ; +// return angles; +// } }