Skip to content

Commit 007b91d

Browse files
committed
Auto & teleop work during scrimmage
1 parent bca8d0c commit 007b91d

File tree

2 files changed

+58
-5
lines changed

2 files changed

+58
-5
lines changed

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LOADCode/Main_/Auto_/Auto_Main_.java

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public void onInit() {
5858
));
5959
prompter.prompt("auto",
6060
new OptionPrompt<>("Select Auto",
61-
new Leave_Far_Generic(),
61+
new Near_12Ball(),
62+
new Near_9Ball(),
6263
new Leave_Far_Generic()
6364
//new test_Auto(),
6465
//new Complex_Test_Auto()
@@ -181,7 +182,7 @@ public void runAuto(){
181182
public String toString(){return "Far Zone No Turret Generic";}
182183
}
183184

184-
private class Near_Generic extends Auto{
185+
private class Near_9Ball extends Auto{
185186
public Pose startPose = paths.nearStart;
186187
public boolean turretEnabled = true;
187188

@@ -217,7 +218,51 @@ public void runAuto(){
217218

218219
@NonNull
219220
@Override
220-
public String toString(){return "Near Zone No Turret Generic";}
221+
public String toString(){return "Near Zone 9 Ball Auto";}
222+
}
223+
224+
private class Near_12Ball extends Auto{
225+
public Pose startPose = paths.nearStart;
226+
public boolean turretEnabled = true;
227+
228+
@Override
229+
public Pose getStartPose(){
230+
return startPose;
231+
}
232+
@Override
233+
public boolean getTurretEnabled(){
234+
return turretEnabled;
235+
}
236+
237+
@Override
238+
public void runAuto(){
239+
new SequentialGroup(
240+
Commands.setIntakeMode(Intake.intakeMode.INTAKING),
241+
new InstantCommand(Commands.setFlywheelState(Turret.flywheelState.ON)),
242+
Commands.runPath(paths.nearStart_to_midShoot, true, 1),
243+
Commands.shootBalls(),
244+
Commands.setFlywheelState(Turret.flywheelState.ON),
245+
Commands.setIntakeMode(Intake.intakeMode.INTAKING),
246+
Commands.runPath(paths.midShoot_to_nearPreload, true, 1),
247+
Commands.runPath(paths.nearPreload_to_midShoot, true, 1),
248+
Commands.shootBalls(),
249+
Commands.setFlywheelState(Turret.flywheelState.ON),
250+
Commands.setIntakeMode(Intake.intakeMode.INTAKING),
251+
Commands.runPath(paths.midShoot_to_midPreload, true, 1),
252+
Commands.runPath(paths.midPreload_to_midShoot, true, 1),
253+
Commands.shootBalls(),
254+
Commands.setFlywheelState(Turret.flywheelState.ON),
255+
Commands.setIntakeMode(Intake.intakeMode.INTAKING),
256+
Commands.runPath(paths.midShoot_to_farPreload, true, 1),
257+
Commands.runPath(paths.farPreload_to_midShoot, true, 1),
258+
Commands.shootBalls(),
259+
Commands.runPath(paths.midShoot_to_nearLeave, true, 1)
260+
).schedule();
261+
}
262+
263+
@NonNull
264+
@Override
265+
public String toString(){return "Near Zone 12 Ball Auto";}
221266
}
222267

223268
/**

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/LOADCode/Main_/Teleop_/Teleop_Main_.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class Teleop_Main_ extends LinearOpMode {
6868
public static double DylanStickDeadzones = 0.2;
6969

7070
public int shootingState = 0;
71-
public boolean turretOn = false;
71+
public boolean turretOn = true;
7272
public TimerEx stateTimer = new TimerEx(1);
7373
public double hoodOffset = 0;
7474

@@ -255,6 +255,14 @@ public void Gamepad1() {
255255
Robot.drivetrain.speedMultiplier = 0.66;
256256
}
257257

258+
if (gamepad1.bWasPressed()){
259+
if (selectedAlliance == LoadHardwareClass.Alliance.RED){
260+
Robot.drivetrain.follower.setPose(new Pose(8, 8, Math.toRadians(90)));
261+
}else if (selectedAlliance == LoadHardwareClass.Alliance.BLUE){
262+
Robot.drivetrain.follower.setPose(new Pose(136, 8, Math.toRadians(90)));
263+
}
264+
}
265+
258266
double turnMult = 2;
259267
// if (gamepad1.left_stick_y == 0 && gamepad1.left_stick_x == 0){
260268
// turnMult = 1;
@@ -364,7 +372,7 @@ public void Gamepad2() {
364372

365373
//Shoot (B Button Press)
366374
// Increment the shooting state
367-
if (gamepad2.bWasPressed() && shootingState < 2 && Robot.turret.getFlywheelRPM() > Robot.turret.getFlywheelCurrentMaxSpeed()-200) {
375+
if (gamepad2.bWasPressed() && shootingState < 1 && Robot.turret.getFlywheelRPM() > Robot.turret.getFlywheelCurrentMaxSpeed()-100) {
368376
shootingState++;
369377
}
370378
switch (shootingState) {

0 commit comments

Comments
 (0)