WPILibC++  2018.4.1-20180729124724-1140-gcbb62fb
 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  virtual ~Gyro() = default;
18 
27  virtual void Calibrate() = 0;
28 
34  virtual void Reset() = 0;
35 
52  virtual double GetAngle() const = 0;
53 
65  virtual double GetRate() const = 0;
66 };
67 
68 } // namespace frc
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.