WPILibC++ 2024.3.2
frc::BuiltInAccelerometer Class Reference

Built-in accelerometer. More...

#include <frc/BuiltInAccelerometer.h>

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

Public Types

enum  Range { kRange_2G = 0 , kRange_4G = 1 , kRange_8G = 2 }
 Accelerometer range. More...
 

Public Member Functions

 BuiltInAccelerometer (Range range=kRange_8G)
 Constructor. More...
 
 BuiltInAccelerometer (BuiltInAccelerometer &&)=default
 
BuiltInAccelerometeroperator= (BuiltInAccelerometer &&)=default
 
void SetRange (Range range)
 Set the measuring range of the accelerometer. More...
 
double GetX ()
 
double GetY ()
 
double GetZ ()
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object. 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

- 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.

Member Enumeration Documentation

◆ Range

Accelerometer range.

Enumerator
kRange_2G 

2 Gs max.

kRange_4G 

4 Gs max.

kRange_8G 

8 Gs max.

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 ( )
Returns
The acceleration of the roboRIO along the X axis in g-forces

◆ GetY()

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

◆ GetZ()

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

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

Set the measuring range of the accelerometer.

Parameters
rangeThe maximum acceleration, positive or negative, that the accelerometer will measure.

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