WPILibC++ 2024.1.1-beta-4
Accelerometer.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7namespace frc {
8
9/**
10 * Interface for 3-axis accelerometers.
11 *
12 * @deprecated This interface is being removed with no replacement.
13 */
14class [[deprecated(
15 "This interface is being removed with no replacement.")]] Accelerometer {
16 public:
17 Accelerometer() = default;
18 virtual ~Accelerometer() = default;
19
22
23 enum Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 };
24
25 /**
26 * Common interface for setting the measuring range of an accelerometer.
27 *
28 * @param range The maximum acceleration, positive or negative, that the
29 * accelerometer will measure. Not all accelerometers support all
30 * ranges.
31 */
32 virtual void SetRange(Range range) = 0;
33
34 /**
35 * Common interface for getting the x axis acceleration.
36 *
37 * @return The acceleration along the x axis in g-forces
38 */
39 virtual double GetX() = 0;
40
41 /**
42 * Common interface for getting the y axis acceleration.
43 *
44 * @return The acceleration along the y axis in g-forces
45 */
46 virtual double GetY() = 0;
47
48 /**
49 * Common interface for getting the z axis acceleration.
50 *
51 * @return The acceleration along the z axis in g-forces
52 */
53 virtual double GetZ() = 0;
54};
55
56} // namespace frc
Interface for 3-axis accelerometers.
Definition: Accelerometer.h:15
virtual double GetZ()=0
Common interface for getting the z axis acceleration.
Accelerometer(Accelerometer &&)=default
virtual void SetRange(Range range)=0
Common interface for setting the measuring range of an accelerometer.
Accelerometer()=default
Range
Definition: Accelerometer.h:23
virtual double GetX()=0
Common interface for getting the x axis acceleration.
virtual double GetY()=0
Common interface for getting the y axis acceleration.
Accelerometer & operator=(Accelerometer &&)=default
virtual ~Accelerometer()=default
Definition: AprilTagPoseEstimator.h:15