WPILibC++  2019.1.1-beta-2-23-g90572a3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
virtual double GetAngle() const =0
Return the actual angle in degrees that the robot is currently facing.
virtual void Calibrate()=0
Calibrate the gyro by running for a number of samples and computing the center value.
virtual double GetRate() const =0
Return the rate of rotation of the gyro.
Interface for yaw rate gyros.
Definition: Gyro.h:15
virtual void Reset()=0
Reset the gyro.