Exploit databaseDownload repository ZIP
GH-ab1a20fab9474c4d9d492a1991945c22
8872/centerstage
Sources for CVE-2019-11358
1,181 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files1
8872/centerstageRevision f85f8dbab50d
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/pathPieces/audienceStart/blue/BluePurplePixelAu.java
Java · 7,310 bytespackage org.firstinspires.ftc.teamcode.auto.pathPieces.audienceStart.blue;
import com.acmerobotics.dashboard.config.Config;
import com.acmerobotics.roadrunner.geometry.Pose2d;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import org.firstinspires.ftc.teamcode.auto.util.AutoBaseOpmode;
import org.firstinspires.ftc.teamcode.roadrunner.drive.DriveConstants;
import org.firstinspires.ftc.teamcode.roadrunner.drive.SampleMecanumDrive;
import org.firstinspires.ftc.teamcode.util.commands.DelayedCommand;
@Config
@TeleOp(name="Blue Purple Pixel Au", group = "ZZZ")
public class BluePurplePixelAu extends AutoBaseOpmode {
public enum State{
WAIT_FOR_START,
MOVE_TO_PROP,
EJECT_AND_MOVE_TO_STACK,
WAIT_FOR_FINISH,
FINISHED
}
public static State currentState = State.WAIT_FOR_START;
public static boolean red = false;
public static int zone = 3;
public static double waitTime = 1.5;
public static double x1 = -48.5;
public static double y1 = 36;
public static double x2 = -35;
public static double y2 = 36;
public static double x3 = -32;
public static double y3 = 38;
public static double angle2 = 80;
public static double angle3 = 60;
public static double pixelX = -56.5;
public static double pixelY = 36;
public static boolean testing = false;
@Override
public void init(){
super.init();
testing = false;
currentState = State.WAIT_FOR_START;
if(red)
drive.setPoseEstimate(new Pose2d(-41.75, -63.00, Math.toRadians(90.00)));
else
drive.setPoseEstimate(new Pose2d(-41.75, 63.00, Math.toRadians(-90.00)));
}
@Override
public void loop() {
super.loop();
drive.update();
//drive fsm
if(gamepad1.right_bumper && !testing){
testing = true;
currentState = State.MOVE_TO_PROP;
}
if(gamepad1.left_bumper && testing){
testing = false;
if(red){
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(drive.getPoseEstimate())
.lineToLinearHeading(new Pose2d(-41.75, -63.00, Math.toRadians(90.00)))
.build());
}else{
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(drive.getPoseEstimate())
.lineToLinearHeading(new Pose2d(-41.75, 63.00, Math.toRadians(-90.00)))
.build());
}
}
//TODO: delete testing above
if(currentState == State.MOVE_TO_PROP){
if(red){
switch(zone) {
case 1:
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(new Pose2d(-41.75, -63.00, Math.toRadians(90.00)))
.lineToSplineHeading(new Pose2d(x1, -y1, Math.toRadians(90.00)))
.build());
break;
case 2:
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(new Pose2d(-41.75, -63.00, Math.toRadians(90.00)))
.lineToSplineHeading(new Pose2d(x2, -y2, Math.toRadians(angle2)))
.build());
break;
case 3:
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(new Pose2d(-41.75, -63.00, Math.toRadians(90.00)))
.splineToSplineHeading(new Pose2d(x3, -y3, Math.toRadians(angle3)), Math.toRadians(50))
.build());
break;
}
}else{
switch(zone) {
case 1:
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(new Pose2d(-41.75, 63.00, Math.toRadians(-90.00)))
.splineToSplineHeading(new Pose2d(x3, y3, Math.toRadians(-angle3)), Math.toRadians(-50))
.build());
break;
case 2:
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(new Pose2d(-41.75, 63.00, Math.toRadians(-90.00)))
.lineToSplineHeading(new Pose2d(x2, y2, Math.toRadians(-angle2)))
.build());
break;
case 3:
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(new Pose2d(-41.75, 63.00, Math.toRadians(-90.00)))
.lineToSplineHeading(new Pose2d(x1, y1, Math.toRadians(-90.00)))
.build());
break;
}
}
currentState = State.EJECT_AND_MOVE_TO_STACK;
}
//could replace isBusy with a posEstimate check if need efficiency
if(currentState == State.EJECT_AND_MOVE_TO_STACK && !drive.isBusy()) {
//intake fsm
//signal with a displacement marker that changes an enum
schedule(intakeSubsystem.runIntake(-0.5));
schedule(new DelayedCommand(intakeSubsystem.runIntake(0), (long)waitTime*1000));
//drive fsm
if(red){
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(drive.getPoseEstimate())
.back(15,
SampleMecanumDrive.getVelocityConstraint(40, DriveConstants.MAX_ANG_VEL, DriveConstants.TRACK_WIDTH),
SampleMecanumDrive.getAccelerationConstraint(40))
.lineToLinearHeading(new Pose2d(pixelX, -pixelY, Math.toRadians(180.00)),
SampleMecanumDrive.getVelocityConstraint(60, DriveConstants.MAX_ANG_VEL, DriveConstants.TRACK_WIDTH),
SampleMecanumDrive.getAccelerationConstraint(70))
.build());
}else{
drive.followTrajectorySequenceAsync(drive.trajectorySequenceBuilder(drive.getPoseEstimate())
.back(15,
SampleMecanumDrive.getVelocityConstraint(40, DriveConstants.MAX_ANG_VEL, DriveConstants.TRACK_WIDTH),
SampleMecanumDrive.getAccelerationConstraint(40))
.lineToLinearHeading(new Pose2d(pixelX, pixelY, Math.toRadians(180.00)),
SampleMecanumDrive.getVelocityConstraint(60, DriveConstants.MAX_ANG_VEL, DriveConstants.TRACK_WIDTH),
SampleMecanumDrive.getAccelerationConstraint(70))
.build());
}
currentState = State.WAIT_FOR_FINISH;
}
if(currentState == State.WAIT_FOR_FINISH && !drive.isBusy()){
currentState = State.FINISHED;
}
}
public static void run(int detectedZone, boolean redSide){
zone = detectedZone;
red = redSide;
currentState = State.MOVE_TO_PROP;
}
public static boolean isFinished(){
return currentState == State.FINISHED;
}
}