WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
frc::RomiGyro Class Reference

Use a rate gyro to return the robots heading relative to a starting position. More...

#include <frc/romi/RomiGyro.h>

Public Member Functions

 RomiGyro ()
 
units::radian_t GetAngle () const
 Return the actual angle in radians that the robot is currently facing.
 
units::radians_per_second_t GetRate () const
 Return the rate of rotation of the gyro.
 
units::radians_per_second_t GetRateX () const
 Get the rate of turn in around the X-axis.
 
units::radians_per_second_t GetRateY () const
 Get the rate of turn in around the Y-axis.
 
units::radians_per_second_t GetRateZ () const
 Get the rate of turn around the Z-axis.
 
units::radian_t GetAngleX () const
 Get the currently reported angle around the X-axis.
 
units::radian_t GetAngleY () const
 Get the currently reported angle around the Y-axis.
 
units::radian_t GetAngleZ () const
 Get the currently reported angle around the Z-axis.
 
void Reset ()
 Resets the gyro.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RomiGyro()

frc::RomiGyro::RomiGyro ( )

Member Function Documentation

◆ GetAngle()

units::radian_t frc::RomiGyro::GetAngle ( ) const

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()

units::radian_t frc::RomiGyro::GetAngleX ( ) const

Get the currently reported angle around the X-axis.

Returns
Current angle around X-axis.

◆ GetAngleY()

units::radian_t frc::RomiGyro::GetAngleY ( ) const

Get the currently reported angle around the Y-axis.

Returns
Current angle around Y-axis.

◆ GetAngleZ()

units::radian_t frc::RomiGyro::GetAngleZ ( ) const

Get the currently reported angle around the Z-axis.

Returns
Current angle around Z-axis.

◆ GetRate()

units::radians_per_second_t frc::RomiGyro::GetRate ( ) const

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()

units::radians_per_second_t frc::RomiGyro::GetRateX ( ) const

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

Returns
Rate of turn.

◆ GetRateY()

units::radians_per_second_t frc::RomiGyro::GetRateY ( ) const

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

Returns
Rate of turn.

◆ GetRateZ()

units::radians_per_second_t frc::RomiGyro::GetRateZ ( ) const

Get the rate of turn around the Z-axis.

Returns
Rate of turn.

◆ Reset()

void frc::RomiGyro::Reset ( )

Resets the gyro.


The documentation for this class was generated from the following file: