WPILibC++  2020.3.2-60-g3011ebe
BuiltInAccelerometer.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2014-2019 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include "frc/ErrorBase.h"
11 #include "frc/interfaces/Accelerometer.h"
12 #include "frc/smartdashboard/Sendable.h"
13 #include "frc/smartdashboard/SendableHelper.h"
14 
15 namespace frc {
16 
17 class SendableBuilder;
18 
25  public Accelerometer,
26  public Sendable,
27  public SendableHelper<BuiltInAccelerometer> {
28  public:
34  explicit BuiltInAccelerometer(Range range = kRange_8G);
35 
37  BuiltInAccelerometer& operator=(BuiltInAccelerometer&&) = default;
38 
39  // Accelerometer interface
47  void SetRange(Range range) override;
48 
52  double GetX() override;
53 
57  double GetY() override;
58 
62  double GetZ() override;
63 
64  void InitSendable(SendableBuilder& builder) override;
65 };
66 
67 } // namespace frc
frc::BuiltInAccelerometer::GetX
double GetX() override
frc::BuiltInAccelerometer
Built-in accelerometer.
Definition: BuiltInAccelerometer.h:24
frc::Accelerometer
Interface for 3-axis accelerometers.
Definition: Accelerometer.h:15
frc::BuiltInAccelerometer::InitSendable
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
frc::BuiltInAccelerometer::GetY
double GetY() override
frc::BuiltInAccelerometer::GetZ
double GetZ() override
frc::ErrorBase
Base class for most objects.
Definition: ErrorBase.h:104
frc::BuiltInAccelerometer::SetRange
void SetRange(Range range) override
Set the measuring range of the accelerometer.
frc::Sendable
Interface for Sendable objects.
Definition: Sendable.h:17
frc
A class that enforces constraints on the differential drive kinematics.
Definition: PDPSim.h:16
frc::BuiltInAccelerometer::BuiltInAccelerometer
BuiltInAccelerometer(Range range=kRange_8G)
Constructor.
frc::SendableHelper
A helper class for use with objects that add themselves to SendableRegistry.
Definition: SendableHelper.h:28
frc::SendableBuilder
Definition: SendableBuilder.h:23