1 #ifndef PROXIED_CAN_JAGUAR_H_
2 #define PROXIED_CAN_JAGUAR_H_
6 #include <WPILib/CANJaguar.h>
9 #include "../ComponentData/RobotData.h"
11 #include "../Process/SynchronizedProcess.h"
13 #include "../Utils/Util.h"
14 #include "../Utils/PrintInConstructor.h"
15 #include "../Utils/CachedValue.h"
17 #include "../Log/Loggable.h"
19 #include "LRTSpeedController.h"
35 const static uint32_t SPEEDREF = (1 << 0);
36 const static uint32_t POSREF = (1 << 1);
37 const static uint32_t
PID = (1 << 2);
38 const static uint32_t CTRLMODE = (1 << 3);
39 const static uint32_t BUSVOLT = (1 << 4);
40 const static uint32_t OUTVOLT = (1 << 5);
41 const static uint32_t OUTCURR = (1 << 6);
42 const static uint32_t TEMP = (1 << 7);
43 const static uint32_t POS = (1 << 8);
44 const static uint32_t SPEED = (1 << 9);
45 const static uint32_t FWDLIMOK = (1 << 10);
46 const static uint32_t REVLIMOK = (1 << 11);
47 const static uint32_t PWRCYCLE = (1 << 12);
48 const static uint32_t EXPIRE = (1 << 13);
52 PrintInConstructor m_print_ctor_dtor;
67 bool m_should_disable_control;
78 volatile bool m_should_disable_position_limits;
80 volatile uint32_t m_collection_flags;
81 volatile float m_output_voltage;
82 volatile float m_output_current;
83 volatile float m_position;
84 volatile float m_p, m_i, m_d;
85 volatile SpeedReference m_speed_ref;
86 volatile PositionReference m_position_ref;
87 volatile ControlMode m_ctrl_mode;
88 volatile float m_bus_voltage;
89 volatile float m_temperature;
90 volatile float m_speed;
91 volatile bool m_fwd_limit_ok;
92 volatile bool m_rev_limit_ok;
93 volatile bool m_pwr_cyc;
94 volatile float m_expire;
96 static data::RobotData::RobotState m_game_state;
97 data::RobotData::RobotState m_last_game_state;
101 void println(
const char * str);
146 virtual char* GetName();
154 void Set(
float setpoint, UINT8 syncGroup = 0);
163 void SetPID(
double p,
double i,
double d);
213 double reverseLimitPosition);
309 return m_position_ref;
327 return m_bus_voltage;
336 return m_output_voltage;
345 return m_output_current;
354 return m_temperature;
381 return m_fwd_limit_ok;
390 return m_rev_limit_ok;
421 static void SetGameState(data::RobotData::RobotState state);