Skip to content

Commit ab20635

Browse files
authored
Merge pull request #68 from PhyXTGears-programming/release/v1.0.3
Release/v1.0.3
2 parents 894f567 + 977ce12 commit ab20635

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

src/main/cpp/Robot.cpp

+33-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ RotateHatchForDispenser* Robot::m_RotateHatchForDispenser;
2525

2626
ShootCargoForCargoShip* Robot::m_ShootCargoForCargoShip;
2727
ShootCargoForLevelOneRocket* Robot::m_ShootCargoForLevelOneRocket;
28+
ShootCargoForLevelTwoRocket* Robot::m_ShootCargoForLevelTwoRocket;
2829

2930
StopCargoRoller* Robot::m_StopCargoRoller;
3031
TakeCargo* Robot::m_TakeCargo;
@@ -78,6 +79,7 @@ Robot::Robot() {
7879

7980
m_ShootCargoForCargoShip = new ShootCargoForCargoShip();
8081
m_ShootCargoForLevelOneRocket = new ShootCargoForLevelOneRocket();
82+
m_ShootCargoForLevelTwoRocket = new ShootCargoForLevelTwoRocket();
8183

8284
m_StopCargoRoller = new StopCargoRoller();
8385
m_TakeCargo = new TakeCargo();
@@ -111,7 +113,10 @@ void Robot::RobotPeriodic() {
111113
frc::SmartDashboard::PutBoolean("climb done", GetCreeperClimb().IsArmAtPosition("arm-climb"));
112114
frc::Scheduler::GetInstance()->Run();
113115

114-
if (m_OI.GetDriverJoystick().GetBumperPressed(frc::XboxController::kRightHand)) {
116+
bool bumperPressed = m_OI.GetDriverJoystick().GetBumperPressed(frc::XboxController::kRightHand);
117+
bool flightstickPressed = m_OI.GetOperatorConsole().GetFlightStickPressed(11);
118+
119+
if (bumperPressed || flightstickPressed) {
115120
if (m_UsingCamera1) {
116121
frc::CameraServer::GetInstance()->GetServer().SetSource(m_Camera0);
117122
} else {
@@ -170,6 +175,7 @@ void Robot::TestPeriodic() {}
170175
void Robot::CompetitionJoystickInput() {
171176
// DRIVER CONTROLS
172177
if (m_OI.GetDriverJoystick().GetBButton() && m_CanSandstormStepDrive) {
178+
std::cout << "Comp Joy Input: Driver: B Button Down" << std::endl;
173179
m_DriveSandstormStepWithCargo->Start();
174180
m_CanSandstormStepDrive = false;
175181
}
@@ -178,25 +184,34 @@ void Robot::CompetitionJoystickInput() {
178184
OperatorHID& console = m_OI.GetOperatorConsole();
179185
// Change rotation of cargo intake
180186
if (console.GetFloorHatchPickupPressed()) {
187+
std::cout << "Comp Joy Input: Console: Floor Hatch Pickup Pressed" << std::endl;
181188
m_RotateHatchForFloor->Start();
182189
} else if (console.GetFloorCargoPickupPressed()) {
190+
std::cout << "Comp Joy Input: Console: Floor Cargo Pickup Pressed" << std::endl;
183191
m_TakeCargoFromFloor->Start();
184192
} else if (console.GetHatchFeederScorePressed()) {
193+
std::cout << "Comp Joy Input: Console: Hatch Feeder Score Pressed" << std::endl;
185194
m_RotateHatchForDispenser->Start();
186195
} else if (console.GetRocketShotPressed()) {
196+
std::cout << "Comp Joy Input: Console: Rocket Shot Pressed" << std::endl;
187197
m_RotateCargoForLevelOneRocket->Start();
188198
} else if (m_OI.GetOperatorConsole().GetCargoShotPressed()) {
199+
std::cout << "Comp Joy Input: Console: Cargo Shot Pressed" << std::endl;
189200
m_RotateCargoForCargoShip->Start();
190201
} else if (console.GetGoHomePressed()) {
202+
std::cout << "Comp Joy Input: Console: Stowed Pressed" << std::endl;
191203
GetCargoIntake().GoHome(); // CHANGE TO COMMAND
192204
}
193205

194206
// action command buttons, stuff happens
195207
if (console.GetCargoCloseShotPressed()) {
208+
std::cout << "Comp Joy Input: Console: Cargo Close Shot Pressed" << std::endl;
196209
m_ShootCargoForLevelOneRocket->Start();
197210
} else if (console.GetCargoHighShotPressed()) {
211+
std::cout << "Comp Joy Input: Console: Cargo High Shot Pressed" << std::endl;
198212
m_ShootCargoForCargoShip->Start();
199213
} else if (console.GetCargoIntakePressed()) {
214+
std::cout << "Comp Joy Input: Console: Cargo Intake Pressed" << std::endl;
200215
if (GetCargoIntake().IsRollerRunning()) {
201216
m_StopCargoRoller->Start();
202217
} else {
@@ -205,38 +220,55 @@ void Robot::CompetitionJoystickInput() {
205220
}
206221

207222
if (console.IsHatchReleaseDown() && console.IsHatchGrabDown()) {
223+
std::cout << "Comp Joy Input: Console: Hatch Release AND Hatch Grab Down" << std::endl;
208224
// Stop cheesecake hatch if both buttons are down.
209225
GetCargoIntake().SetHatchRotateSpeed(0.0);
210226
} else if (console.IsHatchReleaseDown()) {
227+
std::cout << "Comp Joy Input: Console: Hatch Release Down" << std::endl;
211228
GetCargoIntake().SetHatchRotateSpeed(0.5);
212229
} else if (console.IsHatchGrabDown()) {
230+
std::cout << "Comp Joy Input: Console: Hatch Grab Down" << std::endl;
213231
GetCargoIntake().SetHatchRotateSpeed(-0.5);
214232
} else {
233+
std::cout << "Comp Joy Input: Stop Hatch Rotate" << std::endl;
215234
GetCargoIntake().SetHatchRotateSpeed(0.0);
216235
}
217236

237+
if (console.GetHatchFloorPressed()) {
238+
std::cout << "Comp Joy Input: Console: Hatch Floor Pressed" << std::endl;
239+
m_ShootCargoForLevelTwoRocket->Start();
240+
}
241+
218242
if (console.GetCreeperReadyArmPressed()) {
243+
std::cout << "Comp Joy Input: Console: Creeper Ready Arm Pressed" << std::endl;
219244
m_ReadyCreeperArm->Start();
220245
} else if (console.GetClimbSequencePressed()) {
246+
std::cout << "Comp Joy Input: Console: Climb Sequence Pressed" << std::endl;
221247
m_ClimbStep->Start();
222248
}
223249

224250
// manual controls
225251
if (console.GetRetractArm()) {
252+
std::cout << "Comp Joy Input: Console: Retract Climb Arm Pressed" << std::endl;
226253
Robot::GetCreeperClimb().RotateArmToPosition("home");
227254
} else if (console.GetRetractCylinder()) {
255+
std::cout << "Comp Joy Input: Console: Retract Climb Piston Pressed" << std::endl;
228256
Robot::GetCreeperClimb().PistonRetract();
229257
}
230258

231259
if (console.GetThrottle() >= 0.75) {
260+
std::cout << "Comp Joy Input: Console: Rotate Intake/Creeper Forward" << std::endl;
232261
GetCargoIntake().SetRotateSpeed(console.GetJoystickY());
233262
} else if (console.GetThrottle() <= -0.75) {
263+
std::cout << "Comp Joy Input: Console: Rotate Intake/Creeper Backward" << std::endl;
234264
GetCreeperClimb().SetArmRotateSpeed(console.GetJoystickY());
235265
}
236266

237267
if (console.GetCreeperCrawlPressed()) {
268+
std::cout << "Comp Joy Input: Console: Creeper Crawl Pressed" << std::endl;
238269
Robot::GetCreeperClimb().SetArmWheels(true);
239270
} else if (console.GetCreeperCrawlReleased()) {
271+
std::cout << "Comp Joy Input: Console: Creeper Crawl Released" << std::endl;
240272
Robot::GetCreeperClimb().StopArmWheels();
241273
}
242274
}

src/main/cpp/commands/RotateHatchForFloor.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ bool RotateHatchForFloor::IsFinished() {
3737
}
3838

3939
// Called once after isFinished returns true
40-
void RotateHatchForFloor::End() {
41-
// Make sure the motors stop moving when they aren't being controlled.
42-
Robot::GetCargoIntake().StopRotation();
43-
}
40+
void RotateHatchForFloor::End() {}
4441

4542
// Called when another command which requires one or more of the same
4643
// subsystems is scheduled to run

src/main/deploy/compbot-config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
},
1919
"PID": {
20-
"P": 0.05,
20+
"P": 0.035,
2121
"I": 0.0,
2222
"D": 0.0
2323
},
@@ -55,7 +55,7 @@
5555
"rotation": {
5656
"zero-point": -28,
5757
"angles": {
58-
"home": 84,
58+
"home": 96,
5959
"arm-ready": 160,
6060
"arm-climb": 217
6161
}

0 commit comments

Comments
 (0)