FRC Paradigm Shift #1259
Documentation for the 2021 Robot
Util.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <wpi\math>
4 #include "Constants.h"
5 
6 using namespace std;
7 
8 
9 class Util
10 {
11 public:
13  static double DegreesToRadians(double theta);
14 
16  static double RadiansToDegrees(double theta);
17 
21  static double ZeroTo2PiRads(double theta);
22 
26  static double ZeroTo360Degs(double theta);
27 
31  static double NegPiToPiRads(double theta);
32 
36  static double GetAverage(vector<double> numbers);
37 
39  static double Deadzone(double inputValue, double deadzone)
40  {
41  // If the input is small return 0
42  return abs(inputValue) <= deadzone ? 0 : inputValue;
43  }
44 };
STL namespace.
static double Deadzone(double inputValue, double deadzone)
If an inputValue is smaller than its deadzone, returns 0, otherwise returns the inputValue.
Definition: Util.h:39
Definition: Util.h:9