RomiGyro¶
- class romi.RomiGyro¶
Bases:
wpilib.interfaces._interfaces.Gyro
Use a rate gyro to return the robots heading relative to a starting position.
This class is for the Romi onboard gyro, and will only work in simulation/Romi mode. Only one instance of a RomiGyro is supported.
- calibrate() None ¶
Initialize the gyro.
NOTE: This function is a no-op. The Romi gyro should be calibrated via the web UI.
- getAngle() float ¶
Return the actual angle in degrees that the robot is currently facing.
The angle is based on integration of the returned rate form the gyro. The angle is continuous, that is, it will continue from 360->361 degrees. This allows algorithms that wouldn’t want to see a discontinuity in the gyro output as it sweeps from 360 to 0 on the second time around.
- Returns
the current heading of the robot in degrees.
- getAngleX() float ¶
Gets the currently reported angle around the X-axis
- getAngleY() float ¶
Gets the currently reported angle around the X-axis
- getAngleZ() float ¶
Gets the currently reported angle around the X-axis
- getRate() float ¶
Return the rate of rotation of the gyro
The rate is based on the most recent reading of the gyro.
- Returns
the current rate in degrees per second
- getRateX() float ¶
Gets the rate of turn in degrees-per-second around the X-axis
- getRateY() float ¶
Gets the rate of turn in degrees-per-second around the Y-axis
- getRateZ() float ¶
Gets the rate of turn in degrees-per-second around the Z-axis
- reset() None ¶
Resets the gyro