WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
frc::BuiltInAccelerometer Class Reference

Built-in accelerometer. More...

#include <BuiltInAccelerometer.h>

Inheritance diagram for frc::BuiltInAccelerometer:
frc::Accelerometer frc::SensorBase frc::LiveWindowSendable frc::ErrorBase frc::Sendable

Public Member Functions

 BuiltInAccelerometer (Range range=kRange_8G)
 Constructor. More...
 
void SetRange (Range range) override
 Common interface for setting the measuring range of an accelerometer. More...
 
double GetX () override
 
double GetY () override
 
double GetZ () override
 
std::string GetSmartDashboardType () const override
 
void InitTable (std::shared_ptr< ITable > subtable) override
 Initializes a table for this sendable object. More...
 
void UpdateTable () override
 Update the table for this sendable object with the latest values.
 
std::shared_ptr< ITableGetTable () const override
 
void StartLiveWindowMode () override
 Start having this sendable object automatically respond to value changes reflect the value on the table.
 
void StopLiveWindowMode () override
 Stop having this sendable object automatically respond to value changes.
 
- Public Member Functions inherited from frc::SensorBase
 SensorBase (const SensorBase &)=delete
 
SensorBaseoperator= (const SensorBase &)=delete
 
- Public Member Functions inherited from frc::ErrorBase
 ErrorBase (const ErrorBase &)=delete
 
ErrorBaseoperator= (const ErrorBase &)=delete
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (llvm::StringRef errorMessage, Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Additional Inherited Members

- Public Types inherited from frc::Accelerometer
enum  Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 }
 
- Static Public Member Functions inherited from frc::SensorBase
static int GetDefaultSolenoidModule ()
 
static bool CheckSolenoidModule (int moduleNumber)
 Check that the solenoid module number is valid. More...
 
static bool CheckDigitalChannel (int channel)
 Check that the digital channel number is valid. More...
 
static bool CheckRelayChannel (int channel)
 Check that the relay channel number is valid. More...
 
static bool CheckPWMChannel (int channel)
 Check that the digital channel number is valid. More...
 
static bool CheckAnalogInputChannel (int channel)
 Check that the analog input number is value. More...
 
static bool CheckAnalogOutputChannel (int channel)
 Check that the analog output number is valid. More...
 
static bool CheckSolenoidChannel (int channel)
 Verify that the solenoid channel number is within limits. More...
 
static bool CheckPDPChannel (int channel)
 Verify that the power distribution channel number is within limits. More...
 
- Static Public Member Functions inherited from frc::ErrorBase
static void SetGlobalError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (llvm::StringRef errorMessage, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 
- Static Public Attributes inherited from frc::SensorBase
static const int kDigitalChannels = HAL_GetNumDigitalChannels()
 
static const int kAnalogInputs = HAL_GetNumAnalogInputs()
 
static const int kAnalogOutputs
 
static const int kSolenoidChannels = HAL_GetNumSolenoidChannels()
 
static const int kSolenoidModules = HAL_GetNumPCMModules()
 
static const int kPwmChannels = HAL_GetNumPWMChannels()
 
static const int kRelayChannels = HAL_GetNumRelayHeaders()
 
static const int kPDPChannels = HAL_GetNumPDPChannels()
 
- Protected Attributes inherited from frc::ErrorBase
Error m_error
 
- Static Protected Attributes inherited from frc::ErrorBase
static hal::priority_mutex _globalErrorMutex
 
static Error _globalError
 

Detailed Description

Built-in accelerometer.

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

Constructor & Destructor Documentation

BuiltInAccelerometer::BuiltInAccelerometer ( Range  range = kRange_8G)
explicit

Constructor.

Parameters
rangeThe range the accelerometer will measure

Member Function Documentation

std::string BuiltInAccelerometer::GetSmartDashboardType ( ) const
overridevirtual
Returns
the string representation of the named data type that will be used by the smart dashboard for this sendable

Implements frc::Sendable.

std::shared_ptr< ITable > BuiltInAccelerometer::GetTable ( ) const
overridevirtual
Returns
the table that is currently associated with the sendable

Implements frc::Sendable.

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

Implements frc::Accelerometer.

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

Implements frc::Accelerometer.

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

Implements frc::Accelerometer.

void BuiltInAccelerometer::InitTable ( std::shared_ptr< ITable subtable)
overridevirtual

Initializes a table for this sendable object.

Parameters
subtableThe table to put the values in.

Implements frc::Sendable.

void BuiltInAccelerometer::SetRange ( Range  range)
overridevirtual

Common interface for setting the measuring range of an 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 files: