forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEasyIMU.java
More file actions
28 lines (25 loc) · 882 Bytes
/
EasyIMU.java
File metadata and controls
28 lines (25 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.IMU;
import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit;
import org.firstinspires.ftc.robotcore.external.navigation.YawPitchRollAngles;
public class EasyIMU {
IMU imu;
public EasyIMU(IMU i){
imu = i;
}
public double getYaw(){
YawPitchRollAngles orientation;
orientation = imu.getRobotYawPitchRollAngles();
return orientation.getYaw(AngleUnit.DEGREES);
}
public double getRoll(){
YawPitchRollAngles orientation;
orientation = imu.getRobotYawPitchRollAngles();
return orientation.getRoll(AngleUnit.DEGREES);
}
public double getPitch(){
YawPitchRollAngles orientation;
orientation = imu.getRobotYawPitchRollAngles();
return orientation.getPitch(AngleUnit.DEGREES);
}
}