Robot Core Documentation
Loading...
Searching...
No Matches
robotCore.Gyro Class Reference

The Gyro class measures the orientation of the robot. More...

Public Member Functions

double getYaw ()
 
Rotation2d getRotation2d ()
 
void reset (double yaw)
 
void invert (boolean invert)
 

Static Public Member Functions

static double normalize (double angle, double range)
 
static double normalizeAngle (double angle)
 

Detailed Description

The Gyro class measures the orientation of the robot.

Author
John Gaby

Member Function Documentation

◆ getRotation2d()

Rotation2d robotCore.Gyro.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: