Class to control a simulated built-in accelerometer.
More...
#include <frc/simulation/BuiltInAccelerometerSim.h>
Class to control a simulated built-in accelerometer.
◆ BuiltInAccelerometerSim() [1/2]
frc::sim::BuiltInAccelerometerSim::BuiltInAccelerometerSim |
( |
| ) |
|
Constructs for the first built-in accelerometer.
◆ BuiltInAccelerometerSim() [2/2]
◆ GetActive()
bool frc::sim::BuiltInAccelerometerSim::GetActive |
( |
| ) |
const |
Check whether the accelerometer is active.
- Returns
- true if active
◆ GetRange()
Check the range of this accelerometer.
- Returns
- the accelerometer range
◆ GetX()
double frc::sim::BuiltInAccelerometerSim::GetX |
( |
| ) |
const |
Measure the X axis value.
- Returns
- the X axis measurement
◆ GetY()
double frc::sim::BuiltInAccelerometerSim::GetY |
( |
| ) |
const |
Measure the Y axis value.
- Returns
- the Y axis measurement
◆ GetZ()
double frc::sim::BuiltInAccelerometerSim::GetZ |
( |
| ) |
const |
Measure the Z axis value.
- Returns
- the Z axis measurement
◆ RegisterActiveCallback()
std::unique_ptr< CallbackStore > frc::sim::BuiltInAccelerometerSim::RegisterActiveCallback |
( |
NotifyCallback |
callback, |
|
|
bool |
initialNotify |
|
) |
| |
Register a callback to be run when this accelerometer activates.
- Parameters
-
callback | the callback |
initialNotify | whether to run the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterRangeCallback()
std::unique_ptr< CallbackStore > frc::sim::BuiltInAccelerometerSim::RegisterRangeCallback |
( |
NotifyCallback |
callback, |
|
|
bool |
initialNotify |
|
) |
| |
Register a callback to be run whenever the range changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterXCallback()
Register a callback to be run whenever the X axis value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterYCallback()
Register a callback to be run whenever the Y axis value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ RegisterZCallback()
Register a callback to be run whenever the Z axis value changes.
- Parameters
-
callback | the callback |
initialNotify | whether to call the callback with the initial state |
- Returns
- the CallbackStore object associated with this callback
◆ ResetData()
void frc::sim::BuiltInAccelerometerSim::ResetData |
( |
| ) |
|
Reset all simulation data of this object.
◆ SetActive()
void frc::sim::BuiltInAccelerometerSim::SetActive |
( |
bool |
active | ) |
|
Define whether this accelerometer is active.
- Parameters
-
◆ SetRange()
Change the range of this accelerometer.
- Parameters
-
range | the new accelerometer range |
◆ SetX()
void frc::sim::BuiltInAccelerometerSim::SetX |
( |
double |
x | ) |
|
Change the X axis value of the accelerometer.
- Parameters
-
x | the new reading of the X axis |
◆ SetY()
void frc::sim::BuiltInAccelerometerSim::SetY |
( |
double |
y | ) |
|
Change the Y axis value of the accelerometer.
- Parameters
-
y | the new reading of the Y axis |
◆ SetZ()
void frc::sim::BuiltInAccelerometerSim::SetZ |
( |
double |
z | ) |
|
Change the Z axis value of the accelerometer.
- Parameters
-
z | the new reading of the Z axis |
The documentation for this class was generated from the following file: