-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGyro Methods
62 lines (55 loc) · 1.37 KB
/
Gyro Methods
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/************************GYRO FUNCTIONS************************/
/**
* This function is used to check if the gyro is connected
*
* @return Returns true or false depending on the state of the gyro
*/
public boolean gyroConnected(){
return nav6.isConnected();
}
/**
* This function is used to check if the gyro is calibrating
*
* @return Returns true or false depending on the state of the gyro
*/
public boolean gyroCalibrating(){
return nav6.isCalibrating();
}
/**
* This function returns the YAW reading from the gyro
*
* @return Returns YAW
*/
public double getYaw(){
return nav6.getYaw();
}
/**
* This function returns the PITCH reading from the gyro
*
* @return Returns PITCH
*/
public double getPitch(){
return nav6.getPitch();
}
/**
* This function returns the ROLL reading from the gyro
*
* @return Returns ROLL
*/
public double getRoll(){
return nav6.getRoll();
}
/**
* This function returns the heading from the gyro
*
* @return Returns compass heading
*/
public double getCompassHeading(){
return nav6.getCompassHeading();
}
/**
* Resets the gyro back to zero
*/
public void resetGyro(){
nav6.zeroYaw();
}