WPILibC++ 2024.3.2
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 /**
24 * Accelerometer range.
25 */
26 enum Range {
27 /**
28 * 2 Gs max.
29 */
30 kRange_2G = 0,
31 /**
32 * 4 Gs max.
33 */
34 kRange_4G = 1,
35 /**
36 * 8 Gs max.
37 */
38 kRange_8G = 2,
39 /**
40 * 16 Gs max.
41 */
42 kRange_16G = 3
43 };
44
45 /**
46 * Common interface for setting the measuring range of an accelerometer.
47 *
48 * @param range The maximum acceleration, positive or negative, that the
49 * accelerometer will measure. Not all accelerometers support all
50 * ranges.
51 */
52 virtual void SetRange(Range range) = 0;
53
54 /**
55 * Common interface for getting the x axis acceleration.
56 *
57 * @return The acceleration along the x axis in g-forces
58 */
59 virtual double GetX() = 0;
60
61 /**
62 * Common interface for getting the y axis acceleration.
63 *
64 * @return The acceleration along the y axis in g-forces
65 */
66 virtual double GetY() = 0;
67
68 /**
69 * Common interface for getting the z axis acceleration.
70 *
71 * @return The acceleration along the z axis in g-forces
72 */
73 virtual double GetZ() = 0;
74};
75
76} // 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
Accelerometer range.
Definition: Accelerometer.h:26
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