The Gyro class measures the orientation of the robot.
More...
The Gyro class measures the orientation of the robot.
- Author
- John Gaby
◆ getRotation2d()
Returns the angle using the Rotation2d format.
- Returns
- Returns the current angle using the Rotation2d format.
◆ getYaw()
double robotCore.Gyro.getYaw |
( |
| ) |
|
Gets only the yaw.
- Returns
- Returns the yaw.
◆ invert()
void robotCore.Gyro.invert |
( |
boolean | invert | ) |
|
Specifies that the sense of the yaw be inverted. I.E. controls whether the yaw value increases or decreases when the robot turns clockwise. In general, the Pure Pursuit path following assumes that the yaw will decrease when the robot turns clockwise.
- Parameters
-
invert | - If true, inverts the direction of the yaw |
◆ normalize()
static double robotCore.Gyro.normalize |
( |
double | angle, |
|
|
double | range ) |
|
static |
Normalizes the value to be between -range/2 and +range/2.
- Returns
- Returns same value but guarenteed to be between -range/2 and +range/2
◆ normalizeAngle()
static double robotCore.Gyro.normalizeAngle |
( |
double | angle | ) |
|
|
static |
Normalizes an angle to between -180 and +180 degrees.
- Returns
- Returns same angle but guarenteed to be between -180 and +180 degrees.
◆ reset()
void robotCore.Gyro.reset |
( |
double | yaw | ) |
|
Resets the yaw and position of the robot.
- Parameters
-
yaw | - Specifies the new yaw value for the robot in degrees. This value will be adjusted so that it in the range -180 to 180. |
The documentation for this class was generated from the following file:
- D:/SDASVN/2024/RaspberryPi/VSCode/Source/robotCore/Gyro.java