Skip to content

Commit ab87048

Browse files
Prep for using competition robot.
* Add comment for wheel encoder pin clarification. * Add PDP variable (for Shuffleboard use). * Change CAN Bus IDs to ones that the TalonSRX's are set up with. * Change team number to use PhyxtGear's real team number rather than the testing number. * Disable gyro. ** It's unused and is causing error messages on the Compbot (Competition Robot) because it has no ADXRS450 gyro. STATUS: Compiles and deploys on both Protobot and Compbot. NOTES: Make sure that any RoboRIO this code is deployed to has the CTR-E Phoenix Library/Diagnostic tools installed, and that VS Code has the CTR-E Phoenix vendor library installed. - Logan H-D
1 parent 4dee736 commit ab87048

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

.wpilib/wpilib_preferences.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"enableCppIntellisense": true,
33
"currentLanguage": "cpp",
44
"projectYear": "2019",
5-
"teamNumber": 1721
5+
"teamNumber": 1720
66
}

src/main/include/Robot.h

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <frc/TimedRobot.h>
1111
#include <frc/commands/Command.h>
1212
#include <frc/smartdashboard/SendableChooser.h>
13+
#include <frc/PowerDistributionPanel.h>
1314

1415
// Subsystems
1516
#include "subsystems/DriveTrain.h"
@@ -35,4 +36,6 @@ class Robot : public frc::TimedRobot {
3536

3637
private:
3738
frc::SendableChooser<frc::Command*> m_chooser;
39+
frc::PowerDistributionPanel m_pdp{0};
40+
3841
};

src/main/include/RobotMap.h

+17-14
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
// Only define this macro if you're testing on the 1721 bot.
19-
#define PROTOBOT
19+
//#define PROTOBOT
2020

2121

2222
// Motor controller pins
@@ -27,19 +27,22 @@
2727
# define kLeftFrontMotor 2
2828
# define kLeftBackMotor 3
2929

30-
# define kRightEncoderPin0 0
31-
# define kRightEncoderPin1 1
32-
# define kLeftEncoderPin0 2
33-
# define kLeftEncoderPin1 3
30+
// pin numbers for wheel encoders
31+
// protobot didn't have encoders
32+
# define kLeftEncoderPin0 0
33+
# define kLeftEncoderPin1 1
34+
# define kRightEncoderPin0 2
35+
# define kRightEncoderPin1 3
3436
#else
3537
// CAN ID numbers for CAN Bus TalonSRXs
36-
# define kRightFrontMotor 0
37-
# define kRightBackMotor 1
38-
# define kLeftFrontMotor 2
39-
# define kLeftBackMotor 3
40-
41-
# define kRightEncoderPin0 0
42-
# define kRightEncoderPin1 1
43-
# define kLeftEncoderPin0 2
44-
# define kLeftEncoderPin1 3
38+
# define kLeftFrontMotor 1
39+
# define kLeftBackMotor 7
40+
# define kRightFrontMotor 2
41+
# define kRightBackMotor 4
42+
43+
// pin numbers for wheel encoders
44+
# define kLeftEncoderPin0 0
45+
# define kLeftEncoderPin1 1
46+
# define kRightEncoderPin0 2
47+
# define kRightEncoderPin1 3
4548
#endif

src/main/include/subsystems/DriveTrain.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ class DriveTrain : public frc::Subsystem {
5151
// Encoders (reverse the right encoder)
5252
frc::Encoder m_encoderRight {kRightEncoderPin0, kRightEncoderPin1, true};
5353
frc::Encoder m_encoderLeft {kLeftEncoderPin0, kLeftEncoderPin1, false};
54-
frc::ADXRS450_Gyro m_gyro {}; // onboard RoboRIO gyro
54+
//frc::ADXRS450_Gyro m_gyro {}; // onboard RoboRIO gyro
5555
};

0 commit comments

Comments
 (0)