Exploit database

GH-ebd06f6dfc1233af1a9a3253ae1d82e3

731wannabeestrange/ftc-731-powerplay

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 files7

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

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/autonomous/commandbased/commands/DepositCone.java

Java · 2,440 bytes
package org.firstinspires.ftc.teamcode.autonomous.commandbased.commands;

import com.arcrobotics.ftclib.command.CommandBase;
import com.qualcomm.robotcore.util.ElapsedTime;

import org.firstinspires.ftc.teamcode.robot.subsystems.Lift;

public class DepositCone extends CommandBase {
    private final Lift liftSubsystem;
    private final Lift.LiftState desiredState;
    private final int yawArmAngle;

    private final ElapsedTime eTime = new ElapsedTime(ElapsedTime.Resolution.SECONDS);

    private enum DepositState {
        RAISING,
        MOVING_ARM,
        DROPPING,
        RETRACTING,
        IDLE
    }

    private DepositState depositState = DepositState.IDLE;

    public DepositCone(Lift subsystem, Lift.LiftState height, int angle) {
        liftSubsystem = subsystem;
        desiredState = height;
        yawArmAngle = angle;
        addRequirements(liftSubsystem);
    }

    @Override
    public void initialize() {
        liftSubsystem.setLiftState(desiredState);
        depositState = DepositState.RAISING;
    }

    @Override
    public void execute() {
        switch (depositState) {
            case RAISING:
                if (liftSubsystem.canControlArm()) {
                    liftSubsystem.setYawArmAngle(yawArmAngle);
                    liftSubsystem.setYawArmExtensionState(Lift.YawArmState.EXTENDED);
                    depositState = DepositState.MOVING_ARM;
                }
                break;
            case MOVING_ARM:
                if (!liftSubsystem.isYawArmBusy() && !liftSubsystem.isBusy()) {
                    liftSubsystem.openGrabber();
                    eTime.reset();
                    depositState = DepositState.DROPPING;
                }
                break;
            case DROPPING:
                if (eTime.time() > 0.5) {
                    liftSubsystem.setLiftState(Lift.LiftState.RETRACT);
                    liftSubsystem.setYawArmExtensionState(Lift.YawArmState.RETRACTED);
                    depositState = DepositState.RETRACTING;
                }
                break;
            case RETRACTING:
                if (!liftSubsystem.isBusy() && !liftSubsystem.isYawArmBusy()) {
                    depositState = DepositState.IDLE;
                }
                break;
            case IDLE:
                break;
        }
    }

    @Override
    public boolean isFinished() {
        return depositState == DepositState.IDLE;
    }
}