Exploit database

GH-aa25895a970cd56800e2cefbc9e0084b

8097-botcats/22-23code

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2019-11358

1,181 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files15

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Auto1.java

Suggested starting fileJava · 3,729 bytes
package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.Servo;

import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName;
import org.openftc.apriltag.AprilTagDetection;
import org.openftc.easyopencv.OpenCvCamera;
import org.openftc.easyopencv.OpenCvCameraFactory;
import org.openftc.easyopencv.OpenCvCameraRotation;
import org.openftc.easyopencv.OpenCvWebcam;

import java.util.ArrayList;

@Autonomous(name = "Auto 1")
public class Auto1 extends LinearOpMode {

    double CIRCUMFERENCEOFWHEEL = 298.5; //mm
    double ENCODERTICKS = 537.7;
    double GEARRATIO = 1;
    double TICKSTOMMTRAVEL = (CIRCUMFERENCEOFWHEEL/ENCODERTICKS) * GEARRATIO;

    Robot robot = new Robot();

    public void runOpMode(){
        OpenCvWebcam webcam;
        int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName());
        webcam = OpenCvCameraFactory.getInstance().createWebcam(hardwareMap.get(WebcamName.class, "Webcam 1"), cameraMonitorViewId);
        robot.init(hardwareMap, telemetry);
        Servo clawServo = hardwareMap.servo.get("clawServo");


        AprilTag pipeline;

        pipeline = new AprilTag();
        webcam.setPipeline(pipeline);

        int[] IDsofInterest = {0, 1, 2};
        int detectionID = 1;
        boolean tagFound = false;


        webcam.openCameraDeviceAsync(new OpenCvCamera.AsyncCameraOpenListener() {
            @Override
            public void onOpened() {
                webcam.startStreaming(320, 240, OpenCvCameraRotation.UPRIGHT);
            }

            @Override
            public void onError(int errorCode) {
                /*
                 * This will be called if the camera could not be opened
                 */
            }
        });
        clawServo.setPosition(.25);
        while(!isStopRequested() && !isStarted()) {
            ArrayList<AprilTagDetection> detections = pipeline.getLatestDetections();
            for (AprilTagDetection detection : detections) {
                detectionID = detection.id;
                telemetry.addData("DetectionID", detectionID);
                telemetry.addData("detection.id", detection.id);
                telemetry.update();
                sleep(50);
            }
        }
        clawServo.setPosition(.25);
            telemetry.addData("monke", 1);
            telemetry.update();
        //ArrayList<AprilTagDetection> detections = pipeline.getLatestDetections();
        waitForStart();
        if (opModeIsActive()) {
            if(detectionID == 0) {
                robot.driveForwardDistance(.2,(int)(-50/TICKSTOMMTRAVEL));
                robot.driveLeftDistance(.2,(int)(670/TICKSTOMMTRAVEL));
                robot.driveForwardDistance(.2,(int)(-600/TICKSTOMMTRAVEL));
                telemetry.addData("Detection ID", 0);
                telemetry.update();
            }
            if(detectionID == 1){
                //robot.driveForwardDistance(.5, (int)(-50/TICKSTOMMTRAVEL));
                robot.driveForwardDistance(.2,(int)(-600/TICKSTOMMTRAVEL));
                telemetry.addData("Detection ID", 1);
                telemetry.update();
            }
            if(detectionID == 2) {
                robot.driveForwardDistance(.2,(int)(-50/TICKSTOMMTRAVEL));
                robot.driveRightDistance(.2,(int)(670/TICKSTOMMTRAVEL));
                robot.driveForwardDistance(.2,(int)(-600/TICKSTOMMTRAVEL));
                telemetry.addData("Detection ID", 2);
                telemetry.update();
            }

        }
    }
}