@@ -25,6 +25,7 @@ RotateHatchForDispenser* Robot::m_RotateHatchForDispenser;
25
25
26
26
ShootCargoForCargoShip* Robot::m_ShootCargoForCargoShip;
27
27
ShootCargoForLevelOneRocket* Robot::m_ShootCargoForLevelOneRocket;
28
+ ShootCargoForLevelTwoRocket* Robot::m_ShootCargoForLevelTwoRocket;
28
29
29
30
StopCargoRoller* Robot::m_StopCargoRoller;
30
31
TakeCargo* Robot::m_TakeCargo;
@@ -78,6 +79,7 @@ Robot::Robot() {
78
79
79
80
m_ShootCargoForCargoShip = new ShootCargoForCargoShip ();
80
81
m_ShootCargoForLevelOneRocket = new ShootCargoForLevelOneRocket ();
82
+ m_ShootCargoForLevelTwoRocket = new ShootCargoForLevelTwoRocket ();
81
83
82
84
m_StopCargoRoller = new StopCargoRoller ();
83
85
m_TakeCargo = new TakeCargo ();
@@ -111,7 +113,10 @@ void Robot::RobotPeriodic() {
111
113
frc::SmartDashboard::PutBoolean (" climb done" , GetCreeperClimb ().IsArmAtPosition (" arm-climb" ));
112
114
frc::Scheduler::GetInstance ()->Run ();
113
115
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) {
115
120
if (m_UsingCamera1) {
116
121
frc::CameraServer::GetInstance ()->GetServer ().SetSource (m_Camera0);
117
122
} else {
@@ -170,6 +175,7 @@ void Robot::TestPeriodic() {}
170
175
void Robot::CompetitionJoystickInput () {
171
176
// DRIVER CONTROLS
172
177
if (m_OI.GetDriverJoystick ().GetBButton () && m_CanSandstormStepDrive) {
178
+ std::cout << " Comp Joy Input: Driver: B Button Down" << std::endl;
173
179
m_DriveSandstormStepWithCargo->Start ();
174
180
m_CanSandstormStepDrive = false ;
175
181
}
@@ -178,25 +184,34 @@ void Robot::CompetitionJoystickInput() {
178
184
OperatorHID& console = m_OI.GetOperatorConsole ();
179
185
// Change rotation of cargo intake
180
186
if (console.GetFloorHatchPickupPressed ()) {
187
+ std::cout << " Comp Joy Input: Console: Floor Hatch Pickup Pressed" << std::endl;
181
188
m_RotateHatchForFloor->Start ();
182
189
} else if (console.GetFloorCargoPickupPressed ()) {
190
+ std::cout << " Comp Joy Input: Console: Floor Cargo Pickup Pressed" << std::endl;
183
191
m_TakeCargoFromFloor->Start ();
184
192
} else if (console.GetHatchFeederScorePressed ()) {
193
+ std::cout << " Comp Joy Input: Console: Hatch Feeder Score Pressed" << std::endl;
185
194
m_RotateHatchForDispenser->Start ();
186
195
} else if (console.GetRocketShotPressed ()) {
196
+ std::cout << " Comp Joy Input: Console: Rocket Shot Pressed" << std::endl;
187
197
m_RotateCargoForLevelOneRocket->Start ();
188
198
} else if (m_OI.GetOperatorConsole ().GetCargoShotPressed ()) {
199
+ std::cout << " Comp Joy Input: Console: Cargo Shot Pressed" << std::endl;
189
200
m_RotateCargoForCargoShip->Start ();
190
201
} else if (console.GetGoHomePressed ()) {
202
+ std::cout << " Comp Joy Input: Console: Stowed Pressed" << std::endl;
191
203
GetCargoIntake ().GoHome (); // CHANGE TO COMMAND
192
204
}
193
205
194
206
// action command buttons, stuff happens
195
207
if (console.GetCargoCloseShotPressed ()) {
208
+ std::cout << " Comp Joy Input: Console: Cargo Close Shot Pressed" << std::endl;
196
209
m_ShootCargoForLevelOneRocket->Start ();
197
210
} else if (console.GetCargoHighShotPressed ()) {
211
+ std::cout << " Comp Joy Input: Console: Cargo High Shot Pressed" << std::endl;
198
212
m_ShootCargoForCargoShip->Start ();
199
213
} else if (console.GetCargoIntakePressed ()) {
214
+ std::cout << " Comp Joy Input: Console: Cargo Intake Pressed" << std::endl;
200
215
if (GetCargoIntake ().IsRollerRunning ()) {
201
216
m_StopCargoRoller->Start ();
202
217
} else {
@@ -205,38 +220,55 @@ void Robot::CompetitionJoystickInput() {
205
220
}
206
221
207
222
if (console.IsHatchReleaseDown () && console.IsHatchGrabDown ()) {
223
+ std::cout << " Comp Joy Input: Console: Hatch Release AND Hatch Grab Down" << std::endl;
208
224
// Stop cheesecake hatch if both buttons are down.
209
225
GetCargoIntake ().SetHatchRotateSpeed (0.0 );
210
226
} else if (console.IsHatchReleaseDown ()) {
227
+ std::cout << " Comp Joy Input: Console: Hatch Release Down" << std::endl;
211
228
GetCargoIntake ().SetHatchRotateSpeed (0.5 );
212
229
} else if (console.IsHatchGrabDown ()) {
230
+ std::cout << " Comp Joy Input: Console: Hatch Grab Down" << std::endl;
213
231
GetCargoIntake ().SetHatchRotateSpeed (-0.5 );
214
232
} else {
233
+ std::cout << " Comp Joy Input: Stop Hatch Rotate" << std::endl;
215
234
GetCargoIntake ().SetHatchRotateSpeed (0.0 );
216
235
}
217
236
237
+ if (console.GetHatchFloorPressed ()) {
238
+ std::cout << " Comp Joy Input: Console: Hatch Floor Pressed" << std::endl;
239
+ m_ShootCargoForLevelTwoRocket->Start ();
240
+ }
241
+
218
242
if (console.GetCreeperReadyArmPressed ()) {
243
+ std::cout << " Comp Joy Input: Console: Creeper Ready Arm Pressed" << std::endl;
219
244
m_ReadyCreeperArm->Start ();
220
245
} else if (console.GetClimbSequencePressed ()) {
246
+ std::cout << " Comp Joy Input: Console: Climb Sequence Pressed" << std::endl;
221
247
m_ClimbStep->Start ();
222
248
}
223
249
224
250
// manual controls
225
251
if (console.GetRetractArm ()) {
252
+ std::cout << " Comp Joy Input: Console: Retract Climb Arm Pressed" << std::endl;
226
253
Robot::GetCreeperClimb ().RotateArmToPosition (" home" );
227
254
} else if (console.GetRetractCylinder ()) {
255
+ std::cout << " Comp Joy Input: Console: Retract Climb Piston Pressed" << std::endl;
228
256
Robot::GetCreeperClimb ().PistonRetract ();
229
257
}
230
258
231
259
if (console.GetThrottle () >= 0.75 ) {
260
+ std::cout << " Comp Joy Input: Console: Rotate Intake/Creeper Forward" << std::endl;
232
261
GetCargoIntake ().SetRotateSpeed (console.GetJoystickY ());
233
262
} else if (console.GetThrottle () <= -0.75 ) {
263
+ std::cout << " Comp Joy Input: Console: Rotate Intake/Creeper Backward" << std::endl;
234
264
GetCreeperClimb ().SetArmRotateSpeed (console.GetJoystickY ());
235
265
}
236
266
237
267
if (console.GetCreeperCrawlPressed ()) {
268
+ std::cout << " Comp Joy Input: Console: Creeper Crawl Pressed" << std::endl;
238
269
Robot::GetCreeperClimb ().SetArmWheels (true );
239
270
} else if (console.GetCreeperCrawlReleased ()) {
271
+ std::cout << " Comp Joy Input: Console: Creeper Crawl Released" << std::endl;
240
272
Robot::GetCreeperClimb ().StopArmWheels ();
241
273
}
242
274
}
0 commit comments