LRT13  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
WinchPawl.h
1 #ifndef WINCH_PAWL_H_
2 #define WINCH_PAWL_H_
3 
4 #include <string>
5 
6 #include "../ComponentData/ComponentData.h"
7 #include "../ComponentData/WinchPawlData.h"
8 #include "../ComponentData/ClimberData.h"
9 #include "../SpeedController/AsyncCANJaguar.h"
10 #include "../Config/RobotConfig.h"
11 #include "../Config/DriverStationConfig.h"
12 #include "../Sensors/DriveEncoders.h"
13 #include "../Utils/AsyncPrinter.h"
14 #include "../Utils/Stopwatch.h"
15 #include "../Utils/SmarterDashboard.h"
16 #include "../Config/ConfigManager.h"
17 #include "../Config/Configurable.h"
18 #include "Component.h"
19 
20 using namespace data;
21 using namespace data::climber;
22 
23 class WinchPawl : public Component, Configurable
24 {
25 public:
26  WinchPawl();
27  ~WinchPawl();
28 
29  void enabledPeriodic();
30  void disabledPeriodic();
31 
32  void onEnable();
33  void onDisable();
34 
35  void Configure();
36 
37  float CurrentLimit(float dutyCycle, float speed);
38 
39 private:
40  Stopwatch m_stopWatch;
41 
42  AsyncCANJaguar m_jaguar;
43 
44  string m_configSection;
45 
46  ComponentData* m_componentData;
47  WinchPawlData* m_winchPawlData;
48 
49  DriveEncoders* m_driving_encoders;
50 
51  bool m_timedOut;
52 
53  float m_lastRequestedDutyCycle;
54 
55  double m_overCurrentThreshold;
56 
57  int m_overCurrentCounter;
58  int m_maxOverCurrentCounter;
59 
60  float m_forwardCurrentLimit;
61 
62  bool m_lastEnabled;
63  double m_timeout;
64 };
65 
66 #endif