Merge remote-tracking branch 'origin/add-tilt' into cowtown-work
This commit is contained in:
@@ -28,6 +28,8 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
Turret turret;
|
Turret turret;
|
||||||
Flywheel flywheel;
|
Flywheel flywheel;
|
||||||
|
|
||||||
|
ParkTilter parkTilter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runOpMode() throws InterruptedException {
|
public void runOpMode() throws InterruptedException {
|
||||||
|
|
||||||
@@ -47,6 +49,8 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
flywheel = new Flywheel(robot);
|
flywheel = new Flywheel(robot);
|
||||||
turret = new Turret(robot);
|
turret = new Turret(robot);
|
||||||
|
|
||||||
|
parkTilter = new ParkTilter(robot);
|
||||||
|
|
||||||
|
|
||||||
shooter = new Shooter(robot, TELE, follower, Color.redAlliance, turret, flywheel);
|
shooter = new Shooter(robot, TELE, follower, Color.redAlliance, turret, flywheel);
|
||||||
shooter.setState(Shooter.ShooterState.TRACK_GOAL);
|
shooter.setState(Shooter.ShooterState.TRACK_GOAL);
|
||||||
@@ -102,6 +106,12 @@ public class TeleopV4 extends LinearOpMode {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gamepad1.dpad_down){
|
||||||
|
parkTilter.park();
|
||||||
|
} else if (gamepad1.dpad_up) {
|
||||||
|
parkTilter.unpark();
|
||||||
|
}
|
||||||
|
|
||||||
TELE.update();
|
TELE.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package org.firstinspires.ftc.teamcode.utilsv2;
|
||||||
|
|
||||||
|
import com.qualcomm.robotcore.hardware.Servo;
|
||||||
|
|
||||||
|
import org.firstinspires.ftc.teamcode.constants.ServoPositions;
|
||||||
|
|
||||||
|
public class ParkTilter {
|
||||||
|
Robot robot;
|
||||||
|
public ParkTilter (Robot rob) {
|
||||||
|
this.robot = rob;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void park() {
|
||||||
|
robot.setTilt1Pos(ServoPositions.tilt1_down);
|
||||||
|
robot.setTilt2Pos(ServoPositions.tilt2_down);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unpark() {
|
||||||
|
robot.setTilt1Pos(ServoPositions.tilt1_up);
|
||||||
|
robot.setTilt2Pos(ServoPositions.tilt2_up);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user