WPILibC++ 2023.4.3-108-ge5452e3
frc::BuiltInAccelerometer Class Reference

Built-in accelerometer. More...

#include <frc/BuiltInAccelerometer.h>

Inheritance diagram for frc::BuiltInAccelerometer:
frc::Accelerometer wpi::Sendable wpi::SendableHelper< BuiltInAccelerometer >

Public Member Functions

 BuiltInAccelerometer (Range range=kRange_8G)
 Constructor. More...
 
 BuiltInAccelerometer (BuiltInAccelerometer &&)=default
 
BuiltInAccelerometeroperator= (BuiltInAccelerometer &&)=default
 
void SetRange (Range range) final
 Set the measuring range of the accelerometer. More...
 
double GetX () override
 
double GetY () override
 
double GetZ () override
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from frc::Accelerometer
 Accelerometer ()=default
 
virtual ~Accelerometer ()=default
 
 Accelerometer (Accelerometer &&)=default
 
Accelerometeroperator= (Accelerometer &&)=default
 
virtual void SetRange (Range range)=0
 Common interface for setting the measuring range of an accelerometer. More...
 
virtual double GetX ()=0
 Common interface for getting the x axis acceleration. More...
 
virtual double GetY ()=0
 Common interface for getting the y axis acceleration. More...
 
virtual double GetZ ()=0
 Common interface for getting the z axis acceleration. More...
 
- Public Member Functions inherited from wpi::Sendable
virtual ~Sendable ()=default
 
virtual void InitSendable (SendableBuilder &builder)=0
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::SendableHelper< BuiltInAccelerometer >
 SendableHelper (const SendableHelper &rhs)=default
 
 SendableHelper (SendableHelper &&rhs)
 
SendableHelperoperator= (const SendableHelper &rhs)=default
 
SendableHelperoperator= (SendableHelper &&rhs)
 

Additional Inherited Members

- Public Types inherited from frc::Accelerometer
enum  Range { kRange_2G = 0 , kRange_4G = 1 , kRange_8G = 2 , kRange_16G = 3 }
 
- Protected Member Functions inherited from wpi::SendableHelper< BuiltInAccelerometer >
 SendableHelper ()=default
 
 ~SendableHelper ()
 

Detailed Description

Built-in accelerometer.

This class allows access to the roboRIO's internal accelerometer.

Constructor & Destructor Documentation

◆ BuiltInAccelerometer() [1/2]

frc::BuiltInAccelerometer::BuiltInAccelerometer ( Range  range = kRange_8G)
explicit

Constructor.

Parameters
rangeThe range the accelerometer will measure

◆ BuiltInAccelerometer() [2/2]

frc::BuiltInAccelerometer::BuiltInAccelerometer ( BuiltInAccelerometer &&  )
default

Member Function Documentation

◆ GetX()

double frc::BuiltInAccelerometer::GetX ( )
overridevirtual
Returns
The acceleration of the roboRIO along the X axis in g-forces

Implements frc::Accelerometer.

◆ GetY()

double frc::BuiltInAccelerometer::GetY ( )
overridevirtual
Returns
The acceleration of the roboRIO along the Y axis in g-forces

Implements frc::Accelerometer.

◆ GetZ()

double frc::BuiltInAccelerometer::GetZ ( )
overridevirtual
Returns
The acceleration of the roboRIO along the Z axis in g-forces

Implements frc::Accelerometer.

◆ InitSendable()

void frc::BuiltInAccelerometer::InitSendable ( wpi::SendableBuilder builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::Sendable.

◆ operator=()

BuiltInAccelerometer & frc::BuiltInAccelerometer::operator= ( BuiltInAccelerometer &&  )
default

◆ SetRange()

void frc::BuiltInAccelerometer::SetRange ( Range  range)
finalvirtual

Set the measuring range of the accelerometer.

Parameters
rangeThe maximum acceleration, positive or negative, that the accelerometer will measure. Not all accelerometers support all ranges.

Implements frc::Accelerometer.


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