WPILibC++  2020.3.2-60-g3011ebe
Gyro.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2014-2018 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 namespace frc {
11 
15 class Gyro {
16  public:
17  Gyro() = default;
18  virtual ~Gyro() = default;
19 
20  Gyro(Gyro&&) = default;
21  Gyro& operator=(Gyro&&) = default;
22 
31  virtual void Calibrate() = 0;
32 
38  virtual void Reset() = 0;
39 
56  virtual double GetAngle() const = 0;
57 
69  virtual double GetRate() const = 0;
70 };
71 
72 } // namespace frc
frc::Gyro
Interface for yaw rate gyros.
Definition: Gyro.h:15
frc::Gyro::GetAngle
virtual double GetAngle() const =0
Return the actual angle in degrees that the robot is currently facing.
frc::Gyro::Calibrate
virtual void Calibrate()=0
Calibrate the gyro by running for a number of samples and computing the center value.
frc::Gyro::GetRate
virtual double GetRate() const =0
Return the rate of rotation of the gyro.
frc
A class that enforces constraints on the differential drive kinematics.
Definition: PDPSim.h:16
frc::Gyro::Reset
virtual void Reset()=0
Reset the gyro.