File tree 4 files changed +46
-1
lines changed
4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ DriveSandstormStepWithHatch* Robot::m_DriveSandstormStepWithHatch;
43
43
// Initialize JSON reader
44
44
wpi::json Robot::m_JsonConfig;
45
45
46
+ // NavX
47
+ AHRS Robot::m_AHRS{kNavxPin };
48
+
46
49
Robot::Robot () {
47
50
// get the json config deployed onto the roborio
48
51
std::ifstream jsonStream (CONFIGPATH);
@@ -124,6 +127,8 @@ void Robot::RobotPeriodic() {
124
127
}
125
128
m_UsingCamera1 = !m_UsingCamera1;
126
129
}
130
+
131
+ std::cout << " Pitch: " << m_AHRS.GetPitch () << " \t Roll: " << m_AHRS.GetRoll () << " \t Yaw: " << m_AHRS.GetYaw () << std::endl;
127
132
}
128
133
129
134
void Robot::DisabledInit () {
Original file line number Diff line number Diff line change 43
43
#include " OI.h"
44
44
#include " RobotMap.h"
45
45
46
+ // NavX
47
+ #include " AHRS.h"
48
+
46
49
class Robot : public frc ::TimedRobot {
47
50
public:
48
51
// Operator Interface
49
- static OI m_OI;
52
+ static OI m_OI;
50
53
51
54
// Subsystems
52
55
static DriveTrain* m_DriveTrain;
@@ -80,6 +83,9 @@ class Robot : public frc::TimedRobot {
80
83
81
84
// JSON Reader for Config (this should probably be moved later)
82
85
static wpi::json m_JsonConfig;
86
+
87
+ // NavX
88
+ static AHRS m_AHRS;
83
89
84
90
Robot ();
85
91
void RobotInit () override ;
Original file line number Diff line number Diff line change 150
150
// Cargo hatch cheesecake
151
151
# define kCargoHatchCheesecakeMotor PWM_3
152
152
153
+ # define kNavxPin I2C::Port::kMXP
153
154
#endif
Original file line number Diff line number Diff line change
1
+ {
2
+ "fileName" : " navx_frc.json" ,
3
+ "name" : " KauaiLabs_navX_FRC" ,
4
+ "version" : " 3.1.366" ,
5
+ "uuid" : " cb311d09-36e9-4143-a032-55bb2b94443b" ,
6
+ "mavenUrls" : [
7
+ " https://repo1.maven.org/maven2/"
8
+ ],
9
+ "jsonUrl" : " https://www.kauailabs.com/dist/frc/2019/navx_frc.json" ,
10
+ "javaDependencies" : [
11
+ {
12
+ "groupId" : " com.kauailabs.navx.frc" ,
13
+ "artifactId" : " navx-java" ,
14
+ "version" : " 3.1.366"
15
+ }
16
+ ],
17
+ "jniDependencies" : [],
18
+ "cppDependencies" : [
19
+ {
20
+ "groupId" : " com.kauailabs.navx.frc" ,
21
+ "artifactId" : " navx-cpp" ,
22
+ "version" : " 3.1.366" ,
23
+ "headerClassifier" : " headers" ,
24
+ "sourcesClassifier" : " sources" ,
25
+ "sharedLibrary" : false ,
26
+ "libName" : " navx_frc" ,
27
+ "skipInvalidPlatforms" : true ,
28
+ "binaryPlatforms" : [
29
+ " linuxathena"
30
+ ]
31
+ }
32
+ ]
33
+ }
You can’t perform that action at this time.
0 commit comments