Exploit database

GH-bd1a05cfb24b577b4e605ef0649e6b5b

28shettr/pphazmat

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 files2

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

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Autos/SpecAuto.java

Suggested starting fileJava · 22,282 bytes
package org.firstinspires.ftc.teamcode.Autos;

import com.pedropathing.follower.Follower;
import com.pedropathing.localization.Pose;
import com.pedropathing.pathgen.BezierCurve;
import com.pedropathing.pathgen.BezierLine;
import com.pedropathing.pathgen.Path;
import com.pedropathing.pathgen.PathChain;
import com.pedropathing.pathgen.Point;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.rowanmcalpin.nextftc.core.command.Command;
import com.rowanmcalpin.nextftc.core.command.groups.ParallelGroup;
import com.rowanmcalpin.nextftc.core.command.groups.SequentialGroup;
import com.rowanmcalpin.nextftc.core.command.utility.delays.Delay;
import com.rowanmcalpin.nextftc.core.units.TimeSpan;
import com.rowanmcalpin.nextftc.ftc.OpModeData;
import com.rowanmcalpin.nextftc.pedro.FollowPath;
import com.rowanmcalpin.nextftc.pedro.PedroOpMode;

import org.firstinspires.ftc.teamcode.Subsystems.Claw;
import org.firstinspires.ftc.teamcode.Subsystems.IntakeSlide;
import org.firstinspires.ftc.teamcode.Subsystems.Outtake;
import org.firstinspires.ftc.teamcode.tuners_tests.constants.FConstants;
import org.firstinspires.ftc.teamcode.tuners_tests.constants.LConstants;


/**
 * This is an example auto that showcases movement and control of two servos autonomously.
 * It is a 0+4 (Specimen + Sample) bucket auto. It scores a neutral preload and then pickups 3 samples from the ground and scores them before parking.
 * There are examples of different ways to build paths.
 * A path progression method has been created and can advance based on time, position, or other factors.
 *
 * @author Baron Henderson - 20077 The Indubitables
 * @version 2.0, 11/28/2024
 */

@Autonomous(name = "Specimen Auto'")
public class SpecAuto extends PedroOpMode {
    public SpecAuto() {
        super(Claw.INSTANCE,IntakeSlide.INSTANCE,Outtake.INSTANCE);
    }

    /** This is the variable where we store the state of our auto.
     * It is used by the pathUpdate method. */
    public int pathState;

    /* Create and Define Poses + Paths
     * Poses are built with three constructors: x, y, and heading (in Radians).
     * Pedro uses 0 - 144 for x and y, with 0, 0 being on the bottom left.
     * (For Into the Deep, this would be Blue Observation Zone (0,0) to Red Observation Zone (144,144).)
     * Even though Pedro uses a different coordinate system than RR, you can convert any roadrunner pose by adding +72 both the x and y.
     * This visualizer is very easy to use to find and create paths/pathchains/poses: <https://pedro-path-generator.vercel.app/>
     * Lets assume our robot is 18 by 18 inches
     * Lets assume the Robot is facing the human player and we want to score in the bucket */

    /** Start Pose of our robot */
    private final Pose startPose = new Pose(0, 0, Math.toRadians(0));

    /** Scoring Pose of our robot. It is facing the submersible at a -45 degree (315 degree) angle. */
    private final Pose scorePreLoadPose = new Pose(10.67, 12.5, Math.toRadians(326.2769));

    /** Lowest (First) Sample from the Spike Mark */
    private final Pose nearSamplePose = new Pose(10.68, 12.6, Math.toRadians(335.63));
    private final Pose dropNearSamplePose = new Pose(10.68, 12.6, Math.toRadians(335.63));


    /** Middle (Second) Sample from the Spike Mark */
    private final Pose middleSamplePose = new Pose(17.47, 19.17, Math.toRadians(354.88));
    private final Pose dropMiddleSamplePose = new Pose(17.47, 19.17, Math.toRadians(354.88));


