WPILibC++ 2025.1.1
|
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. | |
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.
frc::RomiGyro::RomiGyro | ( | ) |
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.
units::radian_t frc::RomiGyro::GetAngleX | ( | ) | const |
Get the currently reported angle around the X-axis.
units::radian_t frc::RomiGyro::GetAngleY | ( | ) | const |
Get the currently reported angle around the Y-axis.
units::radian_t frc::RomiGyro::GetAngleZ | ( | ) | const |
Get the currently reported angle around the Z-axis.
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.
units::radians_per_second_t frc::RomiGyro::GetRateX | ( | ) | const |
Get the rate of turn in around the X-axis.
units::radians_per_second_t frc::RomiGyro::GetRateY | ( | ) | const |
Get the rate of turn in around the Y-axis.
units::radians_per_second_t frc::RomiGyro::GetRateZ | ( | ) | const |
Get the rate of turn around the Z-axis.
void frc::RomiGyro::Reset | ( | ) |
Resets the gyro.