Package frc.team88.swerve.gyro
Interface SwerveGyro
-
- All Known Implementing Classes:
NavX
public interface SwerveGyro
Represents a gyroscope. Values returned follow our rules for units and the field coordinate frame. Specifically, units are in degrees and degrees per second, and are defined as follows:"An angle of 0 degrees is defined as pointing in the direction of the positive y-axis, increasing positively in the counter-clockwise direction and negatively in the clockwise direction. The positive x-axis is at -90 degrees."
Technically classes which implement this interface have no way to enforce where the 0 angle points, but it is expected that users will follow this rule.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
calibrateYaw(double yaw)
Offsets the yaw value such that the current yaw reading will be the given value.double
getYaw()
Gets the current yaw.double
getYawRate()
Gets the current yaw rate of change.
-
-
-
Method Detail
-
getYaw
double getYaw()
Gets the current yaw.- Returns:
- the current yaw, in degrees where positive angles are counterclockwise and angle 0 is at the positive Y axis
-
getYawRate
double getYawRate()
Gets the current yaw rate of change.- Returns:
- the current yaw rate, in degrees per second where positive angles are counterclockwise
-
calibrateYaw
void calibrateYaw(double yaw)
Offsets the yaw value such that the current yaw reading will be the given value.- Parameters:
yaw
- The yaw value to set
-
-