WPILibC++ 2023.4.3-108-ge5452e3
frc::sim::AnalogGyroSim Class Reference

Class to control a simulated analog gyro. More...

#include <frc/simulation/AnalogGyroSim.h>

Public Member Functions

 AnalogGyroSim (const AnalogGyro &gyro)
 Constructs from an AnalogGyro object. More...
 
 AnalogGyroSim (int channel)
 Constructs from an analog input channel number. More...
 
std::unique_ptr< CallbackStoreRegisterAngleCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the angle. More...
 
double GetAngle () const
 Get the current angle of the gyro. More...
 
void SetAngle (double angle)
 Change the angle measured by the gyro. More...
 
std::unique_ptr< CallbackStoreRegisterRateCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the rate. More...
 
double GetRate () const
 Get the rate of angle change on this gyro. More...
 
void SetRate (double rate)
 Change the rate of the gyro. More...
 
std::unique_ptr< CallbackStoreRegisterInitializedCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on whether the gyro is initialized. More...
 
bool GetInitialized () const
 Check if the gyro is initialized. More...
 
void SetInitialized (bool initialized)
 Set whether this gyro is initialized. More...
 
void ResetData ()
 Reset all simulation data for this object. More...
 

Detailed Description

Class to control a simulated analog gyro.

Constructor & Destructor Documentation

◆ AnalogGyroSim() [1/2]

frc::sim::AnalogGyroSim::AnalogGyroSim ( const AnalogGyro gyro)
explicit

Constructs from an AnalogGyro object.

Parameters
gyroAnalogGyro to simulate

◆ AnalogGyroSim() [2/2]

frc::sim::AnalogGyroSim::AnalogGyroSim ( int  channel)
explicit

Constructs from an analog input channel number.

Parameters
channelChannel number

Member Function Documentation

◆ GetAngle()

double frc::sim::AnalogGyroSim::GetAngle ( ) const

Get the current angle of the gyro.

Returns
the angle measured by the gyro

◆ GetInitialized()

bool frc::sim::AnalogGyroSim::GetInitialized ( ) const

Check if the gyro is initialized.

Returns
true if initialized

◆ GetRate()

double frc::sim::AnalogGyroSim::GetRate ( ) const

Get the rate of angle change on this gyro.

Returns
the rate

◆ RegisterAngleCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogGyroSim::RegisterAngleCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the angle.

Parameters
callbackthe callback that will be called whenever the angle changes
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterInitializedCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogGyroSim::RegisterInitializedCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on whether the gyro is initialized.

Parameters
callbackthe callback that will be called whenever the gyro is initialized
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterRateCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogGyroSim::RegisterRateCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback on the rate.

Parameters
callbackthe callback that will be called whenever the rate changes
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ ResetData()

void frc::sim::AnalogGyroSim::ResetData ( )

Reset all simulation data for this object.

◆ SetAngle()

void frc::sim::AnalogGyroSim::SetAngle ( double  angle)

Change the angle measured by the gyro.

Parameters
anglethe new value

◆ SetInitialized()

void frc::sim::AnalogGyroSim::SetInitialized ( bool  initialized)

Set whether this gyro is initialized.

Parameters
initializedthe new value

◆ SetRate()

void frc::sim::AnalogGyroSim::SetRate ( double  rate)

Change the rate of the gyro.

Parameters
ratethe new rate

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