    /** Highest (Third) Sample from the Spike Mark */
    private final Pose farSamplePose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));
    private final Pose dropFarSamplePose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));

    /** Pick and Score Pos */
    private final Pose pickSpecimenPose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));
    private final Pose scoreSpec1Pose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));

    private final Pose scoreSpec2Pose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));
    private final Pose scoreSpec3Pose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));
    private final Pose scoreSpec4Pose = new Pose(20.75, 17.9175, Math.toRadians(34.6144));







    /** Park Pose for our robot, after we do all of the scoring. */
    private final Pose parkPose = new Pose(56.3236, -17.465, Math.toRadians(270));

    /** Park Control Pose for our robot, this is used to manipulate the bezier curve that we will create for the parking.
     * The Robot will not go to this pose, it is used a control point for our bezier curve. */
    private final Pose parkControlPose = new Pose(56.3236, 3, Math.toRadians(90));

    /* These are our Paths and PathChains that we will define in buildPaths() */
    private Path scorePreload, park;
    private PathChain grabNearSample, dropNearSample, grabMiddleSample,dropMiddleSample, grabFarSample, dropFarSample, pickSpec1, pickSpec2, pickSpec3, pickSpec4, scoreSpec1, scoreSpec2, scoreSpec3, scoreSpec4;

    /** Build the paths for the auto (adds, for example, constant/linear headings while doing paths)
     * It is necessary to do this so that all the paths are built before the auto starts. **/
    public void buildPaths() {

        /* There are two major types of paths components: BezierCurves and BezierLines.
         *    * BezierCurves are curved, and require >= 3 points. There are the start and end points, and the control points.
         *    - Control points manipulate the curve between the start and end points.
         *    - A good visualizer for this is [this](https://pedro-path-generator.vercel.app/).
         *    * BezierLines are straight, and require 2 points. There are the start and end points.
         * Paths have can have heading interpolation: Constant, Linear, or Tangential
         *    * Linear heading interpolation:
         *    - Pedro will slowly change the heading of the robot from the startHeading to the endHeading over the course of the entire path.
         *    * Constant Heading Interpolation:
         *    - Pedro will maintain one heading throughout the entire path.
         *    * Tangential Heading Interpolation:
         *    - Pedro will follows the angle of the path such that the robot is always driving forward when it follows the path.
         * PathChains hold Path(s) within it and are able to hold their end point, meaning that they will holdPoint until another path is followed.
         * Here is a explanation of the difference between Paths and PathChains <https://pedropathing.com/commonissues/pathtopathchain.html> */

        scorePreload = new Path(new BezierLine(new Point(startPose), new Point(scorePreLoadPose)));
        scorePreload.setLinearHeadingInterpolation(startPose.getHeading(), scorePreLoadPose.getHeading());


        grabNearSample = follower.pathBuilder()
                .addPath(new BezierLine(new Point(scorePreLoadPose), new Point(nearSamplePose)))
                .setLinearHeadingInterpolation(scorePreLoadPose.getHeading(), nearSamplePose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        dropNearSample = follower.pathBuilder()
                .addPath(new BezierLine(new Point(nearSamplePose), new Point(dropNearSamplePose)))
                .setLinearHeadingInterpolation(nearSamplePose.getHeading(), dropNearSamplePose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        grabMiddleSample = follower.pathBuilder()
                .addPath(new BezierLine(new Point(dropNearSamplePose), new Point(middleSamplePose)))
                .setLinearHeadingInterpolation(dropNearSamplePose.getHeading(), middleSamplePose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        dropMiddleSample = follower.pathBuilder()
                .addPath(new BezierLine(new Point(middleSamplePose), new Point(dropMiddleSamplePose)))
                .setLinearHeadingInterpolation(middleSamplePose.getHeading(), dropMiddleSamplePose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        grabFarSample = follower.pathBuilder()
                .addPath(new BezierLine(new Point(dropMiddleSamplePose), new Point(farSamplePose)))
                .setLinearHeadingInterpolation(dropMiddleSamplePose.getHeading(), farSamplePose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        dropFarSample = follower.pathBuilder()
                .addPath(new BezierLine(new Point(farSamplePose), new Point(dropFarSamplePose)))
                .setLinearHeadingInterpolation(farSamplePose.getHeading(), dropFarSamplePose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

         pickSpec1 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(dropFarSamplePose), new Point(pickSpecimenPose)))
                .setLinearHeadingInterpolation(dropFarSamplePose.getHeading(), pickSpecimenPose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        scoreSpec1 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(pickSpecimenPose), new Point(scoreSpec1Pose)))
                .setLinearHeadingInterpolation(pickSpecimenPose.getHeading(), scoreSpec1Pose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        pickSpec2 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(scoreSpec1Pose), new Point(pickSpecimenPose)))
                .setLinearHeadingInterpolation(scoreSpec1Pose.getHeading(), pickSpecimenPose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        scoreSpec2 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(pickSpecimenPose), new Point(scoreSpec2Pose)))
                .setLinearHeadingInterpolation(pickSpecimenPose.getHeading(), scoreSpec2Pose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        pickSpec3 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(scoreSpec2Pose), new Point(pickSpecimenPose)))
                .setLinearHeadingInterpolation(scoreSpec2Pose.getHeading(), pickSpecimenPose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        scoreSpec3 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(pickSpecimenPose), new Point(scoreSpec3Pose)))
                .setLinearHeadingInterpolation(pickSpecimenPose.getHeading(), scoreSpec3Pose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        pickSpec4 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(scoreSpec3Pose), new Point(pickSpecimenPose)))
                .setLinearHeadingInterpolation(scoreSpec3Pose.getHeading(), pickSpecimenPose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();

        scoreSpec4 = follower.pathBuilder()
                .addPath(new BezierLine(new Point(pickSpecimenPose), new Point(scoreSpec4Pose)))
                .setLinearHeadingInterpolation(pickSpecimenPose.getHeading(), scoreSpec4Pose.getHeading())
                .setPathEndTimeoutConstraint(0.3)
                .build();


        park = new Path(new BezierCurve(new Point(scoreSpec4Pose), /* Control Point */ new Point(parkControlPose), new Point(parkPose)));
        park.setLinearHeadingInterpolation(scoreSpec4Pose.getHeading(), parkPose.getHeading());
    }

    /** This switch is called continuously and runs the pathing, at certain points, it triggers the action state.
     * Everytime the switch changes case, it will reset the timer. (This is because of the setPathState() method)
     * The followPath() function sets the follower to run the specific path, but does NOT wait for it to finish before moving on. */
    public void autonomousPathUpdate() {
        switch (pathState) {
            case 0:
                follower.followPath(scorePreload);
                setPathState(1);
                break;
            case 1:

                /* You could check for
                - Follower State: "if(!follower.isBusy() {}"
                - Time: "if(pathTimer.getElapsedTimeSeconds() > 1) {}"
                - Robot Position: "if(follower.getPose().getX() > 36) {}"
                */

                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Preload */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are grabbing the sample */
                    follower.followPath(grabNearSample,true);
                    setPathState(2);
                }
                break;
            case 2:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the pickup1Pose's position */
                if(!follower.isBusy()) {
                    /* Grab Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are scoring the sample */
                    follower.followPath(dropNearSample,true);
                    setPathState(3);
                }
                break;
            case 3:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are grabbing the sample */
                    follower.followPath(grabMiddleSample,true);
                    setPathState(4);
                }
                break;
            case 4:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the pickup2Pose's position */
                if(!follower.isBusy()) {
                    /* Grab Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are scoring the sample */
                    follower.followPath(dropMiddleSample,true);
                    setPathState(5);
                }
                break;
            case 5:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are grabbing the sample */
                    follower.followPath(grabFarSample,true);
                    setPathState(6);
                }
                break;
            case 6:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the pickup3Pose's position */
                if(!follower.isBusy()) {
                    /* Grab Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are scoring the sample */
                    follower.followPath(dropFarSample, true);
                    setPathState(7);
                }
                break;
            case 7:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(pickSpec1,true);
                    setPathState(8);
                }
                break;
            case 8:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(scoreSpec1,true);
                    setPathState(9);
                }
                break;
            case 9:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(pickSpec2,true);
                    setPathState(10);
                }
                break;
            case 10:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(scoreSpec2,true);
                    setPathState(11);
                }
                break;
            case 11:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(pickSpec3,true);
                    setPathState(12);
                }
                break;
            case 12:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(scoreSpec3,true);
                    setPathState(13);
                }
                break;
            case 13:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(pickSpec4,true);
                    setPathState(14);
                }
                break;
            case 14:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(scoreSpec4,true);
                    setPathState(15);
                }
                break;
            case 15:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Score Sample */

                    /* Since this is a pathChain, we can have Pedro hold the end point while we are parked */
                    follower.followPath(park,true);
                    setPathState(16);
                }
                break;
            case 16:
                /* This case checks the robot's position and will wait until the robot position is close (1 inch away) from the scorePose's position */
                if(!follower.isBusy()) {
                    /* Level 1 Ascent */

                    /* Set the state to a Case we won't use or define, so it just stops running an new paths */
                    setPathState(-1);
                }
                break;
        }
    }



    /** These change the states of the paths and actions
     * It will also reset the timers of the individual switches **/
    public void setPathState(int pState) {
        pathState = pState;
    }

    /** This is the main loop of the OpMode, it will run repeatedly after clicking "Play". **/
    @Override
    public void onUpdate() {

        // These loop the movements of the robot

        // Feedback to Driver Hub
        telemetry.addData("path state", pathState);
        telemetry.addData("x", follower.getPose().getX());
        telemetry.addData("y", follower.getPose().getY());
        telemetry.addData("heading", follower.getPose().getHeading());
        telemetry.update();
    }
    OpModeData.Alliance alliance = OpModeData.Alliance.RED; // default

    /** This method is called once at the init of the OpMode. **/
    @Override
    public void onInit() {


        telemetry.addData("Alliance", alliance.name());
        telemetry.addLine("Press CIRCLE for RED, SQUARE for BLUE");
        telemetry.update();

        follower = new Follower(hardwareMap, FConstants.class, LConstants.class);
        follower.setStartingPose(startPose);
        buildPaths();
    }
    public void onWaitForStart() {
        if (gamepad1.circleWasPressed()) {
            alliance = OpModeData.Alliance.RED;
        } else if (gamepad1.squareWasPressed()) {
            alliance = OpModeData.Alliance.BLUE;
        }

        telemetry.addData("Alliance", alliance.name());
        telemetry.update();
    }




    /** This method is called once at the start of the OpMode.
     * It runs all the setup actions, including building paths and starting the path system **/
    @Override
    public void onStartButtonPressed() {

    }


}