10 #include <hal/SimDevice.h>
12 #include "frc/ErrorBase.h"
14 #include "frc/interfaces/Accelerometer.h"
15 #include "frc/smartdashboard/Sendable.h"
16 #include "frc/smartdashboard/SendableHelper.h"
20 class SendableBuilder;
32 enum Axes { kAxis_X = 0x00, kAxis_Y = 0x02, kAxis_Z = 0x04 };
45 explicit ADXL362(Range range = kRange_2G);
53 explicit ADXL362(SPI::Port port, Range range = kRange_2G);
62 double GetX()
override;
63 double GetY()
override;
64 double GetZ()
override;
86 hal::SimDevice m_simDevice;
87 hal::SimEnum m_simRange;
88 hal::SimDouble m_simX;
89 hal::SimDouble m_simY;
90 hal::SimDouble m_simZ;
91 double m_gsPerLSB = 0.001;
void SetRange(Range range) override
Common interface for setting the measuring range of an accelerometer.
ADXL362(Range range=kRange_2G)
Constructor.
double GetY() override
Common interface for getting the y axis acceleration.
double GetX() override
Common interface for getting the x axis acceleration.
Interface for 3-axis accelerometers.
Definition: Accelerometer.h:15
SPI bus interface class.
Definition: SPI.h:32
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
Base class for most objects.
Definition: ErrorBase.h:104
virtual AllAxes GetAccelerations()
Get the acceleration of all axes in Gs.
double GetZ() override
Common interface for getting the z axis acceleration.
Interface for Sendable objects.
Definition: Sendable.h:17
virtual double GetAcceleration(Axes axis)
Get the acceleration of one axis in Gs.
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
ADXL362 SPI Accelerometer.
Definition: ADXL362.h:27
A helper class for use with objects that add themselves to SendableRegistry.
Definition: SendableHelper.h:28
Definition: SendableBuilder.h:23