RomiGyro

class romi.RomiGyro

Bases: pybind11_object

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.

getAngle() wpimath.units.radians

Return the actual angle in radians 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 2π->3π radians. This allows algorithms that wouldn’t want to see a discontinuity in the gyro output as it sweeps from 2π to 0 on the second time around.

Returns:

The current heading of the robot.

getAngleX() wpimath.units.radians

Get the currently reported angle around the X-axis.

Returns:

Current angle around X-axis.

getAngleY() wpimath.units.radians

Get the currently reported angle around the Y-axis.

Returns:

Current angle around Y-axis.

getAngleZ() wpimath.units.radians

Get the currently reported angle around the Z-axis.

Returns:

Current angle around Z-axis.

getRate() wpimath.units.radians_per_second

Return the rate of rotation of the gyro

The rate is based on the most recent reading of the gyro.

Returns:

The current rate.

getRateX() wpimath.units.radians_per_second

Get the rate of turn in around the X-axis.

Returns:

Rate of turn.

getRateY() wpimath.units.radians_per_second

Get the rate of turn in around the Y-axis.

Returns:

Rate of turn.

getRateZ() wpimath.units.radians_per_second

Get the rate of turn around the Z-axis.

Returns:

Rate of turn.

reset() None

Resets the gyro