Skip to content

Commit 5db32c7

Browse files
Print button events to cout.
Cargo intake is running TakeCargoFromFloor command when enabling the robot. Use print debugging to verify whether queue button presses are triggering the command. Used in QF4-2 - Justin C
1 parent bde4f48 commit 5db32c7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main/cpp/Robot.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ void Robot::TestPeriodic() {}
175175
void Robot::CompetitionJoystickInput() {
176176
// DRIVER CONTROLS
177177
if (m_OI.GetDriverJoystick().GetBButton() && m_CanSandstormStepDrive) {
178+
std::cout << "Comp Joy Input: Driver: B Button Down" << std::endl;
178179
m_DriveSandstormStepWithCargo->Start();
179180
m_CanSandstormStepDrive = false;
180181
}
@@ -183,25 +184,34 @@ void Robot::CompetitionJoystickInput() {
183184
OperatorHID& console = m_OI.GetOperatorConsole();
184185
// Change rotation of cargo intake
185186
if (console.GetFloorHatchPickupPressed()) {
187+
std::cout << "Comp Joy Input: Console: Floor Hatch Pickup Pressed" << std::endl;
186188
m_RotateHatchForFloor->Start();
187189
} else if (console.GetFloorCargoPickupPressed()) {
190+
std::cout << "Comp Joy Input: Console: Floor Cargo Pickup Pressed" << std::endl;
188191
m_TakeCargoFromFloor->Start();
189192
} else if (console.GetHatchFeederScorePressed()) {
193+
std::cout << "Comp Joy Input: Console: Hatch Feeder Score Pressed" << std::endl;
190194
m_RotateHatchForDispenser->Start();
191195
} else if (console.GetRocketShotPressed()) {
196+
std::cout << "Comp Joy Input: Console: Rocket Shot Pressed" << std::endl;
192197
m_RotateCargoForLevelOneRocket->Start();
193198
} else if (m_OI.GetOperatorConsole().GetCargoShotPressed()) {
199+
std::cout << "Comp Joy Input: Console: Cargo Shot Pressed" << std::endl;
194200
m_RotateCargoForCargoShip->Start();
195201
} else if (console.GetGoHomePressed()) {
202+
std::cout << "Comp Joy Input: Console: Stowed Pressed" << std::endl;
196203
GetCargoIntake().GoHome(); // CHANGE TO COMMAND
197204
}
198205

199206
// action command buttons, stuff happens
200207
if (console.GetCargoCloseShotPressed()) {
208+
std::cout << "Comp Joy Input: Console: Cargo Close Shot Pressed" << std::endl;
201209
m_ShootCargoForLevelOneRocket->Start();
202210
} else if (console.GetCargoHighShotPressed()) {
211+
std::cout << "Comp Joy Input: Console: Cargo High Shot Pressed" << std::endl;
203212
m_ShootCargoForCargoShip->Start();
204213
} else if (console.GetCargoIntakePressed()) {
214+
std::cout << "Comp Joy Input: Console: Cargo Intake Pressed" << std::endl;
205215
if (GetCargoIntake().IsRollerRunning()) {
206216
m_StopCargoRoller->Start();
207217
} else {
@@ -210,42 +220,55 @@ void Robot::CompetitionJoystickInput() {
210220
}
211221

212222
if (console.IsHatchReleaseDown() && console.IsHatchGrabDown()) {
223+
std::cout << "Comp Joy Input: Console: Hatch Release AND Hatch Grab Down" << std::endl;
213224
// Stop cheesecake hatch if both buttons are down.
214225
GetCargoIntake().SetHatchRotateSpeed(0.0);
215226
} else if (console.IsHatchReleaseDown()) {
227+
std::cout << "Comp Joy Input: Console: Hatch Release Down" << std::endl;
216228
GetCargoIntake().SetHatchRotateSpeed(0.5);
217229
} else if (console.IsHatchGrabDown()) {
230+
std::cout << "Comp Joy Input: Console: Hatch Grab Down" << std::endl;
218231
GetCargoIntake().SetHatchRotateSpeed(-0.5);
219232
} else {
233+
std::cout << "Comp Joy Input: Stop Hatch Rotate" << std::endl;
220234
GetCargoIntake().SetHatchRotateSpeed(0.0);
221235
}
222236

223237
if (console.GetHatchFloorPressed()) {
238+
std::cout << "Comp Joy Input: Console: Hatch Floor Pressed" << std::endl;
224239
m_ShootCargoForLevelTwoRocket->Start();
225240
}
226241

227242
if (console.GetCreeperReadyArmPressed()) {
243+
std::cout << "Comp Joy Input: Console: Creeper Ready Arm Pressed" << std::endl;
228244
m_ReadyCreeperArm->Start();
229245
} else if (console.GetClimbSequencePressed()) {
246+
std::cout << "Comp Joy Input: Console: Climb Sequence Pressed" << std::endl;
230247
m_ClimbStep->Start();
231248
}
232249

233250
// manual controls
234251
if (console.GetRetractArm()) {
252+
std::cout << "Comp Joy Input: Console: Retract Climb Arm Pressed" << std::endl;
235253
Robot::GetCreeperClimb().RotateArmToPosition("home");
236254
} else if (console.GetRetractCylinder()) {
255+
std::cout << "Comp Joy Input: Console: Retract Climb Piston Pressed" << std::endl;
237256
Robot::GetCreeperClimb().PistonRetract();
238257
}
239258

240259
if (console.GetThrottle() >= 0.75) {
260+
std::cout << "Comp Joy Input: Console: Rotate Intake/Creeper Forward" << std::endl;
241261
GetCargoIntake().SetRotateSpeed(console.GetJoystickY());
242262
} else if (console.GetThrottle() <= -0.75) {
263+
std::cout << "Comp Joy Input: Console: Rotate Intake/Creeper Backward" << std::endl;
243264
GetCreeperClimb().SetArmRotateSpeed(console.GetJoystickY());
244265
}
245266

246267
if (console.GetCreeperCrawlPressed()) {
268+
std::cout << "Comp Joy Input: Console: Creeper Crawl Pressed" << std::endl;
247269
Robot::GetCreeperClimb().SetArmWheels(true);
248270
} else if (console.GetCreeperCrawlReleased()) {
271+
std::cout << "Comp Joy Input: Console: Creeper Crawl Released" << std::endl;
249272
Robot::GetCreeperClimb().StopArmWheels();
250273
}
251274
}

0 commit comments

Comments
 (0)