Studica - C++ Documentation
TitanQuad.h
1 #pragma once
2 
3 #include <iostream>
4 #include <cstdint>
5 #include <frc/SpeedController.h>
6 
7 namespace studica {
8  class TitanQuad;
9  class TitanQuadEncoder;
10 }
11 
19 class studica::TitanQuad : public frc::SpeedController{
20 
21  private:
22  double speed;
23  long handle;
24  int motor;
25  bool isInverted = false;
26  bool stop;
27  int frequency = 15600;
28  friend class TitanQuadEncoder;
29 
30  public:
31 
40  TitanQuad(int deviceID, int frequency, int motor);
47  TitanQuad(int deviceID, int motor);
48 
52  ~TitanQuad();
53 
58  int GetID();
59 
64  int GetFrequency();
65 
70  std::string GetFirmwareVersion();
71 
76  std::string GetHardwareVersion();
77 
78  // /**
79  // * Configures the specified motor.
80  // * @param motor - The motor to configure.
81  // */
82  // void configureMotor(int motor);
83 
84  // /**
85  // * Disables the specified motor
86  // * @param motor motor to be disabled
87  // */
88  // void DisableMotor();
89 
95  double GetCurrent();
96 
101  double GetControllerTemp();
102 
103  /**** Speed Controller Interface ****/
104 
110  void Set(double speed) override;
111 
112  double Get() const override;
113 
114  void SetInverted(bool isInverted) override;
115 
116  bool GetInverted() const override;
117 
118  void Disable() override;
119 
120  void StopMotor() override;
121 
122  void PIDWrite(double output) override;
123 
124  // /**
125  // * Sets the speed of the specified motor.
126  // * @param motor - The motor to control.
127  // * @param speed - The speed to control the motor.
128  // */
129  // void SetMotorSpeed(int motor, double speed);
130 
135  void SetCurrentLimit();
136 
143  double GetLimitSwitch(bool direction);
144 
148  double GetRPM();
149 
155  int GetFaults();
156 
161  void ClearFaults();
162 
168  bool EnableSoftLimit();
169 
174  std::string GetSerialNumber();
175 };
studica::TitanQuad::GetCurrent
double GetCurrent()
studica::TitanQuad::ClearFaults
void ClearFaults()
studica::TitanQuad
TitanQuad class testing c++ documentation.
Definition: TitanQuad.h:19
studica::TitanQuad::GetSerialNumber
std::string GetSerialNumber()
studica::TitanQuad::GetFirmwareVersion
std::string GetFirmwareVersion()
studica::TitanQuad::~TitanQuad
~TitanQuad()
studica::TitanQuad::EnableSoftLimit
bool EnableSoftLimit()
studica::TitanQuad::TitanQuad
TitanQuad(int deviceID, int frequency, int motor)
studica::TitanQuad::GetControllerTemp
double GetControllerTemp()
studica::TitanQuad::GetFaults
int GetFaults()
studica::TitanQuad::GetLimitSwitch
double GetLimitSwitch(bool direction)
studica::TitanQuad::Set
void Set(double speed) override
studica::TitanQuadEncoder
TitanQuad Encoder class c++ documentation.
Definition: TitanQuadEncoder.h:12
studica::TitanQuad::SetCurrentLimit
void SetCurrentLimit()
studica::TitanQuad::GetID
int GetID()
studica::TitanQuad::GetRPM
double GetRPM()
studica::TitanQuad::GetFrequency
int GetFrequency()
studica::TitanQuad::GetHardwareVersion
std::string GetHardwareVersion()