Skip to content

Commit

Permalink
Robot base code ftctechnh#4.5 isGyroCalibrated - now fixed?
Browse files Browse the repository at this point in the history
init - fixed?
  • Loading branch information
MegaChocoManiac committed Sep 11, 2017
1 parent 126a482 commit def061a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions TeamCode/src/main/java/suitbots/GyroTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
15 changes: 9 additions & 6 deletions TeamCode/src/main/java/suitbots/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;
// }
}

0 comments on commit def061a

Please sign in to comment.