FRC Paradigm Shift #1259
Documentation for the 2021 Robot
Gyro.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <units/angle.h>
4 #include <frc/geometry/Rotation2d.h>
5 #include "ctre/phoenix/sensors/PigeonIMU.h"
6 
7 #include "Constants.h"
8 
9 using namespace DriveConstants;
10 using namespace units;
11 using namespace ctre::phoenix::sensors;
12 
13 
14 class Gyro
15 {
16 public:
17  Gyro();
18 
21  double GetHeading();
22  frc::Rotation2d GetHeadingAsRot2d() { return frc::Rotation2d(degree_t(GetHeading())); }
23 
25  void ZeroHeading();
26 
29  double GetTurnRate();
30 
31  PigeonIMU m_gyro;
32 };
frc::Rotation2d GetHeadingAsRot2d()
Definition: Gyro.h:22
PigeonIMU m_gyro
Definition: Gyro.h:31
Definition: Gyro.h:14